+ Do not plot likelihood and posterior density if cost_flag = 0, put a
red bullet on the abscissa instead. + Cosmetic changes. git-svn-id: https://www.dynare.org/svn/dynare/trunk@2821 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
5495f0c6c0
commit
181b268699
|
@ -84,26 +84,37 @@ for plt = 1:nbplt,
|
||||||
end
|
end
|
||||||
for i=1:length(z)
|
for i=1:length(z)
|
||||||
xx(kk) = z(i);
|
xx(kk) = z(i);
|
||||||
if isempty(strmatch('dsge_prior_weight',M_.param_names)),
|
if isempty(strmatch('dsge_prior_weight',M_.param_names))
|
||||||
try
|
[fval,cost_flag] = DsgeLikelihood(xx,gend,data,data_index,number_of_observations,no_more_missing_observations);
|
||||||
y(i,1) = DsgeLikelihood(xx,gend,data,data_index,number_of_observations,no_more_missing_observations);
|
if cost_flag
|
||||||
catch
|
y(i,1) = fval;
|
||||||
y(i,1) = bayestopt_.penalty;
|
else
|
||||||
|
y(i,1) = NaN;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
y(i,1) = DsgeVarLikelihood(xx,gend);
|
[fval,cost_flag] = DsgeVarLikelihood(xx,gend);
|
||||||
|
if cost_flag
|
||||||
|
y(i,1) = fval;
|
||||||
|
else
|
||||||
|
y(i,1) = NaN;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if options_.mode_check_nolik==0,
|
if options_.mode_check_nolik==0
|
||||||
lnprior = priordens(xx,bayestopt_.pshape,bayestopt_.p6,bayestopt_.p7,bayestopt_.p3,bayestopt_.p4);
|
lnprior = priordens(xx,bayestopt_.pshape,bayestopt_.p6,bayestopt_.p7,bayestopt_.p3,bayestopt_.p4);
|
||||||
y(i,2) = (y(i,1)+lnprior-dy);
|
y(i,2) = (y(i,1)+lnprior-dy);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
plot(z,-y);
|
plot(z,-y);
|
||||||
hold on
|
hold on
|
||||||
yl=get(gca,'ylim');
|
yl=get(gca,'ylim');
|
||||||
plot( [x(kk) x(kk)], yl, 'c', 'LineWidth', 1)
|
plot( [x(kk) x(kk)], yl, 'c', 'LineWidth', 1)
|
||||||
|
NaN_index = find(isnan(y(:,1)));
|
||||||
|
zNaN = z(NaN_index);
|
||||||
|
yNaN = yl(1)*ones(size(NaN_index));
|
||||||
|
plot(zNaN,yNaN,'o','MarkerEdgeColor','r','MarkerFaceColor','r','MarkerSize',6);
|
||||||
title(name,'interpreter','none')
|
title(name,'interpreter','none')
|
||||||
hold off
|
hold off
|
||||||
|
axis tight
|
||||||
drawnow
|
drawnow
|
||||||
end
|
end
|
||||||
if options_.mode_check_nolik==0,
|
if options_.mode_check_nolik==0,
|
||||||
|
@ -137,9 +148,4 @@ for plt = 1:nbplt,
|
||||||
fprintf(fidTeX,'\\end{figure}\n');
|
fprintf(fidTeX,'\\end{figure}\n');
|
||||||
fprintf(fidTeX,' \n');
|
fprintf(fidTeX,' \n');
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
% SA 07-31-2004 * New default : no more than nine plots per figure.
|
|
||||||
% * Figures are automatically saved in eps, pdf and fig formats.
|
|
||||||
% * Figures are automatically closed (this should be an option).
|
|
||||||
% * Creation of a TeX-loader file for the postcript file.
|
|
Loading…
Reference in New Issue