Commit db9b61df authored by Marco Ratto's avatar Marco Ratto
Browse files

Bug fixes, reduced the number of graphs and improved info on graphical output...

Bug fixes, reduced the number of graphs and improved info on graphical output for screening identification and MC theoretical moments in GSA.
parent f8ec2207
......@@ -209,7 +209,7 @@ if opt_gsa.morris==1,
load([OutputDirectoryName,'/',fname_,'_morris_IDE'],'SAvdec','vdec','ir_vdec','ic_vdec')
end
hh = dyn_figure(options_);
hh = dyn_figure(options_,'name','Screening identification: variance decomposition');
% boxplot(SAvdec,'whis',10,'symbol','r.')
myboxplot(SAvdec,[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
......@@ -221,7 +221,7 @@ if opt_gsa.morris==1,
text(ip,-2,bayestopt_.name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
xlabel(' ')
title('All variance decomposition')
title('Elementary effects variance decomposition')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morris_vdec'],options_);
else
save([OutputDirectoryName,'/',fname_,'_morris_IDE'],'vdec')
......@@ -314,7 +314,7 @@ if opt_gsa.morris==1,
load([OutputDirectoryName,'/',fname_,'_morris_IDE'],'ac','ir_ac','ic_ac')
end
hh=dyn_figure(options_);
hh=dyn_figure(options_,'name','Screening identification: theoretical moments');
% boxplot(SAcc,'whis',10,'symbol','r.')
myboxplot(SAcc,[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
......@@ -326,7 +326,7 @@ if opt_gsa.morris==1,
text(ip,-0.02,bayestopt_.name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
xlabel(' ')
title('EET All moments')
title('Elementary effects in the moments')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morris_moments'],options_);
% close(gcf),
......@@ -709,7 +709,7 @@ if opt_gsa.morris==1,
else
load([OutputDirectoryName,'/',fname_,'_morris_IDE'],'SAnorm','SAmunorm','SAsignorm')
end
hh=dyn_figure(options_); %bar(SAnorm(:,irel))
hh=dyn_figure(options_,'name','Screening identification: model'); %bar(SAnorm(:,irel))
% boxplot(SAnorm','whis',10,'symbol','r.')
myboxplot(SAnorm',[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
......@@ -725,35 +725,35 @@ if opt_gsa.morris==1,
title('Elementary effects in the model')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morris_par'],options_);
hh=dyn_figure(options_); %bar(SAmunorm(:,irel))
% boxplot(SAmunorm','whis',10,'symbol','r.')
myboxplot(SAmunorm',[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
set(gca,'xlim',[0.5 npT+0.5])
set(gca,'ylim',[-1 1])
set(gca,'position',[0.13 0.2 0.775 0.7])
xlabel(' ')
for ip=1:npT,
text(ip,-0.02,bayestopt_.name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
xlabel(' ')
title('\mu in the model')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morrismu_par'],options_);
hh=dyn_figure(options_); %bar(SAsignorm(:,irel))
% boxplot(SAsignorm','whis',10,'symbol','r.')
myboxplot(SAsignorm',[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
set(gca,'xlim',[0.5 npT+0.5])
set(gca,'ylim',[0 1])
set(gca,'position',[0.13 0.2 0.775 0.7])
xlabel(' ')
for ip=1:npT,
text(ip,-0.02,bayestopt_.name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none')
end
xlabel(' ')
title('\sigma in the model')
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morrissig_par'],options_);
% hh=dyn_figure(options_); %bar(SAmunorm(:,irel))
% % boxplot(SAmunorm','whis',10,'symbol','r.')
% myboxplot(SAmunorm',[],'.',[],10)
% set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
% set(gca,'xlim',[0.5 npT+0.5])
% set(gca,'ylim',[-1 1])
% set(gca,'position',[0.13 0.2 0.775 0.7])
% xlabel(' ')
% for ip=1:npT,
% text(ip,-0.02,bayestopt_.name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none')
% end
% xlabel(' ')
% title('\mu in the model')
% dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morrismu_par'],options_);
%
% hh=dyn_figure(options_); %bar(SAsignorm(:,irel))
% % boxplot(SAsignorm','whis',10,'symbol','r.')
% myboxplot(SAsignorm',[],'.',[],10)
% set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
% set(gca,'xlim',[0.5 npT+0.5])
% set(gca,'ylim',[0 1])
% set(gca,'position',[0.13 0.2 0.775 0.7])
% xlabel(' ')
% for ip=1:npT,
% text(ip,-0.02,bayestopt_.name{ip},'rotation',90,'HorizontalAlignment','right','interpreter','none')
% end
% xlabel(' ')
% title('\sigma in the model')
% dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morrissig_par'],options_);
% figure, bar(SAnorm(:,irel)')
% set(gca,'xtick',[1:j0])
......
......@@ -17,19 +17,23 @@ function [vdec, cc, ac] = mc_moments(mm, ss, dr)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global options_ M_
global options_ M_ estim_params_ oo_
[nr1, nc1, nsam] = size(mm);
nobs=size(options_.varobs,1);
disp('Computing theoretical moments ...')
h = dyn_waitbar(0,'Theoretical moments ...');
vdec = zeros(nobs,M_.exo_nbr,nsam);
cc = zeros(size(options_.varobs,1),size(options_.varobs,1),nsam);
ac = zeros(size(options_.varobs,1),size(options_.varobs,1)*options_.ar,nsam);
for j=1:nsam,
dr.ghx = mm(:, [1:(nc1-M_.exo_nbr)],j);
dr.ghu = mm(:, [(nc1-M_.exo_nbr+1):end], j);
oo_.dr.ghx = mm(:, [1:(nc1-M_.exo_nbr)],j);
oo_.dr.ghu = mm(:, [(nc1-M_.exo_nbr+1):end], j);
if ~isempty(ss),
set_shocks_param(ss(j,:));
end
[vdec(:,:,j), corr, autocorr, z, zz] = th_moments(dr,options_.varobs);
[vdec(:,:,j), corr, autocorr, z, zz] = th_moments(oo_.dr,options_.varobs);
cc(:,:,j)=triu(corr);
dum=[];
for i=1:options_.ar
......
......@@ -35,11 +35,12 @@ function [vdec, corr, autocorr, z, zz] = th_moments(dr,var_list)
end
end
[gamma_y,ivar] = th_autocovariances(dr,ivar,M_, options_);
m = dr.ys(ivar);
[gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_, options_);
m = dr.ys(ivar(stationary_vars));
i1 = find(abs(diag(gamma_y{1})) > 1e-12);
% i1 = find(abs(diag(gamma_y{1})) > 1e-12);
i1 = [1:length(ivar)];
s2 = diag(gamma_y{1});
sd = sqrt(s2);
......
Markdown is supported
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