Once in a while, you may get a failure of positive definitness at line 52 of metropolis_hastings_initialization, on "d = chol(vv);".
This can be caused, I think, when you have an unidentified parameter that has a weak gamma prior. But it also happens sometimes when you use newrat (option mode_compute=5), because mr_hessian returns a complex-valued Hessian matrix. I haven't been able to figure out why that happens, but here is a workaround that seems to paper over the problem succesfully. In dynare_estimation, just after line 410, insert these lines:
- Code: Select all
if(any(any(~isreal(hh))))
if ~options_.bvar_dsge
hh = reshape(hessian('DsgeLikelihood',xparam1,gend,data),nx,nx);
else
hh = reshape(hessian('DsgeVarLikelihood',xparam1,gend),nx,nx);
end
end
...so that Dynare will fall back to the standard Hessian estimator if newrat's doesn't work.
cheerio
Jamie