Calibration version and identification are ok, but POSTERIOR KERNEL OPTIMIZATION PROBLEM!

dear professor Pfeifer

I have checked my file with a fully calibration version and it works, I also use command " identification", it says “All parameters are identified”.
but when I begin to estimate the model, I get:

POSTERIOR KERNEL OPTIMIZATION PROBLEM!
(minus) the hessian matrix at the “mode” is not positive definite!
=> posterior variance of the estimated parameters are not positive.
You should try to change the initial values of the parameters using
the estimated_params_init block, or use another optimization routine.
Warning: The results below are most likely wrong!

what seems to be the proble?
best
Mercury

Without the codes it is impossible to tell. Check your observation equations and the mode_check plots.

mercury.mod (11.9 KB)
mycmrobs.mat (4.2 KB)

thanks professor , here is my mod.file and data~

You posted the wrong codes. They return

ERROR: There are 40 equations but 41 endogenous variables!

mycmrobs.m (262 Bytes)
data.mat (4.8 KB)
mercury.mod (11.4 KB)
sorry, this one is correct~

Using the mod-file, I ran

estimation(datafile = 'mycmrobs.m',
        mode_file=mercury_mode,
         mh_replic = 20000, mh_nblocks = 2, mode_check,
        mode_compute =0,bayesian_irf,irf=20,moments_varendo,mh_jscale = 0.0003,mcmc_jumping_covariance='identity_matrix')   k  cxf omegabar sigma  net bf_obs gdp_obs invs_obs q zetai b_obs,Z_obs  ;

i.e. used an identity matrix instead of the Hessian. The resulting posterior shows a lot of persistence related to net exports. I am not sure your model is able to capture its dynamics.

net export NX appears in my model twice: GDP=C+I+G+NX, and an AR(1) SHOCK PROCESS:ln(NX)=pho_nx*NX(-1)+e_nx;
will it have a big impact on model behavior, and after I change the data source of NX, whics seems to be less persistent, it still does not work.

If mode-finding is such a problem, try running the MCMC with an identity matrix as the proposal density (as I did above) and see what happens.

1 Like