Commit 4c255cf2 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Sébastien Villemot
Browse files

Starts implementing Ticket 216. Most plotting and figure is now controlled by...

Starts implementing Ticket 216. Most plotting and figure is now controlled by the functions dyn_figure and dyn_saveas, allowing for option_.nodisplay to suppress the displaying of figures and using options_.graph_format to control the format of saved figures.
parent 2bc399cd
......@@ -130,11 +130,7 @@ clear pmet temp moyenne CSUP CINF csup cinf n linea iter tmp;
pages = floor(npar/3);
k = 0;
for i = 1:pages
if options_.nograph
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman,1998)','Visible','off');
else
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman,1998)');
end
h=dyn_figure(options_,'Name','MCMC univariate diagnostic (Brooks and Gelman,1998)');
boxplot = 1;
for j = 1:3 % Loop over parameters
k = k+1;
......@@ -172,15 +168,7 @@ for i = 1:pages
boxplot = boxplot + 1;
end
end
eval(['print -depsc2 ' DirectoryName '/' M_.fname '_udiag' int2str(i) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' DirectoryName '/' M_.fname '_udiag' int2str(i)]);
end
if options_.nograph, set(h,'visible','on'), end
if ~exist('OCTAVE_VERSION')
saveas(h,[DirectoryName '/' M_.fname '_udiag' int2str(i) '.fig']);
end
if options_.nograph, close(h), end
dyn_saveas(h,[DirectoryName '/' M_.fname '_udiag' int2str(i)],options_);
if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1)
......@@ -205,10 +193,7 @@ if reste
nr = 2;
nc = 3;
end
if options_.nograph
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman, 1998)','Visible','off');
else
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman, 1998)');
h = dyn_figure(options_,'Name','MCMC univariate diagnostic (Brooks and Gelman, 1998)');
end
boxplot = 1;
for j = 1:reste
......@@ -247,15 +232,7 @@ if reste
boxplot = boxplot + 1;
end
end
eval(['print -depsc2 ' DirectoryName '/' M_.fname '_udiag' int2str(pages+1) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' DirectoryName '/' M_.fname '_udiag' int2str(pages+1)]);
end
if options_.nograph, set(h,'visible','on'), end
if ~exist('OCTAVE_VERSION')
saveas(h,[DirectoryName '/' M_.fname '_udiag' int2str(pages+1) '.fig']);
end
if options_.nograph, close(h), end
dyn_saveas(h,[ DirectoryName '/' M_.fname '_udiag' int2str(pages+1)],options_);
if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1);
......@@ -331,11 +308,8 @@ for iter = Origin:StepSize:NumberOfDraws
end
end
MDIAG(:,[2 4 6],:) = MDIAG(:,[2 4 6],:)/nblck;
if options_.nograph
h = figure('Name','Multivariate diagnostic','Visible','off');
else
h = figure('Name','Multivariate diagnostic');
end
h = dyn_figure(options_,'Name','Multivariate diagnostic');
boxplot = 1;
for crit = 1:3
if crit == 1
......@@ -367,15 +341,8 @@ for crit = 1:3
title(namnam,'Interpreter','none');
boxplot = boxplot + 1;
end
eval(['print -depsc2 ' DirectoryName '/' M_.fname '_mdiag.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' DirectoryName '/' M_.fname '_mdiag']);
end
if options_.nograph, set(h,'visible','on'), end
if ~exist('OCTAVE_VERSION')
saveas(h,[DirectoryName '/' M_.fname '_mdiag.fig']);
end
if options_.nograph, close(h), end
dyn_saveas(h,[ DirectoryName '/' M_.fname '_mdiag'],options_);
if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:3
......
......@@ -63,11 +63,7 @@ for i=1:npar
subplotnum = subplotnum+1;
if subplotnum == 1
figunumber = figunumber+1;
if options_.nograph
hfig = figure('Name',figurename,'Visible','off');
else
hfig = figure('Name',figurename);
end
hfig=dyn_figure(options_,'Name',figurename);
end
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
if subplotnum == 1
......@@ -156,16 +152,7 @@ for i=1:npar
hold off;
drawnow
if subplotnum == MaxNumberOfPlotPerFigure || i == npar;
eval(['print -depsc2 ' OutputDirectoryName '/' M_.fname '_PriorsAndPosteriors' int2str(figunumber) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' OutputDirectoryName '/' M_.fname '_PriorsAndPosteriors' int2str(figunumber)]);
end
if options_.nograph,
set(hfig,'Visible','on');
end
if ~exist('OCTAVE_VERSION')
saveas(hfig,[OutputDirectoryName '/' M_.fname '_PriorsAndPosteriors' int2str(figunumber) '.fig']);
end
dyn_saveas(hfig,[OutputDirectoryName '/' M_.fname '_PriorsAndPosteriors' int2str(figunumber)],options_);
if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
for j = 1:size(NAMES,1)
......@@ -182,9 +169,6 @@ for i=1:npar
fclose(fidTeX);
end
end
if options_.nograph,
close(hfig),
end
subplotnum = 0;
end
end
\ No newline at end of file
......@@ -89,19 +89,13 @@ for i=fpar:npar,
for j=1:nvar
if max(abs(MeanIRF(:,j,i))) > 10^(-6)
subplotnum = subplotnum+1;
if options_.nograph
if subplotnum == 1 && options_.relative_irf
hh = figure('Name',['Relative response to orthogonalized shock to ' tit(i,:)],'Visible','off');
elseif subplotnum == 1 && ~options_.relative_irf
hh = figure('Name',['Orthogonalized shock to ' tit(i,:)],'Visible','off');
end
else
if subplotnum == 1 && options_.relative_irf
hh = figure('Name',['Relative response to orthogonalized shock to ' tit(i,:)]);
elseif subplotnum == 1 && ~options_.relative_irf
hh = figure('Name',['Orthogonalized shock to ' tit(i,:)]);
end
dyn_figure(options_,'Name',['Relative response to orthogonalized shock to ' tit(i,:)])
if subplotnum == 1 && options_.relative_irf
hh = dyn_figure(options_,'Name',['Relative response to orthogonalized shock to ' tit(i,:)]);
elseif subplotnum == 1 && ~options_.relative_irf
hh = dyn_figure(options_,'Name',['Orthogonalized shock to ' tit(i,:)]);
end
set(0,'CurrentFigure',hh)
subplot(nn,nn,subplotnum);
if ~MAX_nirfs_dsgevar
......@@ -142,17 +136,10 @@ for i=fpar:npar,
if subplotnum == MaxNumberOfPlotPerFigure || (j == nvar && subplotnum> 0)
figunumber = figunumber+1;
set(hh,'visible','on')
eval(['print -depsc2 ' DirectoryName '/' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber) '.eps']);
if ~exist('OCTAVE_VERSION')
eval(['print -dpdf ' DirectoryName '/' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber)]);
saveas(hh,[DirectoryName '/' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber) '.fig']);
end
dyn_saveas(hh,[DirectoryName '/' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber)],options_);
if RemoteFlag==1,
OutputFileName = [OutputFileName; {[DirectoryName,filesep], [M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber) '.*']}];
end
set(hh,'visible','off')
if options_.nograph, close(hh), end
subplotnum = 0;
end
end% loop over selected endo_var
......
......@@ -30,17 +30,14 @@ function dyn_saveas(h,fname,DynareOptions)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if strmatch('eps',DynareOptions.graph_format)
if find(strcmp('eps',DynareOptions.graph_format))
eval(['print -depsc2 ' fname '.eps']);
end
if ~exist('OCTAVE_VERSION')
if strmatch('pdf',DynareOptions.graph_format)
if find(strcmp('pdf',DynareOptions.graph_format))
eval(['print -dpdf ' fname]);
end
if strmatch('fig',DynareOptions.graph_format)
if DynareOptions.nodisplay
set(h, 'Visible','on');
end
if find(strcmp('fig',DynareOptions.graph_format))
saveas(h,[fname '.fig']);
end
end
......
......@@ -112,7 +112,7 @@ if nnobs > 1 && horizon > 0
m = 1;
for i = 1:size(var_list,1)
if mod(i,nstar) == 1
hfig = figure('Name','Out of sample forecasts');
hfig = dyn_figure(options_,'Name','Out of sample forecasts');
m = 1;
end
subplot(nr,nc,m)
......
......@@ -264,7 +264,7 @@ if iload <=0,
% normLRE = max(abs(siLRE)')';
save([IdentifDirectoryName '/' M_.fname '_identif.mat'], 'idehess_point', 'idemoments_point','idemodel_point', 'idelre_point','store_options_ident')
disp_identification(params, idemodel_point, idemoments_point, name);
plot_identification(params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName,1);
plot_identification(params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName);
if SampleSize > 1,
disp(' ')
......@@ -437,13 +437,13 @@ end
if iload,
disp(['Testing ',parameters])
disp_identification(idehess_point.params, idemodel_point, idemoments_point, name);
plot_identification(idehess_point.params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName,1);
plot_identification(idehess_point.params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName);
end
if SampleSize > 1,
fprintf('\n')
disp('Testing MC sample')
disp_identification(pdraws, idemodel, idemoments, name);
plot_identification(pdraws,idemoments,idehess_point,idemodel,idelre,advanced,'MC sample - ',name, IdentifDirectoryName, 1);
plot_identification(pdraws,idemoments,idehess_point,idemodel,idelre,advanced,'MC sample - ',name, IdentifDirectoryName);
if advanced,
jcrit=find(idemoments.ino);
if length(jcrit)<SampleSize,
......@@ -460,7 +460,7 @@ if SampleSize > 1,
end
disp_identification(pdraws(jmax,:), idemodel_max, idemoments_max, name);
close all,
plot_identification(pdraws(jmax,:),idemoments_max,idehess_max,idemodel_max,idelre_max,1,tittxt,name,IdentifDirectoryName,1);
plot_identification(pdraws(jmax,:),idemoments_max,idehess_max,idemodel_max,idelre_max,1,tittxt,name,IdentifDirectoryName);
[dum,jmin]=min(idemoments.cond);
fprintf('\n')
tittxt = 'Draw with SMALLEST condition number';
......@@ -473,7 +473,7 @@ if SampleSize > 1,
end
disp_identification(pdraws(jmin,:), idemodel_min, idemoments_min, name);
close all,
plot_identification(pdraws(jmin,:),idemoments_min,idehess_min,idemodel_min,idelre_min,1,tittxt,name,IdentifDirectoryName,1);
plot_identification(pdraws(jmin,:),idemoments_min,idehess_min,idemodel_min,idelre_min,1,tittxt,name,IdentifDirectoryName);
else
for j=1:length(jcrit),
tittxt = ['Rank deficient draw n. ',int2str(j)];
......@@ -485,7 +485,7 @@ if SampleSize > 1,
end
disp_identification(pdraws(jcrit(j),:), idemodel_(j), idemoments_(j), name);
close all,
plot_identification(pdraws(jcrit(j),:),idemoments_(j),idehess_(j),idemodel_(j),idelre_(j),1,tittxt,name,IdentifDirectoryName,1);
plot_identification(pdraws(jcrit(j),:),idemoments_(j),idehess_(j),idemodel_(j),idelre_(j),1,tittxt,name,IdentifDirectoryName);
end
if ~iload,
save([IdentifDirectoryName '/' M_.fname '_identif.mat'], 'idehess_', 'idemoments_','idemodel_', 'idelre_', 'jcrit', '-append');
......
......@@ -61,13 +61,13 @@ end
m = 1;
n_fig = 1;
figure('Name','Forecasts (I)')
hh=dyn_figure(options_,'Name','Forecasts (I)');
for j= 1:nvar
if m > nc*nr;
eval(['print -depsc ' fname '/graphs/forcst' int2str(n_fig) ...
'.eps;'])
dyn_saveas(hh,[ fname '/graphs/forcst' int2str(n_fig)],options_);
n_fig =n_fig+1;
eval(['figure(''Name'',''Forecast (' int2str(n_fig) ')'');']);
eval(['hh=dyn_figure(options_,''Name'',''Forecast (' int2str(n_fig) ')'');']);
m = 1;
end
subplot(nr,nc,m);
......@@ -91,5 +91,5 @@ for j= 1:nvar
end
if m > 1
eval(['print -deps ' fname '/graphs/forcst' int2str(n_fig) '.eps;'])
dyn_saveas(hh,[fname '/graphs/forcst' int2str(n_fig)],options_);
end
\ No newline at end of file
......@@ -110,7 +110,7 @@ options_.graphics.ncols = 3;
options_.graphics.line_types = {'b-'};
options_.graphics.line_width = 1;
options_.graph_format = 'eps';
options_.nodisplay = 1;
options_.nodisplay = 0;
options_.nograph = 0;
options_.XTick = [];
options_.XTickLabel = [];
......
......@@ -289,7 +289,7 @@ else
for i=1:size(vvarvecm,1),
if mod(i,9)==1,
ifig=ifig+1;
figure('name',['Prior ',int2str(ifig)])
hh=dyn_figure(options_,'name',['Prior ',int2str(ifig)]);
end
subplot(3,3,i-9*(ifig-1))
h=cumplot(lnprior(ixx(1:nfilt0(i),i)));
......@@ -300,34 +300,24 @@ else
title(vvarvecm(i,:),'interpreter','none')
if mod(i,9)==0 | i==size(vvarvecm,1)
if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_lnprior',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_lnprior',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_lnprior',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_post_lnprior',int2str(ifig)],options_);
else
if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_lnprior',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_lnprior',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_lnprior',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_lnprior',int2str(ifig) ],options_);
else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_lnprior',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig) ],options_);
end
end
close(gcf)
if ~options.nodisplay
close(hh);
end
end
end
ifig=0;
for i=1:size(vvarvecm,1),
if mod(i,9)==1,
ifig=ifig+1;
figure('name',['Likelihood ',int2str(ifig)])
hh = dyn_figure(options_,'Name',['Likelihood ',int2str(ifig)]);
end
subplot(3,3,i-9*(ifig-1))
h=cumplot(likelihood(ixx(1:nfilt0(i),i)));
......@@ -341,34 +331,24 @@ else
end
if mod(i,9)==0 | i==size(vvarvecm,1)
if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_lnlik',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_lnlik',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_lnlik',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_post_lnlik',int2str(ifig) ],options_);
else
if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_lnlik',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_lnlik',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_lnlik',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_lnlik',int2str(ifig)],options_);
else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_lnlik',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_lnlik',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_lnlik',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnlik',int2str(ifig) ],options_);
end
end
close(gcf)
if ~options.nodisplay
close(hh);
end
end
end
ifig=0;
for i=1:size(vvarvecm,1),
if mod(i,9)==1,
ifig=ifig+1;
figure('name',['Posterior ',int2str(ifig)])
hh = dyn_figure(options_,'Name',['Posterior ',int2str(ifig)]);
end
subplot(3,3,i-9*(ifig-1))
h=cumplot(logpo2(ixx(1:nfilt0(i),i)));
......@@ -382,27 +362,17 @@ else
end
if mod(i,9)==0 | i==size(vvarvecm,1)
if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_lnpost',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_lnpost',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_lnpost',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_post_lnpost',int2str(ifig) ],options_);
else
if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_lnpost',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_lnpost',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_lnpost',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_lnpost',int2str(ifig)],options_);
else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_lnpost',int2str(ifig) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_lnpost',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_lnpost',int2str(ifig)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnpost',int2str(ifig)],options_);
end
end
close(gcf)
if ~options.nodisplay
close(hh);
end
end
end
......@@ -501,7 +471,7 @@ else
% plot trade-offs
a00=jet(size(vvarvecm,1));
for ix=1:ceil(length(nsnam)/5),
figure,
hh = dyn_figure(options_);
for j=1+5*(ix-1):min(size(snam2,1),5*ix),
subplot(2,3,j-5*(ix-1))
%h0=cumplot(x(:,nsnam(j)+nshock));
......@@ -536,24 +506,12 @@ else
%h0=legend({'base',vnam{np}}',0);
%set(findobj(get(h0,'children'),'type','text'),'interpreter','none')
if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_' int2str(ix) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_',num2str(ix)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_' int2str(ix)]);
end
dyn_saveas(hh,[ OutDir '/' fname_ '_rmse_post_' int2str(ix)],options_);
else
if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_' int2str(ix) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_',num2str(ix)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_' int2str(ix)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_' int2str(ix) ],options_);
else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_' int2str(ix) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_',num2str(ix)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_' int2str(ix)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_' int2str(ix)],options_);
end
end
end
......@@ -569,7 +527,7 @@ else
%kernel_function = 'uniform'; % Gaussian kernel for Fast Fourrier Transform approximaton.
for ix=1:ceil(length(nsnam)/5),
figure,
hh = dyn_figure(options_);
for j=1+5*(ix-1):min(size(snam2,1),5*ix),
subplot(2,3,j-5*(ix-1))
optimal_bandwidth = mh_optimal_bandwidth(x(:,nsnam(j)),size(x,1),bandwidth,kernel_function);
......@@ -607,29 +565,16 @@ else
%h0=legend({'base',vnam{np}}',0);
%set(findobj(get(h0,'children'),'type','text'),'interpreter','none')
if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_dens_' int2str(ix) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_dens_',num2str(ix)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_dens_' int2str(ix)]);
end
dyn_saveas(hh,[ OutDir '/' fname_ '_rmse_post_dens_' int2str(ix) ],options_);
else
if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_dens_' int2str(ix) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_dens_',num2str(ix)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_dens_' int2str(ix)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_dens_' int2str(ix)],options_);
else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_dens_' int2str(ix) '.eps']);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_dens_',num2str(ix)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_dens_' int2str(ix)]);
end
dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_dens_' int2str(ix) ],options_);
end
end
end
close all
% for j=1:size(SP,2),
% nfig=0;
% np=find(SP(:,j));
......
......@@ -77,7 +77,7 @@ if opt_gsa.load_ident_files==0,
ifig=0;
for j=1:M_.exo_nbr,
if mod(j,6)==1
figure('name',['Variance decomposition shocks']);
hh=dyn_figure(options_,'name',['Variance decomposition shocks']);
ifig=ifig+1;
iplo=0;
end
......@@ -95,10 +95,10 @@ if opt_gsa.load_ident_files==0,
ylabel(' ')
title(M_.exo_names(j,:),'interpreter','none')
if mod(j,6)==0 | j==M_.exo_nbr,
saveas(gcf,[OutputDirectoryName,'/',fname_,'_vdec_exo_',int2str(ifig)])
eval(['print -depsc2 ' OutputDirectoryName '/' fname_ '_vdec_exo_',int2str(ifig)]);
eval(['print -dpdf ' OutputDirectoryName '/' fname_ '_vdec_exo_',int2str(ifig)]);
close(gcf),
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_vdec_exo_',int2str(ifig)],options_);
if ~options.nodisplay
close(hh);
end
end
end
end
......@@ -204,7 +204,7 @@ if opt_gsa.morris==1,
load([OutputDirectoryName,'/',fname_,'_morris_IDE'],'SAvdec','vdec','ir_vdec','ic_vdec')
end
figure,
hh = dyn_figure(options_);
% boxplot(SAvdec,'whis',10,'symbol','r.')
myboxplot(SAvdec,[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
......@@ -217,10 +217,10 @@ if opt_gsa.morris==1,
end
xlabel(' ')
title('All variance decomposition')
saveas(gcf,[OutputDirectoryName,'/',fname_,'_morris_vdec'])
eval(['print -depsc2 ' OutputDirectoryName '/' fname_ '_morris_vdec']);
eval(['print -dpdf ' OutputDirectoryName '/' fname_ '_morris_vdec']);
close(gcf)
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morris_vdec'],options_);
if ~options.nodisplay
close(hh);
end
else
save([OutputDirectoryName,'/',fname_,'_morris_IDE'],'vdec')
......@@ -312,7 +312,7 @@ if opt_gsa.morris==1,
load([OutputDirectoryName,'/',fname_,'_morris_IDE'],'ac','ir_ac','ic_ac')
end
figure,
hh=dyn_figure(options_);
% boxplot(SAcc,'whis',10,'symbol','r.')
myboxplot(SAcc,[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
......@@ -325,9 +325,7 @@ if opt_gsa.morris==1,
end
xlabel(' ')
title('EET All moments')
saveas(gcf,[OutputDirectoryName,'/',fname_,'_morris_moments'])
eval(['print -depsc2 ' OutputDirectoryName '/' fname_ '_morris_moments']);
eval(['print -dpdf ' OutputDirectoryName '/' fname_ '_morris_moments']);
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morris_moments'],options_);
% close(gcf),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -709,7 +707,7 @@ if opt_gsa.morris==1,
else
load([OutputDirectoryName,'/',fname_,'_morris_IDE'],'SAnorm','SAmunorm','SAsignorm')
end
figure, %bar(SAnorm(:,irel))
hh=dyn_figure(options_); %bar(SAnorm(:,irel))
% boxplot(SAnorm','whis',10,'symbol','r.')
myboxplot(SAnorm',[],'.',[],10)
set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:npT])
......@@ -723,11 +721,9 @@ if opt_gsa.morris==1,
end
xlabel(' ')
title('Elementary effects in the model')
saveas(gcf,[OutputDirectoryName,'/',fname_,'_morris_par'])
eval(['print -depsc2 ' OutputDirectoryName '/' fname_ '_morris_par']);
eval(['print -dpdf ' OutputDirectoryName '/' fname_ '_morris_par']);
dyn_saveas(hh,[OutputDirectoryName,'/',fname_,'_morris_par'],options_);
figure, %bar(SAmunorm(:,irel))
hh=dyn_figure(options_); %bar(SAmunorm(:,irel))
% boxplot(SAmunorm','whis',10,'symbol','r.')