From da3943beba3837aed01c2cf44988b3f578213e1b Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Wed, 16 Dec 2020 22:38:22 +0100 Subject: [PATCH] Make sure output is saved in dname-folder That's where other functions are looking for them --- matlab/UnivariateSpectralDensity.m | 10 ++++---- matlab/bvar_forecast.m | 8 +++---- matlab/bvar_irf.m | 2 +- matlab/dynare_estimation.m | 4 ++-- matlab/dynare_estimation_1.m | 22 +++++++++--------- matlab/method_of_moments/method_of_moments.m | 2 +- matlab/mh_autocorrelation_function.m | 12 +++++----- matlab/mode_check.m | 10 ++++---- matlab/plot_priors.m | 10 ++++---- matlab/rplot.m | 24 ++++++++++---------- matlab/stoch_simul.m | 18 +++++++-------- matlab/trace_plot.m | 16 ++++++------- matlab/write_latex_definitions.m | 6 ++--- matlab/write_latex_parameter_table.m | 6 ++--- matlab/write_latex_prior_table.m | 6 ++--- 15 files changed, 78 insertions(+), 78 deletions(-) diff --git a/matlab/UnivariateSpectralDensity.m b/matlab/UnivariateSpectralDensity.m index 1c04d622d..7061fb975 100644 --- a/matlab/UnivariateSpectralDensity.m +++ b/matlab/UnivariateSpectralDensity.m @@ -151,11 +151,11 @@ else end if ~options_.nograph - if ~exist(M_.fname, 'dir') - mkdir('.',M_.fname); + if ~exist(M_.dname, 'dir') + mkdir('.',M_.dname); end - if ~exist([M_.fname '/graphs'],'dir') - mkdir(M_.fname,'graphs'); + if ~exist([M_.dname '/graphs'],'dir') + mkdir(M_.dname,'graphs'); end for i= 1:nvar @@ -165,6 +165,6 @@ if ~options_.nograph ylabel('f(\omega)') box on 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 diff --git a/matlab/bvar_forecast.m b/matlab/bvar_forecast.m index 55fdf9ce9..2fe5601cb 100644 --- a/matlab/bvar_forecast.m +++ b/matlab/bvar_forecast.m @@ -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_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-'}); @@ -153,10 +153,10 @@ end % Store results -DirectoryName = [ M_.fname '/bvar_forecast' ]; +DirectoryName = [ M_.dname '/bvar_forecast' ]; if ~isdir(DirectoryName) - if ~isdir(M_.fname) - mkdir(M_.fname); + if ~isdir(M_.dname) + mkdir(M_.dname); end mkdir(DirectoryName); end diff --git a/matlab/bvar_irf.m b/matlab/bvar_irf.m index 5f017aa7d..2dbd908e4 100644 --- a/matlab/bvar_irf.m +++ b/matlab/bvar_irf.m @@ -126,7 +126,7 @@ for shock=1:ny end % Save intermediate results -DirectoryName = [ M_.fname '/bvar_irf' ]; +DirectoryName = [ M_.dname '/bvar_irf' ]; if ~isdir(DirectoryName) mkdir('.',DirectoryName); end diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m index 812857d00..07f1300e1 100644 --- a/matlab/dynare_estimation.m +++ b/matlab/dynare_estimation.m @@ -147,7 +147,7 @@ if nnobs > 1 && horizon > 0 [~,nr,nc,~,~,nstar] = pltorg(nvar); m = 1; plot_index=0; - OutputDirectoryName = CheckPath('graphs',M_.fname); + OutputDirectoryName = CheckPath('graphs',M_.dname); for i = 1:length(var_list) if mod(i,nstar) == 1 plot_index=plot_index+1; @@ -208,7 +208,7 @@ if nnobs > 1 && horizon > 0 xlim([nobs(1)-offsetx nobs(end)+horizon]) m = m + 1; 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 diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index ca97cd30f..7d49dcff9 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -557,11 +557,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha if ~options_.nograph [nbplt,nr,nc,lr,lc,nstar] = pltorg(M_.exo_nbr); - if ~exist([M_.fname '/graphs'],'dir') - mkdir(M_.fname,'graphs'); + if ~exist([M_.dname '/graphs'],'dir') + mkdir(M_.dname,'graphs'); end 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,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,' \n'); @@ -599,11 +599,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha title(name,'Interpreter','none') 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))) fprintf(fidTeX,'\\begin{figure}[H]\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,'\\label{Fig:SmoothedShocks:%s}\n',int2str(plt)); fprintf(fidTeX,'\\end{figure}\n'); @@ -628,7 +628,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha if ~options_.nograph [nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw); 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,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,' \n'); @@ -665,11 +665,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha title(name,'Interpreter','none') 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))) fprintf(fidTeX,'\\begin{figure}[H]\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,'\\label{Fig:SmoothedObservationErrors:%s}\n',int2str(plt)); fprintf(fidTeX,'\\end{figure}\n'); @@ -689,7 +689,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha if ~options_.nograph [nbplt,nr,nc,lr,lc,nstar] = pltorg(n_varobs); 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,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,' \n'); @@ -727,11 +727,11 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha title(name,'Interpreter','none') 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))) fprintf(fidTeX,'\\begin{figure}[H]\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,'\\label{Fig:HistoricalAndSmoothedVariables:%s}\n',int2str(plt)); fprintf(fidTeX,'\\end{figure}\n'); diff --git a/matlab/method_of_moments/method_of_moments.m b/matlab/method_of_moments/method_of_moments.m index 10fc45826..c19a50ccf 100644 --- a/matlab/method_of_moments/method_of_moments.m +++ b/matlab/method_of_moments/method_of_moments.m @@ -173,7 +173,7 @@ end % 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_,'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) diff --git a/matlab/mh_autocorrelation_function.m b/matlab/mh_autocorrelation_function.m index 377de1978..6312a3262 100644 --- a/matlab/mh_autocorrelation_function.m +++ b/matlab/mh_autocorrelation_function.m @@ -95,13 +95,13 @@ hh=dyn_figure(options_.nodisplay,'Name',FigureName); bar(0:options_.mh_autocorrelation_function_size,autocor,'k'); axis tight -% create subdirectory /graphs if it doesn't exist -if ~exist(M_.fname, 'dir') - mkdir('.',M_.fname); +% create subdirectory /graphs if it doesn't exist +if ~exist(M_.dname, 'dir') + mkdir('.',M_.dname); end -if ~exist([M_.fname filesep 'graphs']) - mkdir(M_.fname,'graphs'); +if ~exist([M_.dname filesep 'graphs']) + mkdir(M_.dname,'graphs'); end 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) diff --git a/matlab/mode_check.m b/matlab/mode_check.m index ada266663..17a119f7d 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -77,11 +77,11 @@ end [nbplt,nr,nc,lr,lc,nstar] = pltorg(length(x)); -if ~exist([Model.fname filesep 'graphs'],'dir') - mkdir(Model.fname,'graphs'); +if ~exist([Model.dname filesep 'graphs'],'dir') + mkdir(Model.dname,'graphs'); end 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,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,' \n'); @@ -201,12 +201,12 @@ for plt = 1:nbplt text(0.25,0.5,'log-post') text(0.69,0.5,'log-lik kernel') 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))) % TeX eps loader file fprintf(fidTeX,'\\begin{figure}[H]\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,'\\label{Fig:CheckPlots:%s}\n',int2str(plt)); fprintf(fidTeX,'\\end{figure}\n'); diff --git a/matlab/plot_priors.m b/matlab/plot_priors.m index 7d8aec8f7..881585a4d 100644 --- a/matlab/plot_priors.m +++ b/matlab/plot_priors.m @@ -41,11 +41,11 @@ end npar = length(bayestopt_.p1); [nbplt,nr,nc,lr,lc,nstar] = pltorg(npar); -if ~exist([M_.fname '/graphs'],'dir') - mkdir(M_.fname,'graphs'); +if ~exist([M_.dname '/graphs'],'dir') + mkdir(M_.dname,'graphs'); end 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,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,' \n'); @@ -73,11 +73,11 @@ for plt = 1:nbplt end drawnow 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))) fprintf(fidTeX,'\\begin{figure}[H]\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,'\\label{Fig:Priors:%s}\n',int2str(plt)); fprintf(fidTeX,'\\end{figure}\n'); diff --git a/matlab/rplot.m b/matlab/rplot.m index 2605e7f5a..de200511d 100644 --- a/matlab/rplot.m +++ b/matlab/rplot.m @@ -37,12 +37,12 @@ if isempty(oo_.endo_simul) error('rplot: oo_.endo_simul is empty.') end -% create subdirectory /graphs if it doesn't exist -if ~exist(M_.fname, 'dir') - mkdir('.',M_.fname); +% create subdirectory /graphs if it doesn't exist +if ~exist(M_.dname, 'dir') + mkdir('.',M_.dname); end -if ~exist([M_.fname filesep 'graphs'],'dir') - mkdir(M_.fname,'graphs'); +if ~exist([M_.dname filesep 'graphs'],'dir') + mkdir(M_.dname,'graphs'); end ix = (1 - M_.maximum_lag:size(oo_.endo_simul,2)-M_.maximum_lag)'; @@ -69,7 +69,7 @@ else end 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,['%% ' datestr(now,0) '\n']); end @@ -94,9 +94,9 @@ if options_.rplottype == 0 legend(s1,'interpreter','none'); 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))) - 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 elseif options_.rplottype == 1 for j = 1:size(y,1) @@ -109,9 +109,9 @@ elseif options_.rplottype == 1 title(['Plot of ' s1{j}],'Interpreter','none') ; end 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))) - 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 elseif options_.rplottype == 2 @@ -137,9 +137,9 @@ elseif options_.rplottype == 2 end axis tight; 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))) - 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 diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index ce517a8af..098175ece 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -204,12 +204,12 @@ end if options_.irf var_listTeX = M_.endo_names_tex(i_var); if ~options_.nograph || (TeX && any(strcmp('eps',cellstr(options_.graph_format)))) - if ~exist([M_.fname '/graphs'],'dir') - mkdir(M_.fname,'graphs'); + if ~exist([M_.dname '/graphs'],'dir') + mkdir(M_.dname,'graphs'); end end 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,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,' \n'); @@ -300,11 +300,11 @@ if options_.irf title(deblank(mylist(j,:)),'Interpreter','none'); 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))) fprintf(fidTeX,'\\begin{figure}[H]\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,'\\label{Fig:IRF:%s}\n', tit{i}); fprintf(fidTeX,'\\end{figure}\n'); @@ -333,11 +333,11 @@ if options_.irf title(deblank(mylist((fig-1)*nstar+plt,:)),'Interpreter','none'); 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))) fprintf(fidTeX,'\\begin{figure}[H]\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 fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i}); else @@ -365,11 +365,11 @@ if options_.irf title(deblank(mylist((nbplt-1)*nstar+plt,:)),'Interpreter','none'); 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))) fprintf(fidTeX,'\\begin{figure}[H]\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 fprintf(fidTeX,'\\caption{Relative impulse response functions (orthogonalized shock to $%s$).}', titTeX{i}); else diff --git a/matlab/trace_plot.m b/matlab/trace_plot.m index 310c2c3e8..ec5d282a4 100644 --- a/matlab/trace_plot.m +++ b/matlab/trace_plot.m @@ -115,12 +115,12 @@ plot(1:TotalNumberOfMhDraws,MovingAverage,'-k','linewidth',2) hold off axis tight legend({'MCMC draw';[num2str(N) ' period moving average']},'Location','NorthWest') -% create subdirectory /graphs if it doesn't exist -if ~exist(M_.fname, 'dir') - mkdir('.',M_.fname); +% create subdirectory /graphs if it doesn't exist +if ~exist(M_.dname, 'dir') + mkdir('.',M_.dname); end -if ~exist([M_.fname filesep 'graphs'],'dir') - mkdir(M_.fname,'graphs'); +if ~exist([M_.dname filesep 'graphs'],'dir') + mkdir(M_.dname,'graphs'); end %get name for plot @@ -131,10 +131,10 @@ else end 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 - 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') tex_names=M_.param_names_tex; @@ -162,7 +162,7 @@ if options_.TeX fprintf(fid,'%-s\n','\begin{figure}[H]'); 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','\end{figure}'); fclose(fid); diff --git a/matlab/write_latex_definitions.m b/matlab/write_latex_definitions.m index 531e799cf..5f009b3b0 100644 --- a/matlab/write_latex_definitions.m +++ b/matlab/write_latex_definitions.m @@ -39,10 +39,10 @@ else M_var_root = {'M_.endo', 'M_.exo', 'M_.exo_det', 'M_.param'}; end -if ~exist([M_.fname '/latex'],'dir') - mkdir(M_.fname,'latex'); +if ~exist([M_.dname '/latex'],'dir') + mkdir(M_.dname,'latex'); 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) fprintf(fid, '\\begin{center}\n'); fprintf(fid, '\\begin{longtable}{ccc}\n'); diff --git a/matlab/write_latex_parameter_table.m b/matlab/write_latex_parameter_table.m index 521246240..6441a0410 100644 --- a/matlab/write_latex_parameter_table.m +++ b/matlab/write_latex_parameter_table.m @@ -37,11 +37,11 @@ if ~isequal(M_.param_names, M_.param_names_long) Long_names_present = true; end -if ~exist([M_.fname '/latex'],'dir') - mkdir(M_.fname,'latex'); +if ~exist([M_.dname '/latex'],'dir') + mkdir(M_.dname,'latex'); 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'); if Long_names_present==1 fprintf(fid, '\\begin{longtable}{ccc}\n'); diff --git a/matlab/write_latex_prior_table.m b/matlab/write_latex_prior_table.m index 3bae6d8c5..5129597f5 100644 --- a/matlab/write_latex_prior_table.m +++ b/matlab/write_latex_prior_table.m @@ -54,10 +54,10 @@ ub=bounds.ub; PriorNames = { 'Beta' , 'Gamma' , 'Gaussian' , 'Inv. Gamma' , 'Uniform' , 'Inv. Gamma -- 2', '', 'Weibull' }; -if ~exist([M_.fname '/latex'],'dir') - mkdir(M_.fname,'latex'); +if ~exist([M_.dname '/latex'],'dir') + mkdir(M_.dname,'latex'); 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,'%% Prior Information\n'); fprintf(fidTeX,['%% ' datestr(now,0)]);