Commit a60ab498 authored by michel's avatar michel
Browse files

v4: corrected bugs for option SMOOTHER. There are still problems with variable and file names

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1486 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 22247c80
......@@ -72,7 +72,7 @@ irun4 = 1;
irun5 = 1;
irun6 = 1;
irun7 = 1;
ifil1 = 1;
ifil1 = 0;
ifil2 = 1;
ifil3 = 1;
ifil4 = 1;
......@@ -165,49 +165,49 @@ for b=1:B
irun6 = irun6 + 1;
irun7 = irun7 + 1;
if irun1 > MAX_nsmoo
if irun1 > MAX_nsmoo | b == B
stock = stock_smooth;
save([DirectoryName '/' M_.fname '_smooth' int2str(ifil1)],'stock');
ifil1 = ifil1 + 1;
save([DirectoryName '/' M_.fname '_smooth' int2str(ifil1)],'stock');
irun1 = 1;
end
if nvx & irun2 > MAX_ninno
if nvx & (irun2 > MAX_ninno | b == B)
stock = stock_innov;
save([DirectoryName '/' M_.fname '_inno' int2str(ifil2)],'stock');
ifil2 = ifil2 + 1;
irun2 = 1;
end
if nvn & irun3 > MAX_error
if nvn & (irun3 > MAX_error | b == B)
stock = stock_error;
save([DirectoryName '/' M_.fname '_error' int2str(ifil3)],'stock');
ifil3 = ifil3 + 1;
irun3 = 1;
end
if naK & irun4 > MAX_naK
if naK & (irun4 > MAX_naK | b == B)
stock = stock_filter;
save([DirectoryName '/' M_.fname '_filter' int2str(ifil4)],'stock');
ifil4 = ifil4 + 1;
irun4 = 1;
end
if irun5 > MAX_nruns
if irun5 > MAX_nruns | b == B
stock = stock_param;
save([DirectoryName '/' M_.fname '_param' int2str(ifil5)],'stock','stock_logpo','stock_ys');
ifil5 = ifil5 + 1;
irun5 = 1;
end
if irun6 > MAX_nforc1
if horizon & (irun6 > MAX_nforc1 | b == B)
stock = stock_forcst_mean;
save([DirectoryName '/' M_.fname '_forc_mean' int2str(ifil6)],'stock');
ifil6 = ifil6 + 1;
irun6 = 1;
end
if irun7 > MAX_nforc2
if horizon & (irun7 > MAX_nforc2 | b == B)
stock = stock_forcst_total;
save([DirectoryName '/' M_.fname '_forc_total' int2str(ifil7)],'stock');
ifil6 = ifil6 + 1;
......@@ -222,7 +222,6 @@ stock_gend=gend;
stock_data=Y;
save([DirectoryName '/' M_.fname '_data'],'stock_gend','stock_data');
ifil1=25;
pm3(endo_nbr,gend,ifil1,B,'Smoothed variables',...
M_.endo_names(SelecVariables),M_.endo_names,'tit_tex',M_.endo_names,...
'names2','smooth',[M_.fname '/metropolis'],'_smooth')
\ No newline at end of file
......@@ -57,7 +57,7 @@ function pm3(n1,n2,ifil,B,tit1,tit2,tit3,tit_tex,names1,names2,name3,DirectoryNa
%% Finally I build the plots.
%%
if options_.TeX
fidTeX = fopen([M_.dname '\Plots\' M_.fname '_' name4 '.TeX'],'w');
fidTeX = fopen([M_.dname '\Plots\' M_.fname '_' name3 '.TeX'],'w');
fprintf(fidTeX,'%% TeX eps-loader file generated by Dynare.\n');
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
fprintf(fidTeX,' \n');
......@@ -92,9 +92,9 @@ function pm3(n1,n2,ifil,B,tit1,tit2,tit3,tit_tex,names1,names2,name3,DirectoryNa
title(name,'Interpreter','none')
end
if subplotnum == MaxNumberOfPlotsPerFigure | j == nvar
eval(['print -depsc2 ' M_.dname '\Plots\' M_.fname '_' name4 '_' deblank(tit(i,:))]);
eval(['print -dpdf ' M_.dname '\Plots\' M_.fname '_' name4 '_' deblank(tit(i,:))]);
saveas(hh,[M_.dname '\Plots\' M_.fname '_' name4 '_' deblank(tit(i,:)) '.fig']);
eval(['print -depsc2 ' M_.dname '\Plots\' M_.fname '_' name3 '_' deblank(tit3(i,:))]);
eval(['print -dpdf ' M_.dname '\Plots\' M_.fname '_' name3 '_' deblank(tit3(i,:))]);
saveas(hh,[M_.dname '\Plots\' M_.fname '_' name3 '_' deblank(tit3(i,:)) '.fig']);
if options_.nograph, close(hh), end
if options_.TeX
fprintf(fidTeX,'\\begin{figure}[H]\n');
......@@ -102,13 +102,13 @@ function pm3(n1,n2,ifil,B,tit1,tit2,tit3,tit_tex,names1,names2,name3,DirectoryNa
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{%s}\n'],deblank(NAMES(jj,:)),deblank(TEXNAMES(jj,:)));
end
fprintf(fidTeX,'\\centering \n');
fprintf(fidTeX,['\\includegraphics[scale=0.5]{%s_' name4 '_%s}\n'],M_.fname,deblank(tit(i,:)));
fprintf(fidTeX,['\\includegraphics[scale=0.5]{%s_' name3 '_%s}\n'],M_.fname,deblank(tit3(i,:)));
if options_.relative_irf
fprintf(fidTeX,['\\caption{' caption '.}']);
else
fprintf(fidTeX,['\\caption{' caption '.}']);
end
fprintf(fidTeX,'\\label{Fig:BayesianIRF:%s}\n',deblank(tit(i,:)));
fprintf(fidTeX,'\\label{Fig:%s:%s}\n',name3,deblank(tit3(i,:)));
fprintf(fidTeX,'\\end{figure}\n');
fprintf(fidTeX,' \n');
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment