question about mode_file

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.

question about mode_file

Postby earsmall » Tue Sep 08, 2015 11:56 am

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: Select all
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) ;
 


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.
Last edited by earsmall on Mon Sep 14, 2015 8:26 pm, edited 1 time in total.
earsmall
 
Posts: 40
Joined: Mon Jun 15, 2015 3:44 pm

Re: question about mode_file

Postby jpfeifer » Sun Sep 13, 2015 6:05 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 1 guest

cron