Commit d949a974 authored by rattoma's avatar rattoma
Browse files

get rid of statistics toolbox

git-svn-id: file:///home/sebastien/dynare/gsa_dyn@32 f1850c17-3b45-254b-b221-fcb05880fee1
parent df458336
This diff is collapsed.
function s = myboxplot (data,notched,symbol,vertical,maxwhisker)
function sout = myboxplot (data,notched,symbol,vertical,maxwhisker)
% sout = myboxplot (data,notched,symbol,vertical,maxwhisker)
% % % % endif
if nargin < 5, maxwhisker = 1; end
if nargin < 4, vertical = 1; end
if nargin < 3, symbol = ['+','o']; end
if nargin < 2, notched = 0; end
if nargin < 5 | isempty(maxwhisker), maxwhisker = 1.5; end
if nargin < 4 | isempty(vertical), vertical = 1; end
if nargin < 3 | isempty(symbol), symbol = ['+','o']; end
if nargin < 2 | isempty(notched), notched = 0; end
if length(symbol)==1, symbol(2)=symbol(1); end
......@@ -128,8 +129,8 @@ cap_y = whisker_y([1,1],:);
%
% ## Do the plot
mm=min(min(col));
MM=max(max(col));
mm=min(min(data));
MM=max(max(data));
if vertical
plot (quartile_x, quartile_y, 'b', ...
......@@ -151,4 +152,7 @@ else
% % % % % outliers2_y, outliers2_x, [symbol(2),"r;;"]);
end
if nargout,
sout=s;
end
% % % endfunction
\ No newline at end of file
......@@ -106,17 +106,17 @@ for i = 1:npar
case 5% Uniform prior.
pdraw(:,i) = rdraw(:,i)*(p4(i)-p3(i)) + p3(i);
case 3% Gaussian prior.
pdraw(:,i) = norminv(rdraw(:,i),pmean(i),pstd(i));
pdraw(:,i) = norm_inv(rdraw(:,i),pmean(i),pstd(i));
case 2% Gamma prior.
pdraw(:,i) = gaminv(rdraw(:,i),a(i),b(i))+p3(i);
pdraw(:,i) = gamm_inv(rdraw(:,i),a(i),b(i))+p3(i);
case 1% Beta distribution (TODO: generalized beta distribution)
pdraw(:,i) = betainv(rdraw(:,i),a(i),b(i))*(p4(i)-p3(i))+p3(i);
pdraw(:,i) = beta_inv(rdraw(:,i),a(i),b(i))*(p4(i)-p3(i))+p3(i);
case 4% INV-GAMMA1 distribution
% TO BE CHECKED
pdraw(:,i) = sqrt(1./gaminv(rdraw(:,i),p2(i)/2,2/p1(i)));
pdraw(:,i) = sqrt(1./gamm_inv(rdraw(:,i),p2(i)/2,2/p1(i)));
case 6% INV-GAMMA2 distribution
% TO BE CHECKED
pdraw(:,i) = 1./gaminv(rdraw(:,i),p2(i)/2,2/p1(i));
pdraw(:,i) = 1./gamm_inv(rdraw(:,i),p2(i)/2,2/p1(i));
otherwise
% Nothing to do here.
end
......
......@@ -130,17 +130,17 @@ for j=1:size(anamendo,1)
subplot(3,3,iplo),
if ilog,
[saso, iso] = sort(-silog(:,js));
bar([silog(iso(1:10),js)])
bar([silog(iso(1:min(np,10)),js)])
logflag='log';
else
[saso, iso] = sort(-si(:,js));
bar(si(iso(1:10),js))
bar(si(iso(1:min(np,10)),js))
logflag='';
end
%set(gca,'xticklabel',pnames(iso(1:10),:),'fontsize',8)
%set(gca,'xticklabel',pnames(iso(1:min(np,10)),:),'fontsize',8)
set(gca,'xticklabel',' ','fontsize',10)
set(gca,'xlim',[0.5 10.5])
for ip=1:10,
for ip=1:min(np,10),
text(ip,-0.02,deblank(pnames(iso(ip),:)),'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
title([logflag,' ',namendo,' vs. ',namexo],'interpreter','none')
......@@ -205,17 +205,17 @@ for j=1:size(anamendo,1)
subplot(3,3,iplo),
if ilog,
[saso, iso] = sort(-silog(:,js));
bar([silog(iso(1:10),js)])
bar([silog(iso(1:min(np,10)),js)])
logflag='log';
else
[saso, iso] = sort(-si(:,js));
bar(si(iso(1:10),js))
bar(si(iso(1:min(np,10)),js))
logflag='';
end
%set(gca,'xticklabel',pnames(iso(1:10),:),'fontsize',8)
%set(gca,'xticklabel',pnames(iso(1:min(np,10)),:),'fontsize',8)
set(gca,'xticklabel',' ','fontsize',10)
set(gca,'xlim',[0.5 10.5])
for ip=1:10,
for ip=1:min(np,10),
text(ip,-0.02,deblank(pnames(iso(ip),:)),'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
title([logflag,' ',namendo,' vs. ',namlagendo,'(-1)'],'interpreter','none')
......@@ -239,7 +239,8 @@ end
if ilog==0,
figure, %bar(si)
boxplot(si','whis',10,'symbol','r.')
% boxplot(si','whis',10,'symbol','r.')
myboxplot(si',[],'.',[],10)
xlabel(' ')
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:np])
set(gca,'xlim',[0.5 np+0.5])
......@@ -256,7 +257,8 @@ eval(['print -dpdf ' dirname,'\',M_.fname,'_redform_gsa']);
else
figure, %bar(silog)
boxplot(silog','whis',10,'symbol','r.')
% boxplot(silog','whis',10,'symbol','r.')
boxplot(silog',[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:np])
xlabel(' ')
set(gca,'xlim',[0.5 np+0.5])
......
......@@ -72,11 +72,11 @@ for j=1:size(anamendo,1),
SAM = squeeze(SAMorris(nshock+1:end,1));
SA(:,js)=SAM./(max(SAM)+eps);
[saso, iso] = sort(-SA(:,js));
bar(SA(iso(1:10),js))
%set(gca,'xticklabel',pnames(iso(1:10),:),'fontsize',8)
bar(SA(iso(1:min(np,10)),js))
%set(gca,'xticklabel',pnames(iso(1:min(np,10)),:),'fontsize',8)
set(gca,'xticklabel',' ','fontsize',10)
set(gca,'xlim',[0.5 10.5])
for ip=1:10,
for ip=1:min(np,10),
text(ip,-0.02,deblank(pnames(iso(ip),:)),'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
title([namendo,' vs. ',namexo],'interpreter','none')
......@@ -118,11 +118,11 @@ for j=1:size(anamendo,1),
SAM = squeeze(SAMorris(nshock+1:end,1));
SA(:,js)=SAM./(max(SAM)+eps);
[saso, iso] = sort(-SA(:,js));
bar(SA(iso(1:10),js))
%set(gca,'xticklabel',pnames(iso(1:10),:),'fontsize',8)
bar(SA(iso(1:min(np,10)),js))
%set(gca,'xticklabel',pnames(iso(1:min(np,10)),:),'fontsize',8)
set(gca,'xticklabel',' ','fontsize',10)
set(gca,'xlim',[0.5 10.5])
for ip=1:10,
for ip=1:min(np,10),
text(ip,-0.02,deblank(pnames(iso(ip),:)),'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
......@@ -146,7 +146,8 @@ end
figure,
%bar(SA)
boxplot(SA','whis',10,'symbol','r.')
% boxplot(SA','whis',10,'symbol','r.')
myboxplot(SA',[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:np])
set(gca,'xlim',[0.5 np+0.5])
set(gca,'ylim',[0 1])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment