Make sure output is saved in dname-folder

That's where other functions are looking for them
time-shift
Johannes Pfeifer 2020-12-16 22:38:22 +01:00
parent 84566adac9
commit da3943beba
15 changed files with 78 additions and 78 deletions

View File

@ -151,11 +151,11 @@ else
end end
if ~options_.nograph if ~options_.nograph
if ~exist(M_.fname, 'dir') if ~exist(M_.dname, 'dir')
mkdir('.',M_.fname); mkdir('.',M_.dname);
end end
if ~exist([M_.fname '/graphs'],'dir') if ~exist([M_.dname '/graphs'],'dir')
mkdir(M_.fname,'graphs'); mkdir(M_.dname,'graphs');
end end
for i= 1:nvar for i= 1:nvar
@ -165,6 +165,6 @@ if ~options_.nograph
ylabel('f(\omega)') ylabel('f(\omega)')
box on box on
axis tight axis tight
dyn_saveas(hh,[M_.fname ,filesep,'graphs', filesep, 'SpectralDensity_' M_.endo_names{ivar(i)}],options_.nodisplay,options_.graph_format) dyn_saveas(hh,[M_.dname ,filesep,'graphs', filesep, 'SpectralDensity_' M_.endo_names{ivar(i)}],options_.nodisplay,options_.graph_format)
end end
end end

View File

@ -114,7 +114,7 @@ sims_with_shocks_sort = sort(sims_with_shocks, 3);
sims_with_shocks_down_conf = sims_with_shocks_sort(:, :, sort_idx(1)); sims_with_shocks_down_conf = sims_with_shocks_sort(:, :, sort_idx(1));
sims_with_shocks_up_conf = sims_with_shocks_sort(:, :, sort_idx(2)); sims_with_shocks_up_conf = sims_with_shocks_sort(:, :, sort_idx(2));
OutputDirectoryName = CheckPath('graphs',M_.fname); OutputDirectoryName = CheckPath('graphs',M_.dname);
dyn_graph=dynare_graph_init(sprintf('BVAR forecasts (nlags = %d)', nlags), ny, {'b-' 'g-' 'g-' 'r-' 'r-'}); dyn_graph=dynare_graph_init(sprintf('BVAR forecasts (nlags = %d)', nlags), ny, {'b-' 'g-' 'g-' 'r-' 'r-'});
@ -153,10 +153,10 @@ end
% Store results % Store results
DirectoryName = [ M_.fname '/bvar_forecast' ]; DirectoryName = [ M_.dname '/bvar_forecast' ];
if ~isdir(DirectoryName) if ~isdir(DirectoryName)
if ~isdir(M_.fname) if ~isdir(M_.dname)
mkdir(M_.fname); mkdir(M_.dname);
end end
mkdir(DirectoryName); mkdir(DirectoryName);
end end

View File

@ -126,7 +126,7 @@ for shock=1:ny
end end
% Save intermediate results % Save intermediate results
DirectoryName = [ M_.fname '/bvar_irf' ]; DirectoryName = [ M_.dname '/bvar_irf' ];
if ~isdir(DirectoryName) if ~isdir(DirectoryName)
mkdir('.',DirectoryName); mkdir('.',DirectoryName);
end end

View File

@ -147,7 +147,7 @@ if nnobs > 1 && horizon > 0
[~,nr,nc,~,~,nstar] = pltorg(nvar); [~,nr,nc,~,~,nstar] = pltorg(nvar);
m = 1; m = 1;
plot_index=0; plot_index=0;
OutputDirectoryName = CheckPath('graphs',M_.fname); OutputDirectoryName = CheckPath('graphs',M_.dname);
for i = 1:length(var_list) for i = 1:length(var_list)
if mod(i,nstar) == 1 if mod(i,nstar) == 1
plot_index=plot_index+1; plot_index=plot_index+1;
@ -208,7 +208,7 @@ if nnobs > 1 && horizon > 0
xlim([nobs(1)-offsetx nobs(end)+horizon]) xlim([nobs(1)-offsetx nobs(end)+horizon])
m = m + 1; m = m + 1;
if mod(i+1,nstar) == 1 || i==length(var_list) if mod(i+1,nstar) == 1 || i==length(var_list)
dyn_saveas(hfig,[M_.fname,filesep,'graphs',filesep M_.fname '_RecursiveForecasts_' int2str(plot_index)],options_.nodisplay,options_.graph_format); dyn_saveas(hfig,[M_.dname,filesep,'graphs',filesep M_.fname '_RecursiveForecasts_' int2str(plot_index)],options_.nodisplay,options_.graph_format);
end end
end end
end end

View File

@ -557,11 +557,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if ~options_.nograph if ~options_.nograph
[nbplt,nr,nc,lr,lc,nstar] = pltorg(M_.exo_nbr); [nbplt,nr,nc,lr,lc,nstar] = pltorg(M_.exo_nbr);
if ~exist([M_.fname '/graphs'],'dir') if ~exist([M_.dname '/graphs'],'dir')
mkdir(M_.fname,'graphs'); mkdir(M_.dname,'graphs');
end end
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_SmoothedShocks.tex'],'w'); fidTeX = fopen([M_.dname, '/graphs/' M_.fname '_SmoothedShocks.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n'); fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
@ -599,11 +599,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
title(name,'Interpreter','none') title(name,'Interpreter','none')
end end
end end
dyn_saveas(fh,[M_.fname, '/graphs/' M_.fname '_SmoothedShocks' int2str(plt)],options_.nodisplay,options_.graph_format); dyn_saveas(fh,[M_.dname, '/graphs/' M_.fname '_SmoothedShocks' int2str(plt)],options_.nodisplay,options_.graph_format);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedShocks%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt)); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedShocks%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.dname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Smoothed shocks.}'); fprintf(fidTeX,'\\caption{Smoothed shocks.}');
fprintf(fidTeX,'\\label{Fig:SmoothedShocks:%s}\n',int2str(plt)); fprintf(fidTeX,'\\label{Fig:SmoothedShocks:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');
@ -628,7 +628,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if ~options_.nograph if ~options_.nograph
[nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw); [nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_SmoothedObservationErrors.tex'],'w'); fidTeX = fopen([M_.dname, '/graphs/' M_.fname '_SmoothedObservationErrors.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n'); fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
@ -665,11 +665,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
title(name,'Interpreter','none') title(name,'Interpreter','none')
end end
end end
dyn_saveas(fh,[M_.fname, '/graphs/' M_.fname '_SmoothedObservationErrors' int2str(plt)],options_.nodisplay,options_.graph_format); dyn_saveas(fh,[M_.dname, '/graphs/' M_.fname '_SmoothedObservationErrors' int2str(plt)],options_.nodisplay,options_.graph_format);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedObservationErrors%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt)); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_SmoothedObservationErrors%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.dname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Smoothed observation errors.}'); fprintf(fidTeX,'\\caption{Smoothed observation errors.}');
fprintf(fidTeX,'\\label{Fig:SmoothedObservationErrors:%s}\n',int2str(plt)); fprintf(fidTeX,'\\label{Fig:SmoothedObservationErrors:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');
@ -689,7 +689,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
if ~options_.nograph if ~options_.nograph
[nbplt,nr,nc,lr,lc,nstar] = pltorg(n_varobs); [nbplt,nr,nc,lr,lc,nstar] = pltorg(n_varobs);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_HistoricalAndSmoothedVariables.tex'],'w'); fidTeX = fopen([M_.dname, '/graphs/' M_.fname '_HistoricalAndSmoothedVariables.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n'); fprintf(fidTeX,'%% TeX eps-loader file generated by dynare_estimation_1.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
@ -727,11 +727,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha
title(name,'Interpreter','none') title(name,'Interpreter','none')
end end
end end
dyn_saveas(fh,[M_.fname, '/graphs/' M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)],options_.nodisplay,options_.graph_format); dyn_saveas(fh,[M_.dname, '/graphs/' M_.fname '_HistoricalAndSmoothedVariables' int2str(plt)],options_.nodisplay,options_.graph_format);
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_HistoricalAndSmoothedVariables%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt)); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_HistoricalAndSmoothedVariables%s}\n',options_.figures.textwidth*min(i/nc,1),[M_.dname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Historical and smoothed variables.}'); fprintf(fidTeX,'\\caption{Historical and smoothed variables.}');
fprintf(fidTeX,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(plt)); fprintf(fidTeX,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');

View File

@ -173,7 +173,7 @@ end
% General options that can be set by the user in the mod file, otherwise default values are provided % General options that can be set by the user in the mod file, otherwise default values are provided
options_mom_ = set_default_option(options_mom_,'dirname',M_.fname); % directory in which to store estimation output options_mom_ = set_default_option(options_mom_,'dirname',M_.dname); % directory in which to store estimation output
options_mom_ = set_default_option(options_mom_,'graph_format','eps'); % specify the file format(s) for graphs saved to disk options_mom_ = set_default_option(options_mom_,'graph_format','eps'); % specify the file format(s) for graphs saved to disk
options_mom_ = set_default_option(options_mom_,'nodisplay',false); % do not display the graphs, but still save them to disk options_mom_ = set_default_option(options_mom_,'nodisplay',false); % do not display the graphs, but still save them to disk
options_mom_ = set_default_option(options_mom_,'nograph',false); % do not create graphs (which implies that they are not saved to the disk nor displayed) options_mom_ = set_default_option(options_mom_,'nograph',false); % do not create graphs (which implies that they are not saved to the disk nor displayed)

View File

@ -95,13 +95,13 @@ hh=dyn_figure(options_.nodisplay,'Name',FigureName);
bar(0:options_.mh_autocorrelation_function_size,autocor,'k'); bar(0:options_.mh_autocorrelation_function_size,autocor,'k');
axis tight axis tight
% create subdirectory <fname>/graphs if it doesn't exist % create subdirectory <dname>/graphs if it doesn't exist
if ~exist(M_.fname, 'dir') if ~exist(M_.dname, 'dir')
mkdir('.',M_.fname); mkdir('.',M_.dname);
end end
if ~exist([M_.fname filesep 'graphs']) if ~exist([M_.dname filesep 'graphs'])
mkdir(M_.fname,'graphs'); mkdir(M_.dname,'graphs');
end end
plot_name=get_the_name(column,0,M_,estim_params_,options_); plot_name=get_the_name(column,0,M_,estim_params_,options_);
dyn_saveas(hh,[M_.fname, filesep, 'graphs', filesep, 'MH_Autocorrelation_' plot_name],options_.nodisplay,options_.graph_format) dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'MH_Autocorrelation_' plot_name],options_.nodisplay,options_.graph_format)

View File

@ -77,11 +77,11 @@ end
[nbplt,nr,nc,lr,lc,nstar] = pltorg(length(x)); [nbplt,nr,nc,lr,lc,nstar] = pltorg(length(x));
if ~exist([Model.fname filesep 'graphs'],'dir') if ~exist([Model.dname filesep 'graphs'],'dir')
mkdir(Model.fname,'graphs'); mkdir(Model.dname,'graphs');
end end
if TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format))) if TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
fidTeX = fopen([Model.fname, '/graphs/', Model.fname '_CheckPlots.tex'],'w'); fidTeX = fopen([Model.dname, '/graphs/', Model.fname '_CheckPlots.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by mode_check.m (Dynare).\n'); fprintf(fidTeX,'%% TeX eps-loader file generated by mode_check.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
@ -201,12 +201,12 @@ for plt = 1:nbplt
text(0.25,0.5,'log-post') text(0.25,0.5,'log-post')
text(0.69,0.5,'log-lik kernel') text(0.69,0.5,'log-lik kernel')
end end
dyn_saveas(hh,[Model.fname, '/graphs/', Model.fname '_CheckPlots' int2str(plt) ],DynareOptions.nodisplay,DynareOptions.graph_format); dyn_saveas(hh,[Model.dname, '/graphs/', Model.fname '_CheckPlots' int2str(plt) ],DynareOptions.nodisplay,DynareOptions.graph_format);
if TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format))) if TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format)))
% TeX eps loader file % TeX eps loader file
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_CheckPlots%s}\n',DynareOptions.figures.textwidth*min(k/nc,1),[Model.fname, '/graphs/',Model.fname],int2str(plt)); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_CheckPlots%s}\n',DynareOptions.figures.textwidth*min(k/nc,1),[Model.dname, '/graphs/',Model.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Check plots.}'); fprintf(fidTeX,'\\caption{Check plots.}');
fprintf(fidTeX,'\\label{Fig:CheckPlots:%s}\n',int2str(plt)); fprintf(fidTeX,'\\label{Fig:CheckPlots:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');

View File

@ -41,11 +41,11 @@ end
npar = length(bayestopt_.p1); npar = length(bayestopt_.p1);
[nbplt,nr,nc,lr,lc,nstar] = pltorg(npar); [nbplt,nr,nc,lr,lc,nstar] = pltorg(npar);
if ~exist([M_.fname '/graphs'],'dir') if ~exist([M_.dname '/graphs'],'dir')
mkdir(M_.fname,'graphs'); mkdir(M_.dname,'graphs');
end end
if TeX && any(strcmp('eps',cellstr(options_.graph_format))) if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_Priors.tex'],'w'); fidTeX = fopen([M_.dname, '/graphs/' M_.fname '_Priors.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by plot_priors.m (Dynare).\n'); fprintf(fidTeX,'%% TeX eps-loader file generated by plot_priors.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
@ -73,11 +73,11 @@ for plt = 1:nbplt
end end
drawnow drawnow
end end
dyn_saveas(hplt,[M_.fname, '/graphs/' M_.fname '_Priors' int2str(plt)],options_.nodisplay,options_.graph_format); dyn_saveas(hplt,[M_.dname, '/graphs/' M_.fname '_Priors' int2str(plt)],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format))) if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering\n'); fprintf(fidTeX,'\\centering\n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n',options_.figures.textwidth*min(index/nc,1),[M_.fname, '/graphs/' M_.fname],int2str(plt)); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_Priors%s}\n',options_.figures.textwidth*min(index/nc,1),[M_.dname, '/graphs/' M_.fname],int2str(plt));
fprintf(fidTeX,'\\caption{Priors.}'); fprintf(fidTeX,'\\caption{Priors.}');
fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(plt)); fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(plt));
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');

View File

@ -37,12 +37,12 @@ if isempty(oo_.endo_simul)
error('rplot: oo_.endo_simul is empty.') error('rplot: oo_.endo_simul is empty.')
end end
% create subdirectory <fname>/graphs if it doesn't exist % create subdirectory <dname>/graphs if it doesn't exist
if ~exist(M_.fname, 'dir') if ~exist(M_.dname, 'dir')
mkdir('.',M_.fname); mkdir('.',M_.dname);
end end
if ~exist([M_.fname filesep 'graphs'],'dir') if ~exist([M_.dname filesep 'graphs'],'dir')
mkdir(M_.fname,'graphs'); mkdir(M_.dname,'graphs');
end end
ix = (1 - M_.maximum_lag:size(oo_.endo_simul,2)-M_.maximum_lag)'; ix = (1 - M_.maximum_lag:size(oo_.endo_simul,2)-M_.maximum_lag)';
@ -69,7 +69,7 @@ else
end end
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname, filesep, 'graphs', filesep, M_.fname '_simulated_trajectories_', num2str(options_.rplottype), '.tex'],'w'); fidTeX = fopen([M_.dname, filesep, 'graphs', filesep, M_.fname '_simulated_trajectories_', num2str(options_.rplottype), '.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by rplot.m (Dynare).\n'); fprintf(fidTeX,'%% TeX eps-loader file generated by rplot.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
end end
@ -94,9 +94,9 @@ if options_.rplottype == 0
legend(s1,'interpreter','none'); legend(s1,'interpreter','none');
end end
end end
dyn_saveas(hh,[M_.fname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format) dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format)
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
create_TeX_loader(fidTeX,[M_.fname, '/graphs/', 'SimulatedTrajectory_' s1{1}],'Simulated trajectories','SimulatedTrajectory_',s1{1},1) create_TeX_loader(fidTeX,[M_.dname, '/graphs/', 'SimulatedTrajectory_' s1{1}],'Simulated trajectories','SimulatedTrajectory_',s1{1},1)
end end
elseif options_.rplottype == 1 elseif options_.rplottype == 1
for j = 1:size(y,1) for j = 1:size(y,1)
@ -109,9 +109,9 @@ elseif options_.rplottype == 1
title(['Plot of ' s1{j}],'Interpreter','none') ; title(['Plot of ' s1{j}],'Interpreter','none') ;
end end
xlabel('Periods') ; xlabel('Periods') ;
dyn_saveas(hh,[M_.fname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{j}],options_.nodisplay,options_.graph_format) dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{j}],options_.nodisplay,options_.graph_format)
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
create_TeX_loader(fidTeX,[M_.fname, '/graphs/', 'SimulatedTrajectory_' s1{j}],'Simulated trajectories','SimulatedTrajectory_',s1{j},1); create_TeX_loader(fidTeX,[M_.dname, '/graphs/', 'SimulatedTrajectory_' s1{j}],'Simulated trajectories','SimulatedTrajectory_',s1{j},1);
end end
end end
elseif options_.rplottype == 2 elseif options_.rplottype == 2
@ -137,9 +137,9 @@ elseif options_.rplottype == 2
end end
axis tight; axis tight;
end end
dyn_saveas(hh,[M_.fname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format) dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format)
if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format)))
create_TeX_loader(fidTeX,[M_.fname, '/graphs/', 'SimulatedTrajectory_' s1{1}],'Simulated trajectories','SimulatedTrajectory_', s1{1},min(j/nc,1)); create_TeX_loader(fidTeX,[M_.dname, '/graphs/', 'SimulatedTrajectory_' s1{1}],'Simulated trajectories','SimulatedTrajectory_', s1{1},min(j/nc,1));
end end
end end

View File

@ -204,12 +204,12 @@ end
if options_.irf if options_.irf
var_listTeX = M_.endo_names_tex(i_var); var_listTeX = M_.endo_names_tex(i_var);
if ~options_.nograph || (TeX && any(strcmp('eps',cellstr(options_.graph_format)))) if ~options_.nograph || (TeX && any(strcmp('eps',cellstr(options_.graph_format))))
if ~exist([M_.fname '/graphs'],'dir') if ~exist([M_.dname '/graphs'],'dir')
mkdir(M_.fname,'graphs'); mkdir(M_.dname,'graphs');
end end
end end
if TeX && any(strcmp('eps',cellstr(options_.graph_format))) if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fidTeX = fopen([M_.fname, '/graphs/' M_.fname '_IRF.tex'],'w'); fidTeX = fopen([M_.dname, '/graphs/' M_.fname '_IRF.tex'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by stoch_simul.m (Dynare).\n'); fprintf(fidTeX,'%% TeX eps-loader file generated by stoch_simul.m (Dynare).\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
@ -300,11 +300,11 @@ if options_.irf
title(deblank(mylist(j,:)),'Interpreter','none'); title(deblank(mylist(j,:)),'Interpreter','none');
end end
end end
dyn_saveas(hh,[M_.fname, '/graphs/' M_.fname '_IRF_' tit{i}],options_.nodisplay,options_.graph_format); dyn_saveas(hh,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i}],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format))) if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s}\n',options_.figures.textwidth*min(j/nc,1),[M_.fname, '/graphs/' M_.fname],tit{i}); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s}\n',options_.figures.textwidth*min(j/nc,1),[M_.dname, '/graphs/' M_.fname],tit{i});
fprintf(fidTeX,'\\caption{Impulse response functions (orthogonalized shock to $%s$).}\n',titTeX{i}); fprintf(fidTeX,'\\caption{Impulse response functions (orthogonalized shock to $%s$).}\n',titTeX{i});
fprintf(fidTeX,'\\label{Fig:IRF:%s}\n', tit{i}); fprintf(fidTeX,'\\label{Fig:IRF:%s}\n', tit{i});
fprintf(fidTeX,'\\end{figure}\n'); fprintf(fidTeX,'\\end{figure}\n');
@ -333,11 +333,11 @@ if options_.irf
title(deblank(mylist((fig-1)*nstar+plt,:)),'Interpreter','none'); title(deblank(mylist((fig-1)*nstar+plt,:)),'Interpreter','none');
end end
end end
dyn_saveas(hh,[M_.fname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(fig)],options_.nodisplay,options_.graph_format); dyn_saveas(hh,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(fig)],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format))) if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(plt/nc,1),[M_.fname, '/graphs/' M_.fname],tit{i},int2str(fig)); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(plt/nc,1),[M_.dname, '/graphs/' M_.fname],tit{i},int2str(fig));
if options_.relative_irf if options_.relative_irf
fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i}); fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i});
else else
@ -365,11 +365,11 @@ if options_.irf
title(deblank(mylist((nbplt-1)*nstar+plt,:)),'Interpreter','none'); title(deblank(mylist((nbplt-1)*nstar+plt,:)),'Interpreter','none');
end end
end end
dyn_saveas(hh,[M_.fname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(nbplt) ],options_.nodisplay,options_.graph_format); dyn_saveas(hh,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(nbplt) ],options_.nodisplay,options_.graph_format);
if TeX && any(strcmp('eps',cellstr(options_.graph_format))) if TeX && any(strcmp('eps',cellstr(options_.graph_format)))
fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\begin{figure}[H]\n');
fprintf(fidTeX,'\\centering \n'); fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(m/lc,1),[M_.fname, '/graphs/' M_.fname],tit{i},int2str(nbplt)); fprintf(fidTeX,'\\includegraphics[width=%2.2f\\textwidth]{%s_IRF_%s%s}\n',options_.figures.textwidth*min(m/lc,1),[M_.dname, '/graphs/' M_.fname],tit{i},int2str(nbplt));
if options_.relative_irf if options_.relative_irf
fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i}); fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i});
else else

View File

@ -115,12 +115,12 @@ plot(1:TotalNumberOfMhDraws,MovingAverage,'-k','linewidth',2)
hold off hold off
axis tight axis tight
legend({'MCMC draw';[num2str(N) ' period moving average']},'Location','NorthWest') legend({'MCMC draw';[num2str(N) ' period moving average']},'Location','NorthWest')
% create subdirectory <fname>/graphs if it doesn't exist % create subdirectory <dname>/graphs if it doesn't exist
if ~exist(M_.fname, 'dir') if ~exist(M_.dname, 'dir')
mkdir('.',M_.fname); mkdir('.',M_.dname);
end end
if ~exist([M_.fname filesep 'graphs'],'dir') if ~exist([M_.dname filesep 'graphs'],'dir')
mkdir(M_.fname,'graphs'); mkdir(M_.dname,'graphs');
end end
%get name for plot %get name for plot
@ -131,10 +131,10 @@ else
end end
plot_name=[plot_name,'_blck_',num2str(blck)]; plot_name=[plot_name,'_blck_',num2str(blck)];
dyn_saveas(hh,[M_.fname, filesep, 'graphs', filesep, 'TracePlot_' plot_name],options_.nodisplay,options_.graph_format) dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'TracePlot_' plot_name],options_.nodisplay,options_.graph_format)
if options_.TeX if options_.TeX
fid=fopen([M_.fname,'/graphs/',M_.fname,'_TracePlot_' plot_name,'.tex'],'w+'); fid=fopen([M_.dname,'/graphs/',M_.fname,'_TracePlot_' plot_name,'.tex'],'w+');
if strcmpi(type,'DeepParameter') if strcmpi(type,'DeepParameter')
tex_names=M_.param_names_tex; tex_names=M_.param_names_tex;
@ -162,7 +162,7 @@ if options_.TeX
fprintf(fid,'%-s\n','\begin{figure}[H]'); fprintf(fid,'%-s\n','\begin{figure}[H]');
fprintf(fid,'%-s\n','\centering'); fprintf(fid,'%-s\n','\centering');
fprintf(fid,'%-s\n',[' \includegraphics[width=0.8\textwidth]{',[M_.fname, '/graphs/TracePlot_' plot_name],'}\\']); fprintf(fid,'%-s\n',[' \includegraphics[width=0.8\textwidth]{',[M_.dname, '/graphs/TracePlot_' plot_name],'}\\']);
fprintf(fid,'%-s\n',[' \caption{',FigureName,'}']); fprintf(fid,'%-s\n',[' \caption{',FigureName,'}']);
fprintf(fid,'%-s\n','\end{figure}'); fprintf(fid,'%-s\n','\end{figure}');
fclose(fid); fclose(fid);

View File

@ -39,10 +39,10 @@ else
M_var_root = {'M_.endo', 'M_.exo', 'M_.exo_det', 'M_.param'}; M_var_root = {'M_.endo', 'M_.exo', 'M_.exo_det', 'M_.param'};
end end
if ~exist([M_.fname '/latex'],'dir') if ~exist([M_.dname '/latex'],'dir')
mkdir(M_.fname,'latex'); mkdir(M_.dname,'latex');
end end
fid = fopen([M_.fname, '/latex/' M_.fname '_latex_definitions.tex'], 'w'); fid = fopen([M_.dname, '/latex/' M_.fname '_latex_definitions.tex'], 'w');
for i=1:length(tables) for i=1:length(tables)
fprintf(fid, '\\begin{center}\n'); fprintf(fid, '\\begin{center}\n');
fprintf(fid, '\\begin{longtable}{ccc}\n'); fprintf(fid, '\\begin{longtable}{ccc}\n');

View File

@ -37,11 +37,11 @@ if ~isequal(M_.param_names, M_.param_names_long)
Long_names_present = true; Long_names_present = true;
end end
if ~exist([M_.fname '/latex'],'dir') if ~exist([M_.dname '/latex'],'dir')
mkdir(M_.fname,'latex'); mkdir(M_.dname,'latex');
end end
fid = fopen([M_.fname, '/latex/' M_.fname '_latex_parameters.tex'], 'w'); fid = fopen([M_.dname, '/latex/' M_.fname '_latex_parameters.tex'], 'w');
fprintf(fid, '\\begin{center}\n'); fprintf(fid, '\\begin{center}\n');
if Long_names_present==1 if Long_names_present==1
fprintf(fid, '\\begin{longtable}{ccc}\n'); fprintf(fid, '\\begin{longtable}{ccc}\n');

View File

@ -54,10 +54,10 @@ ub=bounds.ub;
PriorNames = { 'Beta' , 'Gamma' , 'Gaussian' , 'Inv. Gamma' , 'Uniform' , 'Inv. Gamma -- 2', '', 'Weibull' }; PriorNames = { 'Beta' , 'Gamma' , 'Gaussian' , 'Inv. Gamma' , 'Uniform' , 'Inv. Gamma -- 2', '', 'Weibull' };
if ~exist([M_.fname '/latex'],'dir') if ~exist([M_.dname '/latex'],'dir')
mkdir(M_.fname,'latex'); mkdir(M_.dname,'latex');
end end
fidTeX = fopen([M_.fname, '/latex/' Model.fname '_priors_table.tex'],'w+'); fidTeX = fopen([M_.dname, '/latex/' Model.fname '_priors_table.tex'],'w+');
fprintf(fidTeX,'%% TeX-table generated by Dynare write_latex_prior_table.m.\n'); fprintf(fidTeX,'%% TeX-table generated by Dynare write_latex_prior_table.m.\n');
fprintf(fidTeX,'%% Prior Information\n'); fprintf(fidTeX,'%% Prior Information\n');
fprintf(fidTeX,['%% ' datestr(now,0)]); fprintf(fidTeX,['%% ' datestr(now,0)]);