Errors in finding posterior modes
Posted: Mon Aug 24, 2015 4:54 am
Hi, I am trying to reproduce estimation results in Justiniano and Preston (2010).
However, I have failed to find posterior modes in estimation using dynare.
In fact, there are no particular contents in my code.
Estimation declaration is as follows.
presample=4 is from the fact that 4 initial data points are excluded for initialization of Kalman filter.
prefilter=1 is because authors demeaned the series before the estimation.
Also diffuse_filter is added to deal with Blanchard - Kahn errors.
Others are basic options.
I think there is no mistakes in describing the model but continuously get the following error message.
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 jp_2010 (line 331)
dynare_estimation(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;
One thing strange is that prior declaration parts especially for shocks.
According to the paper,
That is why I wrote my code as
Is there any one can help me?
Thank you.
However, I have failed to find posterior modes in estimation using dynare.
In fact, there are no particular contents in my code.
Estimation declaration is as follows.
- Code: Select all
estimation(datafile=aus_data3,plot_priors=0,nograph,mode_compute=4,presample=4,prefilter=1,
diffuse_filter,mh_nblocks=1,mh_replic=50000,mh_jscale=0.10);
presample=4 is from the fact that 4 initial data points are excluded for initialization of Kalman filter.
prefilter=1 is because authors demeaned the series before the estimation.
Also diffuse_filter is added to deal with Blanchard - Kahn errors.
Others are basic options.
I think there is no mistakes in describing the model but continuously get the following error message.
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 jp_2010 (line 331)
dynare_estimation(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;
One thing strange is that prior declaration parts especially for shocks.
According to the paper,
To allow for a wide set of values a priori, we specify Inverse-Gamma I densities,
with infinite variance by fixing the degrees of freedom at 2.
That is why I wrote my code as
- Code: Select all
stderr eps_ps, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
stderr eps_ys, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
stderr eps_is, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
stderr eps_a, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
stderr eps_m, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
stderr eps_g, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
stderr eps_rp, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
stderr eps_cp, 0.50, 1E-10, 10, INV_GAMMA1_PDF,0.50,0.25;
Is there any one can help me?
Thank you.