Question about mode_file

Hi, all.

As you all know, Bayesian DSGE estimation using dynare starts with finding posterior mode.
However, I have continuously watching the following error message.

[code]Error using chol
Matrix must be positive definite.

Error in metropolis_hastings_initialization (line 68)
d = chol(vv);

Error in random_walk_metropolis_hastings (line 69)
ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns, NewFile, MAX_nruns,
d ] = …

Error in dynare_estimation_1 (line 931)
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

Error in dynare_estimation (line 70)
dynare_estimation_1(var_list,dname);

Error in kor_4_1st (line 186)
dynare_estimation(var_list_);

Error in dynare (line 120)
evalin(‘base’,fname) ;
[/code]

As far as I know, above error can be solved by imposing different initial starting values.
However, It is quite time-consuming and I failed to start estimation eventually.

According to dynare user guide, we can impose mode file by adding “mode_file” command.

I manually coded matlab file to search posterior modes and then apply them into dynare.
Finally, estimation is successfully done.

However, I wanted to check computed posterior mode is correctly computed. (because it is calculated my own matlab code)
So, I did two things with a program that can estimate successfully without different starting values from prior mean.

  1. estimation using dynare without mode_file
  2. estimation using dynare with mode__file

I expected exactly same log data density. But they are slightly different from each other.

I know they can be slightly different but I want to ask how you think about this situation.

The Laplace approximation to the marginal data density should be (almost) the same. For the modified harmonic mean estimator, there might be small differences because it is based on the random draws of the MCMC algorithm. To judge the mode, use the mode_check plots.