From 379972d715d1de1a9b284658113cfada8b7ae21b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Wed, 4 Jul 2012 13:04:49 +0200 Subject: [PATCH] Removed prior_penalty in dsge_likelihood. If options_.prior_trunc is set to zero (the default is strictly positive) then prior_correction is infinite because the prior density is zero (this is not true for the uniform prior)... This does not help the optimizer. Even if we do not fall in this case (because options_.prior_trunc>0 or becuase only uniform priors are used for the bounded parameters) the meaning of this correction is unclear. --- matlab/dsge_likelihood.m | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/matlab/dsge_likelihood.m b/matlab/dsge_likelihood.m index a646f82af..3385bb253 100644 --- a/matlab/dsge_likelihood.m +++ b/matlab/dsge_likelihood.m @@ -145,7 +145,7 @@ function [fval,DLIK,Hess,exit_flag,ys,trend_coeff,info,Model,DynareOptions,Bayes % In summary, an initial call to the present function, without triggering % any condition, guarantees that 'penalty' is properly initialized when needed. -persistent penalty prior_penalty +persistent penalty % Initialization of the returned variables and others... fval = []; @@ -189,10 +189,6 @@ end if ~isequal(DynareOptions.mode_compute,1) && any(xparam1BayesInfo.ub) k = find(xparam1>BayesInfo.ub); fval = penalty+sum((xparam1(k)-BayesInfo.ub(k)).^2); - xtemp=xparam1; - xtemp(k)=BayesInfo.ub(k); - prior_correction = max(0,-prior_penalty -priordens(xtemp,BayesInfo.pshape,BayesInfo.p6,BayesInfo.p7,BayesInfo.p3,BayesInfo.p4)); - fval = fval+prior_correction; exit_flag = 0; info = 42; if analytic_derivation, @@ -777,7 +769,6 @@ DynareOptions.kalman_algo = kalman_algo; % Update the penalty. penalty = fval; -prior_penalty = -lnprior; if analytic_derivation==0 && nargout==2, lik=lik(start:end,:);