Avoiding MCMC failure with non positive definite Hessian

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Avoiding MCMC failure with non positive definite Hessian

Postby JamieHall » Mon May 19, 2014 4:19 am

Hi everyone,

I really like the way Dynare implements MCMC estimation --- many thanks to the Dynare team for all your efforts! --- but there's one situation that it doesn't handle that well. During model development, it's not unusual to have an estimated Hessian at the mode that's not positive definite. One parameter might be dodgy, or it might be hard to find the mode, or there may be scaling problems between different parameters, etc. In those cases, Dynare prints a warning but then causes a Matlab error on line 68 of metropolis_hastings_initialization.m, on the line d = chol(vv);

Sometimes you may want to run Metropolis Hastings anyway for a while, because that often helps to find the real mode and/or to identify which parameters are causing a problem. Here's the code I use to do that. If you like, you can drop it in as a replacement for line 68 of metropolis_hastings_initialization.m.

Code: Select all
[ d, notPosDef ] = chol(vv);
if notPosDef
    disp('Warning: using diagonal proposal covariance.');
    diagv = diag(vv);
    diagv(diagv < 0) = 1e-5;
    d = diag(sqrt(diagv));
end


Jamie
JamieHall
 
Posts: 20
Joined: Wed Feb 11, 2009 4:42 am

Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 4 guests