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; ...@@ -130,11 +130,7 @@ clear pmet temp moyenne CSUP CINF csup cinf n linea iter tmp;
pages = floor(npar/3); pages = floor(npar/3);
k = 0; k = 0;
for i = 1:pages for i = 1:pages
if options_.nograph h=dyn_figure(options_,'Name','MCMC univariate diagnostic (Brooks and Gelman,1998)');
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman,1998)','Visible','off');
else
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman,1998)');
end
boxplot = 1; boxplot = 1;
for j = 1:3 % Loop over parameters for j = 1:3 % Loop over parameters
k = k+1; k = k+1;
...@@ -172,15 +168,7 @@ for i = 1:pages ...@@ -172,15 +168,7 @@ for i = 1:pages
boxplot = boxplot + 1; boxplot = boxplot + 1;
end end
end end
eval(['print -depsc2 ' DirectoryName '/' M_.fname '_udiag' int2str(i) '.eps']); dyn_saveas(h,[DirectoryName '/' M_.fname '_udiag' int2str(i)],options_);
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
if TeX if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1) for jj = 1:size(NAMES,1)
...@@ -205,10 +193,7 @@ if reste ...@@ -205,10 +193,7 @@ if reste
nr = 2; nr = 2;
nc = 3; nc = 3;
end end
if options_.nograph h = dyn_figure(options_,'Name','MCMC univariate diagnostic (Brooks and Gelman, 1998)');
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman, 1998)','Visible','off');
else
h = figure('Name','MCMC univariate diagnostic (Brooks and Gelman, 1998)');
end end
boxplot = 1; boxplot = 1;
for j = 1:reste for j = 1:reste
...@@ -247,15 +232,7 @@ if reste ...@@ -247,15 +232,7 @@ if reste
boxplot = boxplot + 1; boxplot = boxplot + 1;
end end
end end
eval(['print -depsc2 ' DirectoryName '/' M_.fname '_udiag' int2str(pages+1) '.eps']); dyn_saveas(h,[ DirectoryName '/' M_.fname '_udiag' int2str(pages+1)],options_);
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
if TeX if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:size(NAMES,1); for jj = 1:size(NAMES,1);
...@@ -331,11 +308,8 @@ for iter = Origin:StepSize:NumberOfDraws ...@@ -331,11 +308,8 @@ for iter = Origin:StepSize:NumberOfDraws
end end
end end
MDIAG(:,[2 4 6],:) = MDIAG(:,[2 4 6],:)/nblck; MDIAG(:,[2 4 6],:) = MDIAG(:,[2 4 6],:)/nblck;
if options_.nograph
h = figure('Name','Multivariate diagnostic','Visible','off'); h = dyn_figure(options_,'Name','Multivariate diagnostic');
else
h = figure('Name','Multivariate diagnostic');
end
boxplot = 1; boxplot = 1;
for crit = 1:3 for crit = 1:3
if crit == 1 if crit == 1
...@@ -367,15 +341,8 @@ for crit = 1:3 ...@@ -367,15 +341,8 @@ for crit = 1:3
title(namnam,'Interpreter','none'); title(namnam,'Interpreter','none');
boxplot = boxplot + 1; boxplot = boxplot + 1;
end end
eval(['print -depsc2 ' DirectoryName '/' M_.fname '_mdiag.eps']); dyn_saveas(h,[ DirectoryName '/' M_.fname '_mdiag'],options_);
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
if TeX if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for jj = 1:3 for jj = 1:3
......
...@@ -63,11 +63,7 @@ for i=1:npar ...@@ -63,11 +63,7 @@ for i=1:npar
subplotnum = subplotnum+1; subplotnum = subplotnum+1;
if subplotnum == 1 if subplotnum == 1
figunumber = figunumber+1; figunumber = figunumber+1;
if options_.nograph hfig=dyn_figure(options_,'Name',figurename);
hfig = figure('Name',figurename,'Visible','off');
else
hfig = figure('Name',figurename);
end
end end
[nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_); [nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
if subplotnum == 1 if subplotnum == 1
...@@ -156,16 +152,7 @@ for i=1:npar ...@@ -156,16 +152,7 @@ for i=1:npar
hold off; hold off;
drawnow drawnow
if subplotnum == MaxNumberOfPlotPerFigure || i == npar; if subplotnum == MaxNumberOfPlotPerFigure || i == npar;
eval(['print -depsc2 ' OutputDirectoryName '/' M_.fname '_PriorsAndPosteriors' int2str(figunumber) '.eps']); dyn_saveas(hfig,[OutputDirectoryName '/' M_.fname '_PriorsAndPosteriors' int2str(figunumber)],options_);
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
if TeX if TeX
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
for j = 1:size(NAMES,1) for j = 1:size(NAMES,1)
...@@ -182,9 +169,6 @@ for i=1:npar ...@@ -182,9 +169,6 @@ for i=1:npar
fclose(fidTeX); fclose(fidTeX);
end end
end end
if options_.nograph,
close(hfig),
end
subplotnum = 0; subplotnum = 0;
end end
end end
\ No newline at end of file
...@@ -89,19 +89,13 @@ for i=fpar:npar, ...@@ -89,19 +89,13 @@ for i=fpar:npar,
for j=1:nvar for j=1:nvar
if max(abs(MeanIRF(:,j,i))) > 10^(-6) if max(abs(MeanIRF(:,j,i))) > 10^(-6)
subplotnum = subplotnum+1; subplotnum = subplotnum+1;
if options_.nograph dyn_figure(options_,'Name',['Relative response to orthogonalized shock to ' tit(i,:)])
if subplotnum == 1 && options_.relative_irf if subplotnum == 1 && options_.relative_irf
hh = figure('Name',['Relative response to orthogonalized shock to ' tit(i,:)],'Visible','off'); hh = dyn_figure(options_,'Name',['Relative response to orthogonalized shock to ' tit(i,:)]);
elseif subplotnum == 1 && ~options_.relative_irf elseif subplotnum == 1 && ~options_.relative_irf
hh = figure('Name',['Orthogonalized shock to ' tit(i,:)],'Visible','off'); hh = dyn_figure(options_,'Name',['Orthogonalized shock to ' tit(i,:)]);
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
end end
set(0,'CurrentFigure',hh) set(0,'CurrentFigure',hh)
subplot(nn,nn,subplotnum); subplot(nn,nn,subplotnum);
if ~MAX_nirfs_dsgevar if ~MAX_nirfs_dsgevar
...@@ -142,17 +136,10 @@ for i=fpar:npar, ...@@ -142,17 +136,10 @@ for i=fpar:npar,
if subplotnum == MaxNumberOfPlotPerFigure || (j == nvar && subplotnum> 0) if subplotnum == MaxNumberOfPlotPerFigure || (j == nvar && subplotnum> 0)
figunumber = figunumber+1; figunumber = figunumber+1;
set(hh,'visible','on') dyn_saveas(hh,[DirectoryName '/' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber)],options_);
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
if RemoteFlag==1, if RemoteFlag==1,
OutputFileName = [OutputFileName; {[DirectoryName,filesep], [M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber) '.*']}]; OutputFileName = [OutputFileName; {[DirectoryName,filesep], [M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber) '.*']}];
end end
set(hh,'visible','off')
if options_.nograph, close(hh), end
subplotnum = 0; subplotnum = 0;
end end
end% loop over selected endo_var end% loop over selected endo_var
......
...@@ -30,17 +30,14 @@ function dyn_saveas(h,fname,DynareOptions) ...@@ -30,17 +30,14 @@ function dyn_saveas(h,fname,DynareOptions)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % 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']); eval(['print -depsc2 ' fname '.eps']);
end end
if ~exist('OCTAVE_VERSION') if ~exist('OCTAVE_VERSION')
if strmatch('pdf',DynareOptions.graph_format) if find(strcmp('pdf',DynareOptions.graph_format))
eval(['print -dpdf ' fname]); eval(['print -dpdf ' fname]);
end end
if strmatch('fig',DynareOptions.graph_format) if find(strcmp('fig',DynareOptions.graph_format))
if DynareOptions.nodisplay
set(h, 'Visible','on');
end
saveas(h,[fname '.fig']); saveas(h,[fname '.fig']);
end end
end end
......
...@@ -112,7 +112,7 @@ if nnobs > 1 && horizon > 0 ...@@ -112,7 +112,7 @@ if nnobs > 1 && horizon > 0
m = 1; m = 1;
for i = 1:size(var_list,1) for i = 1:size(var_list,1)
if mod(i,nstar) == 1 if mod(i,nstar) == 1
hfig = figure('Name','Out of sample forecasts'); hfig = dyn_figure(options_,'Name','Out of sample forecasts');
m = 1; m = 1;
end end
subplot(nr,nc,m) subplot(nr,nc,m)
......
...@@ -264,7 +264,7 @@ if iload <=0, ...@@ -264,7 +264,7 @@ if iload <=0,
% normLRE = max(abs(siLRE)')'; % normLRE = max(abs(siLRE)')';
save([IdentifDirectoryName '/' M_.fname '_identif.mat'], 'idehess_point', 'idemoments_point','idemodel_point', 'idelre_point','store_options_ident') 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); 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, if SampleSize > 1,
disp(' ') disp(' ')
...@@ -437,13 +437,13 @@ end ...@@ -437,13 +437,13 @@ end
if iload, if iload,
disp(['Testing ',parameters]) disp(['Testing ',parameters])
disp_identification(idehess_point.params, idemodel_point, idemoments_point, name); 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 end
if SampleSize > 1, if SampleSize > 1,
fprintf('\n') fprintf('\n')
disp('Testing MC sample') disp('Testing MC sample')
disp_identification(pdraws, idemodel, idemoments, name); 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, if advanced,
jcrit=find(idemoments.ino); jcrit=find(idemoments.ino);
if length(jcrit)<SampleSize, if length(jcrit)<SampleSize,
...@@ -460,7 +460,7 @@ if SampleSize > 1, ...@@ -460,7 +460,7 @@ if SampleSize > 1,
end end
disp_identification(pdraws(jmax,:), idemodel_max, idemoments_max, name); disp_identification(pdraws(jmax,:), idemodel_max, idemoments_max, name);
close all, 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); [dum,jmin]=min(idemoments.cond);
fprintf('\n') fprintf('\n')
tittxt = 'Draw with SMALLEST condition number'; tittxt = 'Draw with SMALLEST condition number';
...@@ -473,7 +473,7 @@ if SampleSize > 1, ...@@ -473,7 +473,7 @@ if SampleSize > 1,
end end
disp_identification(pdraws(jmin,:), idemodel_min, idemoments_min, name); disp_identification(pdraws(jmin,:), idemodel_min, idemoments_min, name);
close all, 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 else
for j=1:length(jcrit), for j=1:length(jcrit),
tittxt = ['Rank deficient draw n. ',int2str(j)]; tittxt = ['Rank deficient draw n. ',int2str(j)];
...@@ -485,7 +485,7 @@ if SampleSize > 1, ...@@ -485,7 +485,7 @@ if SampleSize > 1,
end end
disp_identification(pdraws(jcrit(j),:), idemodel_(j), idemoments_(j), name); disp_identification(pdraws(jcrit(j),:), idemodel_(j), idemoments_(j), name);
close all, 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 end
if ~iload, if ~iload,
save([IdentifDirectoryName '/' M_.fname '_identif.mat'], 'idehess_', 'idemoments_','idemodel_', 'idelre_', 'jcrit', '-append'); save([IdentifDirectoryName '/' M_.fname '_identif.mat'], 'idehess_', 'idemoments_','idemodel_', 'idelre_', 'jcrit', '-append');
......
...@@ -61,13 +61,13 @@ end ...@@ -61,13 +61,13 @@ end
m = 1; m = 1;
n_fig = 1; n_fig = 1;
figure('Name','Forecasts (I)') hh=dyn_figure(options_,'Name','Forecasts (I)');
for j= 1:nvar for j= 1:nvar
if m > nc*nr; if m > nc*nr;
eval(['print -depsc ' fname '/graphs/forcst' int2str(n_fig) ... dyn_saveas(hh,[ fname '/graphs/forcst' int2str(n_fig)],options_);
'.eps;'])
n_fig =n_fig+1; n_fig =n_fig+1;
eval(['figure(''Name'',''Forecast (' int2str(n_fig) ')'');']); eval(['hh=dyn_figure(options_,''Name'',''Forecast (' int2str(n_fig) ')'');']);
m = 1; m = 1;
end end
subplot(nr,nc,m); subplot(nr,nc,m);
...@@ -91,5 +91,5 @@ for j= 1:nvar ...@@ -91,5 +91,5 @@ for j= 1:nvar
end end
if m > 1 if m > 1
eval(['print -deps ' fname '/graphs/forcst' int2str(n_fig) '.eps;']) dyn_saveas(hh,[fname '/graphs/forcst' int2str(n_fig)],options_);
end end
\ No newline at end of file
...@@ -110,7 +110,7 @@ options_.graphics.ncols = 3; ...@@ -110,7 +110,7 @@ options_.graphics.ncols = 3;
options_.graphics.line_types = {'b-'}; options_.graphics.line_types = {'b-'};
options_.graphics.line_width = 1; options_.graphics.line_width = 1;
options_.graph_format = 'eps'; options_.graph_format = 'eps';
options_.nodisplay = 1; options_.nodisplay = 0;
options_.nograph = 0; options_.nograph = 0;
options_.XTick = []; options_.XTick = [];
options_.XTickLabel = []; options_.XTickLabel = [];
......
...@@ -289,7 +289,7 @@ else ...@@ -289,7 +289,7 @@ else
for i=1:size(vvarvecm,1), for i=1:size(vvarvecm,1),
if mod(i,9)==1, if mod(i,9)==1,
ifig=ifig+1; ifig=ifig+1;
figure('name',['Prior ',int2str(ifig)]) hh=dyn_figure(options_,'name',['Prior ',int2str(ifig)]);
end end
subplot(3,3,i-9*(ifig-1)) subplot(3,3,i-9*(ifig-1))
h=cumplot(lnprior(ixx(1:nfilt0(i),i))); h=cumplot(lnprior(ixx(1:nfilt0(i),i)));
...@@ -300,34 +300,24 @@ else ...@@ -300,34 +300,24 @@ else
title(vvarvecm(i,:),'interpreter','none') title(vvarvecm(i,:),'interpreter','none')
if mod(i,9)==0 | i==size(vvarvecm,1) if mod(i,9)==0 | i==size(vvarvecm,1)
if options_.opt_gsa.ppost if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_lnprior',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_post_lnprior',int2str(ifig)],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_lnprior',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_lnprior',int2str(ifig)]);
end
else else
if options_.opt_gsa.pprior if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_lnprior',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_lnprior',int2str(ifig) ],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_lnprior',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_lnprior',int2str(ifig)]);
end
else else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig) ],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_lnprior',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig)]);
end
end end
end end
close(gcf) if ~options.nodisplay
close(hh);
end
end end
end end
ifig=0; ifig=0;
for i=1:size(vvarvecm,1), for i=1:size(vvarvecm,1),
if mod(i,9)==1, if mod(i,9)==1,
ifig=ifig+1; ifig=ifig+1;
figure('name',['Likelihood ',int2str(ifig)]) hh = dyn_figure(options_,'Name',['Likelihood ',int2str(ifig)]);
end end
subplot(3,3,i-9*(ifig-1)) subplot(3,3,i-9*(ifig-1))
h=cumplot(likelihood(ixx(1:nfilt0(i),i))); h=cumplot(likelihood(ixx(1:nfilt0(i),i)));
...@@ -341,34 +331,24 @@ else ...@@ -341,34 +331,24 @@ else
end end
if mod(i,9)==0 | i==size(vvarvecm,1) if mod(i,9)==0 | i==size(vvarvecm,1)
if options_.opt_gsa.ppost if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_lnlik',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_post_lnlik',int2str(ifig) ],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_lnlik',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_lnlik',int2str(ifig)]);
end
else else
if options_.opt_gsa.pprior if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_lnlik',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_lnlik',int2str(ifig)],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_lnlik',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_lnlik',int2str(ifig)]);
end
else else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_lnlik',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnlik',int2str(ifig) ],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_lnlik',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_lnlik',int2str(ifig)]);
end
end end
end end
close(gcf) if ~options.nodisplay
close(hh);
end
end end
end end
ifig=0; ifig=0;
for i=1:size(vvarvecm,1), for i=1:size(vvarvecm,1),
if mod(i,9)==1, if mod(i,9)==1,
ifig=ifig+1; ifig=ifig+1;
figure('name',['Posterior ',int2str(ifig)]) hh = dyn_figure(options_,'Name',['Posterior ',int2str(ifig)]);
end end
subplot(3,3,i-9*(ifig-1)) subplot(3,3,i-9*(ifig-1))
h=cumplot(logpo2(ixx(1:nfilt0(i),i))); h=cumplot(logpo2(ixx(1:nfilt0(i),i)));
...@@ -382,27 +362,17 @@ else ...@@ -382,27 +362,17 @@ else
end end
if mod(i,9)==0 | i==size(vvarvecm,1) if mod(i,9)==0 | i==size(vvarvecm,1)
if options_.opt_gsa.ppost if options_.opt_gsa.ppost
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_post_lnpost',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_post_lnpost',int2str(ifig) ],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_post_lnpost',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_post_lnpost',int2str(ifig)]);
end
else else
if options_.opt_gsa.pprior if options_.opt_gsa.pprior
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_prior_lnpost',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_prior_lnpost',int2str(ifig)],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_prior_lnpost',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_prior_lnpost',int2str(ifig)]);
end
else else
eval(['print -depsc2 ' OutDir '/' fname_ '_rmse_mc_lnpost',int2str(ifig) '.eps']); dyn_saveas(hh,[OutDir '/' fname_ '_rmse_mc_lnpost',int2str(ifig)],options_);
if ~exist('OCTAVE_VERSION'),
saveas(gcf,[OutDir,'/',fname_,'_rmse_mc_lnpost',int2str(ifig)])
eval(['print -dpdf ' OutDir '/' fname_ '_rmse_mc_lnpost',int2str(ifig)]);
end
end end
end end
close(gcf) if ~options.nodisplay
close(hh);
end
end end
end end
...@@ -501,7 +471,7 @@ else ...@@ -501,7 +471,7 @@ else
% plot trade-offs % plot trade-offs
a00=jet(size(vvarvecm,1)); a00=jet(size(vvarvecm,1));
for ix=1:ceil(length(nsnam)/5), for ix=1:ceil(length(nsnam)/5),
figure, hh = dyn_figure(options_);
for j=1+5*(ix-1):min(size(snam2,1),5*ix), for j=1+5*(ix-1):min(size(snam2,1),5*ix),
subplot(2,3,j-5*(ix-1)) subplot(2,3,j-5*(ix-1))
%h0=cumplot(x(:,nsnam(j)+nshock)); %h0=cumplot(x(:,nsnam(j)+nshock));
...@@ -536,24 +506,12 @@ else ...@@ -536,24 +506,12 @@ else
%h0=legend({'base',vnam{np}}',0); %h0=legend({'base',vnam{np}}',0);
%set(findobj(get(h0,'children'),'type','text'),'interpreter','none') %set(findobj(get(h0,'children'),'type','text'),'interpreter','none')