0001 function plot_priors(bayestopt_,M_,estim_params_,options_)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 TeX = options_.TeX;
0034
0035 figurename = 'Priors';
0036 npar = length(bayestopt_.p1);
0037 [nbplt,nr,nc,lr,lc,nstar] = pltorg(npar);
0038
0039 if TeX
0040 fidTeX = fopen([M_.fname '_Priors.TeX'],'w');
0041 fprintf(fidTeX,'%% TeX eps-loader file generated by plot_priors.m (Dynare).\n');
0042 fprintf(fidTeX,['%% ' datestr(now,0) '\n']);
0043 fprintf(fidTeX,' \n');
0044 end
0045 for plt = 1:nbplt,
0046 hplt = dyn_figure(options_,'Name',figurename);
0047 if TeX
0048 TeXNAMES = [];
0049 NAMES = [];
0050 end
0051 nstar0 = min(nstar,npar-(plt-1)*nstar);
0052 for index=1:nstar0
0053 names = [];
0054 i = (plt-1)*nstar + index;
0055 [x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);
0056 [nam,texnam] = get_the_name(i,TeX,M_,estim_params_,options_);
0057 if TeX
0058 if index==1
0059 TeXNAMES = texnam;
0060 NAMES = nam;
0061 else
0062 TeXNAMES = char(TeXNAMES,texnam);
0063 NAMES = char(NAMES,nam);
0064 end
0065 end
0066 subplot(nr,nc,index)
0067 hh = plot(x,f,'-k','linewidth',2);
0068 set(hh,'color',[0.7 0.7 0.7]);
0069 box on
0070 title(nam,'Interpreter','none')
0071 drawnow
0072 end
0073 dyn_saveas(hplt,[M_.fname '_Priors' int2str(plt)],options_);
0074 if TeX
0075 fprintf(fidTeX,'\\begin{figure}[H]\n');
0076 for jj = 1:nstar0,
0077 fprintf(fidTeX,'\\psfrag{%s}[1][][0.5][0]{%s}\n',deblank(NAMES(jj,:)),deblank(TeXNAMES(jj,:)));
0078 end
0079 fprintf(fidTeX,'\\centering\n');
0080 fprintf(fidTeX,'\\includegraphics[scale=0.5]{%s_Priors%s}\n',M_.fname,int2str(plt));
0081 fprintf(fidTeX,'\\caption{Priors.}');
0082 fprintf(fidTeX,'\\label{Fig:Priors:%s}\n',int2str(plt));
0083 fprintf(fidTeX,'\\end{figure}\n');
0084 end
0085 end
0086 if TeX
0087 fprintf(fidTeX,' \n');
0088 fprintf(fidTeX,'%% End of TeX file.\n');
0089 fclose(fidTeX);
0090 end