Added posterior impulse response functions.
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@477 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
8145b7e3f5
commit
a6ec6bd2ec
|
@ -2,7 +2,6 @@ function PosteriorIRF()
|
||||||
% stephane.adjemian@ens.fr [09-25-2005]
|
% stephane.adjemian@ens.fr [09-25-2005]
|
||||||
global options_ estim_params_ oo_ M_
|
global options_ estim_params_ oo_ M_
|
||||||
|
|
||||||
|
|
||||||
nvx = estim_params_.nvx;
|
nvx = estim_params_.nvx;
|
||||||
nvn = estim_params_.nvn;
|
nvn = estim_params_.nvn;
|
||||||
ncx = estim_params_.ncx;
|
ncx = estim_params_.ncx;
|
||||||
|
@ -10,7 +9,12 @@ ncn = estim_params_.ncn;
|
||||||
np = estim_params_.np ;
|
np = estim_params_.np ;
|
||||||
npar = nvx+nvn+ncx+ncn+np;
|
npar = nvx+nvn+ncx+ncn+np;
|
||||||
offset = npar-np;
|
offset = npar-np;
|
||||||
|
%%
|
||||||
|
MaxNumberOfPlotPerFigure = 4;% The square root must be an integer!
|
||||||
|
nn = sqrt(MaxNumberOfPlotPerFigure);
|
||||||
|
%%
|
||||||
|
CheckPath('Plots\IRFs');
|
||||||
|
CheckPath('metropolis\IRFs');
|
||||||
DirectoryName = CheckPath('metropolis');
|
DirectoryName = CheckPath('metropolis');
|
||||||
load([ DirectoryName '\' M_.fname '_mh_history'])
|
load([ DirectoryName '\' M_.fname '_mh_history'])
|
||||||
FirstMhFile = record.KeepedDraws.FirstMhFile;
|
FirstMhFile = record.KeepedDraws.FirstMhFile;
|
||||||
|
@ -20,26 +24,28 @@ TotalNumberOfMhDraws = sum(record.MhDraws(:,1));
|
||||||
NumberOfDraws = TotalNumberOfMhDraws-floor(options_.mh_drop*TotalNumberOfMhDraws);
|
NumberOfDraws = TotalNumberOfMhDraws-floor(options_.mh_drop*TotalNumberOfMhDraws);
|
||||||
clear record;
|
clear record;
|
||||||
MAX_nruns = ceil(options_.MaxNumberOfBytes/(npar+2)/8);
|
MAX_nruns = ceil(options_.MaxNumberOfBytes/(npar+2)/8);
|
||||||
MAX_nirfs = ceil(options_.MaxNumberOfBytes/(options_.irf*length(oo_.steady_state)*M_.exo_nbr)/8);
|
MAX_nirfs = ceil(options_.MaxNumberOfBytes/(options_.irf*length(oo_.steady_state)*M_.exo_nbr)/8)+50;
|
||||||
|
%%
|
||||||
B = round(0.25*NumberOfDraws);
|
B = round(0.25*NumberOfDraws);
|
||||||
|
|
||||||
if B <= MAX_nirfs
|
if B <= MAX_nirfs
|
||||||
stock_irf = zeros(options_.irf,size(M_.endo_names,1),M_.exo_nbr,B);
|
stock_irf = zeros(options_.irf,size(M_.endo_names,1),M_.exo_nbr,B);
|
||||||
elseif nvn & B > MAX_nirfs
|
elseif nvn & B > MAX_nirfs
|
||||||
stock_irf = zeros(options_.irf,size(M_.endo_names,1),M_.exo_nbr,MAX_nirfs);
|
stock_irf = zeros(options_.irf,size(M_.endo_names,1),M_.exo_nbr,MAX_nirfs);
|
||||||
end
|
end
|
||||||
|
%%
|
||||||
irun = 0;
|
irun = 0;
|
||||||
ifil = 1;
|
ifil = 1;
|
||||||
|
|
||||||
h = waitbar(0,'Bayesian IRFs...');
|
h = waitbar(0,'Bayesian IRFs...');
|
||||||
|
if B >= MAX_nirfs
|
||||||
|
stock_irf = zeros(options_.irf,M_.endo_nbr,M_.exo_nbr,MAX_nirfs);
|
||||||
|
else
|
||||||
|
stock_irf = zeros(options_.irf,M_.endo_nbr,M_.exo_nbr,B);
|
||||||
|
end
|
||||||
for b=1:B
|
for b=1:B
|
||||||
irun = irun+1;
|
irun = irun+1;
|
||||||
deep = GetOneDraw(NumberOfDraws,FirstMhFile,LastMhFile,FirstLine,MAX_nruns,DirectoryName);
|
deep = GetOneDraw(NumberOfDraws,FirstMhFile,LastMhFile,FirstLine,MAX_nruns,DirectoryName);
|
||||||
M_.params(estim_params_.param_vals(:,1)) = deep(offset+1:end);
|
M_.params(estim_params_.param_vals(:,1)) = deep(offset+1:end);
|
||||||
dr = resol(oo_.steady_state,0)
|
dr = resol(oo_.steady_state,0);
|
||||||
if nvx
|
if nvx
|
||||||
ip = 1;
|
ip = 1;
|
||||||
for i=1:nvx
|
for i=1:nvx
|
||||||
|
@ -66,9 +72,9 @@ for b=1:B
|
||||||
if options_.relative_irf
|
if options_.relative_irf
|
||||||
y = 100*y/cs(i,i);
|
y = 100*y/cs(i,i);
|
||||||
end
|
end
|
||||||
for j = 1:size(M_.endo_names,1)
|
for j = 1:M_.endo_nbr%size(M_.endo_names,1)
|
||||||
if max(y(j,:)) - min(y(j,:)) > 1e-10
|
if max(y(j,:)) - min(y(j,:)) > 1e-10
|
||||||
stock_irf(:,j,i,b) = transpose(y(j,:));
|
stock_irf(:,j,i,irun) = transpose(y(j,:));
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -85,13 +91,31 @@ for b=1:B
|
||||||
end
|
end
|
||||||
ifil = ifil-1;
|
ifil = ifil-1;
|
||||||
close(h)
|
close(h)
|
||||||
|
varlist = options_.varlist;
|
||||||
|
if isempty(varlist)
|
||||||
|
varlist = M_.endo_names;
|
||||||
|
SelecVariables = transpose(1:M_.endo_nbr);
|
||||||
|
nvar = M_.endo_nbr;
|
||||||
|
else
|
||||||
|
nvar = size(varlist,1);
|
||||||
|
SelecVariables = [];
|
||||||
|
for i=1:nvar
|
||||||
|
if ~isempty(strmatch(varlist(i,:),M_.endo_names,'exact'))
|
||||||
|
SelecVariables = [SelecVariables;strmatch(varlist(i,:),M_.endo_names,'exact')];
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
MeanIRF = zeros(options_.irf,nvar,M_.exo_nbr);
|
MeanIRF = zeros(options_.irf,nvar,M_.exo_nbr);
|
||||||
MedianIRF = zeros(options_.irf,nvar,M_.exo_nbr);
|
MedianIRF = zeros(options_.irf,nvar,M_.exo_nbr);
|
||||||
StdIRF = zeros(options_.irf,nvar,M_.exo_nbr);
|
StdIRF = zeros(options_.irf,nvar,M_.exo_nbr);
|
||||||
DistribIRF = zeros(options_.irf,9,nvar,M_.exo_nbr);
|
DistribIRF = zeros(options_.irf,9,nvar,M_.exo_nbr);
|
||||||
HPDIRF = zeros(options_.irf,2,nvar,M_.exo_nbr);
|
HPDIRF = zeros(options_.irf,2,nvar,M_.exo_nbr);
|
||||||
|
if options_.TeX
|
||||||
|
varlist_TeX = [];
|
||||||
|
for i=1:nvar
|
||||||
|
varlist_TeX = strvcat(varlist_TeX,M_.endo_names_tex(SelecVariables(i),:));
|
||||||
|
end
|
||||||
|
end
|
||||||
fprintf('MH: Posterior IRFs...\n');
|
fprintf('MH: Posterior IRFs...\n');
|
||||||
tit(M_.exo_names_orig_ord,:) = M_.exo_names;
|
tit(M_.exo_names_orig_ord,:) = M_.exo_names;
|
||||||
for i = 1:M_.exo_nbr
|
for i = 1:M_.exo_nbr
|
||||||
|
@ -106,8 +130,8 @@ for i = 1:M_.exo_nbr
|
||||||
StartLine = StartLine+DeProfundis;
|
StartLine = StartLine+DeProfundis;
|
||||||
end
|
end
|
||||||
[MeanIRF(k,j,i),MedianIRF(k,j,i),VarIRF(k,j,i),HPDIRF(k,:,j,i),DistribIRF(k,:,j,i)] = posterior_moments(tmp,0);
|
[MeanIRF(k,j,i),MedianIRF(k,j,i),VarIRF(k,j,i),HPDIRF(k,:,j,i),DistribIRF(k,:,j,i)] = posterior_moments(tmp,0);
|
||||||
disp([' Variable: ' deblank(M_.endo_names(SelecVariables(j),:)) ', orthogonalized shock to ' deblank(tit(i,:))])
|
|
||||||
end
|
end
|
||||||
|
disp([' Variable: ' deblank(M_.endo_names(SelecVariables(j),:)) ', orthogonalized shock to ' deblank(tit(i,:))])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
clear stock_irf;
|
clear stock_irf;
|
||||||
|
@ -122,179 +146,79 @@ for i = 1:M_.exo_nbr
|
||||||
eval(['oo_.PosteriorIRF.HPDsup.' name ' = HPDIRF(:,2,j,i);']);
|
eval(['oo_.PosteriorIRF.HPDsup.' name ' = HPDIRF(:,2,j,i);']);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
%% Finally i build the plots.
|
%% Finally i build the plots.
|
||||||
%%
|
%%
|
||||||
|
if options_.TeX
|
||||||
if TeX
|
fidTeX = fopen([M_.dname '\Plots\IRFs\' M_.fname '_BayesianIRF.TeX'],'w');
|
||||||
fidTeX = fopen([M_.fname '_BayesianIRF.TeX'],'w');
|
|
||||||
fprintf(fidTeX,'%% TeX eps-loader file generated by PosteriorIRF.m (Dynare).\n');
|
fprintf(fidTeX,'%% TeX eps-loader file generated by PosteriorIRF.m (Dynare).\n');
|
||||||
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
|
fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
|
||||||
fprintf(fidTeX,' \n');
|
fprintf(fidTeX,' \n');
|
||||||
|
titTeX(M_.exo_names_orig_ord,:) = M_.exo_names_tex;
|
||||||
end
|
end
|
||||||
|
%%
|
||||||
if TeX; titTeX(M_.exo_name_orig_ord,:) = M_.exo_names_tex; end;
|
figunumber = 0;
|
||||||
|
subplotnum = 0;
|
||||||
% $$$ for i=1:M_.exo_nbr
|
for i=1:M_.exo_nbr
|
||||||
% $$$ number_of_plots_to_draw = 0;
|
NAMES = [];
|
||||||
% $$$ index = [];
|
if options_.TeX
|
||||||
% $$$ for j=1:nvar
|
TEXNAMES = [];
|
||||||
% $$$ if MeanIRF(1,j,i)
|
end
|
||||||
% $$$ number_of_plots_to_draw = number_of_plots_to_draw + 1;
|
for j=1:nvar
|
||||||
% $$$ index = cat(1,index,j);
|
if max(abs(MeanIRF(:,j,i))) > 10^(-6)
|
||||||
% $$$ end
|
subplotnum = subplotnum+1;
|
||||||
% $$$ end
|
if subplotnum == 1 & options_.relative_irf
|
||||||
% $$$ [nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw);
|
hh = figure('Name',['Relative response to orthogonalized shock to ' tit(i,:)]);
|
||||||
% $$$ if nbplt == 1
|
elseif subplotnum == 1 & ~options_.relative_irf
|
||||||
% $$$ if options_.relative_irf
|
hh = figure('Name',['Orthogonalized shock to ' tit(i,:)]);
|
||||||
% $$$ hh = figure('Name',['Relative response to orthogonalized' ...
|
end
|
||||||
% $$$ ' shock to ' tit(i,:)]);
|
set(0,'CurrentFigure',hh)
|
||||||
% $$$ else
|
subplot(nn,nn,subplotnum);
|
||||||
% $$$ hh = figure('Name',['Orthogonalized shock to ' tit(i, ...
|
plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
||||||
% $$$ :)]);
|
hold on
|
||||||
% $$$ end
|
for k = 1:9
|
||||||
% $$$ NAMES = [];
|
plot(1:options_.irf,DistribIRF(:,k,j,i),'-g','linewidth',0.5)
|
||||||
% $$$ if TeX; TEXNAMES = []; end;
|
end
|
||||||
% $$$ for j=1:number_of_plots_to_draw
|
plot(1:options_.irf,MeanIRF(:,j,i),'-k','linewidth',1)
|
||||||
% $$$ set(0,'CurrentFigure',hh)
|
xlim([1 options_.irf]);
|
||||||
% $$$ subplot(nr,nc,j);
|
hold off
|
||||||
% $$$ plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
name = deblank(varlist(j,:));
|
||||||
% $$$ hold on
|
NAMES = strvcat(NAMES,name);
|
||||||
% $$$ for k = 1:9
|
if options_.TeX
|
||||||
% $$$ plot(1:options_.irf,DistribIRF(:,index(j),i,k),'-g','linewidth',0.5)
|
texname = deblank(varlist_TeX(j,:));
|
||||||
% $$$ end
|
TEXNAMES = strvcat(TEXNAMES,['$' texname '$']);
|
||||||
% $$$ plot(1:options_.irf,MeanIRF(:,index(j),i),'-k','linewidth',1)
|
end
|
||||||
% $$$ xlim([1 options_.irf]);
|
title(name,'Interpreter','none')
|
||||||
% $$$ hold off
|
end
|
||||||
% $$$ name = deblank(M_.endo_names(SelecVariables(index(j)),:));
|
if subplotnum == MaxNumberOfPlotPerFigure | j == nvar
|
||||||
% $$$ NAMES = strvcat(NAMES,name);
|
eval(['print -depsc2 ' M_.dname '\Plots\IRFs\' M_.fname '_Bayesian_IRF_' deblank(tit(i,:))]);
|
||||||
% $$$ if TeX
|
eval(['print -dpdf ' M_.dname '\Plots\IRFs\' M_.fname '_Bayesian_IRF_' deblank(tit(i,:))]);
|
||||||
% $$$ texname = deblank(M_.endo_names_tex(SelecVariables(index(j)),:));
|
saveas(hh,[M_.dname '\Plots\IRFs\' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '.fig']);
|
||||||
% $$$ TEXNAMES = strvcat(TEXNAMES,['$' texname '$']);
|
if options_.nograph, close(hh), end
|
||||||
% $$$ end
|
if options_.TeX
|
||||||
% $$$ title(name,'Interpreter','none')
|
fprintf(fidTeX,'\\begin{figure}[H]\n');
|
||||||
% $$$ end
|
for jj = 1:size(TEXNAMES,1)
|
||||||
% $$$ eval(['print -depsc2 ' M_.fname '_Bayesian_IRF_' deblank(tit(i,:))]);
|
fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{%s}\n'],deblank(NAMES(jj,:)),deblank(TEXNAMES(jj,:)));
|
||||||
% $$$ eval(['print -dpdf ' M_.fname '_Bayesian_IRF_' deblank(tit(i,:))]);
|
end
|
||||||
% $$$ saveas(hh,[M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '.fig']);
|
fprintf(fidTeX,'\\centering \n');
|
||||||
% $$$ if options_.nograph, close(hh), end
|
fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_Bayesian_IRF_%s}\n',M_.fname,deblank(tit(i,:)));
|
||||||
% $$$ if TeX
|
if options_.relative_irf
|
||||||
% $$$ fprintf(fidTeX,'\\begin{figure}[H]\n');
|
fprintf(fidTeX,['\\caption{Bayesian relative IRF.}']);
|
||||||
% $$$ for jj = 1:number_of_plots_to_draw
|
else
|
||||||
% $$$ fprintf(fidTeX,['\\psfrag{%s}[1][][0.5][0]{%s}\n'],deblank(NAMES(jj,:)),deblank(TEXNAMES(jj,:)));
|
fprintf(fidTeX,'\\caption{Bayesian IRF.}');
|
||||||
% $$$ end
|
end
|
||||||
% $$$ fprintf(fidTeX,'\\centering \n');
|
fprintf(fidTeX,'\\label{Fig:BayesianIRF:%s}\n',deblank(tit(i,:)));
|
||||||
% $$$ fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_Bayesian_IRF_%s}\n',M_.fname,deblank(tit(i,:)));
|
fprintf(fidTeX,'\\end{figure}\n');
|
||||||
% $$$ if options_.relative_irf
|
fprintf(fidTeX,' \n');
|
||||||
% $$$ fprintf(fidTeX,['\\caption{Bayesian relative' ...
|
end
|
||||||
% $$$ ' IRF.}']);
|
subplotnum = 0;
|
||||||
% $$$ else
|
figunumber = figunumber+1;
|
||||||
% $$$ fprintf(fidTeX,'\\caption{Bayesian IRF.}');
|
end
|
||||||
% $$$ end
|
end% loop over selected endo_var
|
||||||
% $$$ fprintf(fidTeX,'\\label{Fig:BayesianIRF:%s}\n',deblank(tit(i,:)));
|
end% loop over exo_var
|
||||||
% $$$ fprintf(fidTeX,'\\end{figure}\n');
|
%%
|
||||||
% $$$ fprintf(fidTeX,' \n');
|
if options_.TeX
|
||||||
% $$$ end
|
fprintf(fidTeX,'%% End of TeX file.\n');
|
||||||
% $$$ elseif nbplt > 1
|
fclose(fidTeX);
|
||||||
% $$$ for fig = 1:nbplt-1
|
end
|
||||||
% $$$ if options_.relative_irf
|
fprintf('MH: Posterior IRFs, done!\n');
|
||||||
% $$$ hh = figure('Name',['Relative response to orthogonalized' ...
|
|
||||||
% $$$ ' shock to ' tit(i,:) ' figure ' int2str(fig) '.']);
|
|
||||||
% $$$ else
|
|
||||||
% $$$ hh = figure('Name',['Orthogonalized shock to ' tit(i,:) ...
|
|
||||||
% $$$ ' figure ' int2str(fig) '.']);
|
|
||||||
% $$$ end
|
|
||||||
% $$$ NAMES = [];
|
|
||||||
% $$$ if TeX; TEXNAMES = []; end;
|
|
||||||
% $$$ for j=1:nstar
|
|
||||||
% $$$ jj = (fig-1)*nstar + j;
|
|
||||||
% $$$ subplot(nr,nc,j);
|
|
||||||
% $$$ plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
|
||||||
% $$$ hold on
|
|
||||||
% $$$ for k = 1:9
|
|
||||||
% $$$ plot(1:options_.irf,DistribIRF(:,index(jj),i,k),'-g','linewidth',0.5)
|
|
||||||
% $$$ end
|
|
||||||
% $$$ plot(1:options_.irf,MeanIRF(:,index(jj),i),'-k','linewidth',1)
|
|
||||||
% $$$ xlim([1 options_.irf]);
|
|
||||||
% $$$ hold off
|
|
||||||
% $$$ name = deblank(M_.endo_names(SelecVariables(index(jj)),:));
|
|
||||||
% $$$ NAMES = strvcat(NAMES,name);
|
|
||||||
% $$$ if TeX
|
|
||||||
% $$$ texname = deblank(M_.endo_names_tex(SelecVariables(index(jj)),:));
|
|
||||||
% $$$ TEXNAMES = strvcat(TEXNAMES,['$' texname '$']);
|
|
||||||
% $$$ end
|
|
||||||
% $$$ title(name,'Interpreter','none')
|
|
||||||
% $$$ end
|
|
||||||
% $$$ eval(['print -depsc2 ' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) int2str(fig)]);
|
|
||||||
% $$$ eval(['print -dpdf ' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) int2str(fig)]);
|
|
||||||
% $$$ saveas(hh,[M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) int2str(fig) '.fig']);
|
|
||||||
% $$$ if options_.nograph, close(hh), end
|
|
||||||
% $$$ if TeX
|
|
||||||
% $$$ fprintf(fidTeX,'\\begin{figure}[H]\n');
|
|
||||||
% $$$ for jj = 1:nstar
|
|
||||||
% $$$ 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_Bayesian_IRF_%s%s}\n',M_.fname,deblank(tit(i,:)),int2str(fig));
|
|
||||||
% $$$ if options_.relative_irf == 1
|
|
||||||
% $$$ fprintf(fidTeX,['\\caption{Bayesian relative' ...
|
|
||||||
% $$$ ' IRF.}']);
|
|
||||||
% $$$ else
|
|
||||||
% $$$ fprintf(fidTeX,'\\caption{Bayesian IRF.}');
|
|
||||||
% $$$ end
|
|
||||||
% $$$ fprintf(fidTeX,'\\label{Fig:BayesianIRF:%s:%s}\n',deblank(tit(i,:)), int2str(fig));
|
|
||||||
% $$$ fprintf(fidTeX,'\\end{figure}\n');
|
|
||||||
% $$$ fprintf(fidTeX,' \n');
|
|
||||||
% $$$ end
|
|
||||||
% $$$ end
|
|
||||||
% $$$ hh = figure('Name',['Orthogonalized shock to ' tit(i,:) ' figure ' int2str(nbplt) '.']);
|
|
||||||
% $$$ NAMES = [];
|
|
||||||
% $$$ if TeX; TEXNAMES = []; end;
|
|
||||||
% $$$ for j=1:number_of_plots_to_draw -(nbplt-1)*nstar
|
|
||||||
% $$$ jj = (nbplt-1)*nstar + j;
|
|
||||||
% $$$ subplot(nr,nc,j);
|
|
||||||
% $$$ plot([1 options_.irf],[0 0],'-r','linewidth',0.5);
|
|
||||||
% $$$ hold on
|
|
||||||
% $$$ for k = 1:9
|
|
||||||
% $$$ plot(1:options_.irf,DistribIRF(:,index(jj),i,k),'-g','linewidth',0.5)
|
|
||||||
% $$$ end
|
|
||||||
% $$$ plot(1:options_.irf,MeanIRF(:,index(jj),i),'-k','linewidth',1)
|
|
||||||
% $$$ xlim([1 options_.irf]);
|
|
||||||
% $$$ hold off
|
|
||||||
% $$$ name = deblank(M_.endo_names(SelecVariables(index(jj)),:));
|
|
||||||
% $$$ NAMES = strvcat(NAMES,name);
|
|
||||||
% $$$ if TeX
|
|
||||||
% $$$ texname = deblank(M_.endo_names_tex(SelecVariables(index(jj)),:));
|
|
||||||
% $$$ TEXNAMES = strvcat(TEXNAMES,['$' texname '$']);
|
|
||||||
% $$$ end
|
|
||||||
% $$$ title(name,'Interpreter','none')
|
|
||||||
% $$$ end
|
|
||||||
% $$$ eval(['print -depsc2 ' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) int2str(nbplt)]);
|
|
||||||
% $$$ eval(['print -dpdf ' M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) int2str(nbplt)]);
|
|
||||||
% $$$ saveas(hh,[M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) int2str(nbplt) '.fig']);
|
|
||||||
% $$$ if options_.nograph, close(hh), end
|
|
||||||
% $$$ if TeX
|
|
||||||
% $$$ fprintf(fidTeX,'\\begin{figure}[H]\n');
|
|
||||||
% $$$ for jj = 1:nstar
|
|
||||||
% $$$ 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_Bayesian_IRF_%s%s}\n',M_.fname,deblank(tit(i,:)),int2str(nbplt));
|
|
||||||
% $$$ fprintf(fidTeX,'\\caption{Bayesian IRF.}');
|
|
||||||
% $$$ fprintf(fidTeX,'\\label{Fig:BayesianIRF:%s:%s}\n',deblank(tit(i,:)), int2str(nbplt));
|
|
||||||
% $$$ fprintf(fidTeX,'\\end{figure}\n');
|
|
||||||
% $$$ fprintf(fidTeX,' \n');
|
|
||||||
% $$$ end
|
|
||||||
% $$$ else % nbplt = 0
|
|
||||||
% $$$ disp('There''s nothing to plot here!')
|
|
||||||
% $$$ end
|
|
||||||
% $$$ end
|
|
||||||
% $$$ if TeX
|
|
||||||
% $$$ fprintf(fidTeX,'%% End of TeX file.\n');
|
|
||||||
% $$$ fclose(fidTeX);
|
|
||||||
% $$$ end
|
|
||||||
% $$$ fprintf('MH: Posterior IRFs, done!\n');
|
|
|
@ -471,7 +471,7 @@ if any(bayestopt_.pshape > 0) & options_.TeX %% Bayesian estimation (posterior m
|
||||||
ip = nvx+nvn+ncx+ncn+1;
|
ip = nvx+nvn+ncx+ncn+1;
|
||||||
for i=1:np
|
for i=1:np
|
||||||
fprintf(fidTeX,'$%s$ & %s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n',...
|
fprintf(fidTeX,'$%s$ & %s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n',...
|
||||||
deblank(estim_params_.tex(i,:)),...
|
M_.param_names_tex(estim_params_.param_vals(i,1),:),...%deblank(estim_params_.tex(i,:)),...
|
||||||
deblank(pnames(bayestopt_.pshape(ip)+1,:)),...
|
deblank(pnames(bayestopt_.pshape(ip)+1,:)),...
|
||||||
bayestopt_.pmean(ip),...
|
bayestopt_.pmean(ip),...
|
||||||
estim_params_.param_vals(i,6),...
|
estim_params_.param_vals(i,6),...
|
||||||
|
|
Loading…
Reference in New Issue