Page 1 of 1

where are the results of "mh_conf_sig" stored

PostPosted: Thu Jan 14, 2016 1:42 pm
by fuyangzhao
Hi,

I was trying to draw IRFs and their corresponding probability bands. I checked the reference manuel and it says "mh_conf_sig" could able to do that.

So I wrote "mh_conf_sig=0.68" in "estimation ( ) ". But I could'n find the results...

Can anyone help me?

Re: where are the results of "mh_conf_sig" stored

PostPosted: Thu Jan 14, 2016 1:53 pm
by jpfeifer
If you have enabled
Code: Select all
bayesian_irf

they should be stored in oo_.PosteriorIRF.dsge.HPDinf/HPDsup

Re: where are the results of "mh_conf_sig" stored

PostPosted: Thu Jan 14, 2016 2:08 pm
by fuyangzhao
jpfeifer wrote:If you have enabled
Code: Select all
bayesian_irf

they should be stored in oo_.PosteriorIRF.dsge.HPDinf/HPDsup


I cannot find the command "bayesian_irf" in the reference manual, can you please show me how to use it?

Re: where are the results of "mh_conf_sig" stored

PostPosted: Thu Jan 14, 2016 2:33 pm
by jpfeifer
See http://www.dynare.org/manual/index_27.html and search for
Code: Select all
bayesian_irf
. It goes into the estimation command.

Re: where are the results of "mh_conf_sig" stored

PostPosted: Thu Jan 14, 2016 2:56 pm
by fuyangzhao
jpfeifer wrote:See http://www.dynare.org/manual/index_27.html and search for
Code: Select all
bayesian_irf
. It goes into the estimation command.

I wrote the code as the following
Code: Select all
estimation(datafile=data_diff_FHFA,mode_check,mode_compute=5,lik_init=2,mh_replic=0,mh_nblocks=2,presample = 3,mh_jscale=0.20,mh_drop=0.2,mh_conf_sig = 0.68 ,optim=('Display','iter','MaxFunEvals',1500),smoother,bayesian_irf,forecast=20) DLogQl  DLogQ  DLogC DLogI DLogB LogL Ql I Br Bg C Y;

But still couldn't find oo_.PosteriorIRF.dsge... Is there anything wrong?

Re: where are the results of "mh_conf_sig" stored

PostPosted: Thu Jan 14, 2016 3:19 pm
by jpfeifer
How are you supposed to get Bayesian IRFs when you do not run a MCMC by setting
Code: Select all
mh_replic=0

Re: where are the results of "mh_conf_sig" stored

PostPosted: Fri Jan 15, 2016 1:56 am
by fuyangzhao
jpfeifer wrote:How are you supposed to get Bayesian IRFs when you do not run a MCMC by setting
Code: Select all
mh_replic=0

After deleted
Code: Select all
mh_replic
, it is reported that
[list]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 62)
[ ix2, ilogpo2, ModelName, MetropolisFolder, fblck, fline, npar, nblck, nruns, NewFile, MAX_nruns, d ] =
...

Error in dynare_estimation_1 (line 782)
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 89)
dynare_estimation_1(var_list,dname);

Error in realestate_model (line 557)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;[/
list]

Does it mean that my model is wrong?

Re: where are the results of "mh_conf_sig" stored

PostPosted: Fri Jan 15, 2016 8:29 am
by jpfeifer
It means that there is still something problematic. Please have a look at the mode_check plots (use the mode_check option). Also, increase the number of function iterations in optim or use a different mode-finder, e.g. mode_compute=9. Lastly, make sure that your observation equations are correct, i.e. that the data and the model variables are correctly linked.

Re: where are the results of "mh_conf_sig" stored

PostPosted: Sat Jan 16, 2016 2:05 pm
by fuyangzhao
jpfeifer wrote:It means that there is still something problematic. Please have a look at the mode_check plots (use the mode_check option). Also, increase the number of function iterations in optim or use a different mode-finder, e.g. mode_compute=9. Lastly, make sure that your observation equations are correct, i.e. that the data and the model variables are correctly linked.

Thanks! It helps a lot!