Page 1 of 1
Simulation after estimation
Posted:
Tue Jun 22, 2010 11:43 am
by George
Dear all,
After estimating a DSGE model and obtaining the posterior mean of the parameters'' distribution I wish to simulate the model at this posterior mean. Is it possible to instruct Dynare to directly run the simulation at the posterior mean (e.g. by using stoch_simul) automatically after the estimation? Or does one necessarily have to write e separate simulation file where one need to manually input the posteror mean parameter estimates?
Thanks in advance for any feedback!
George
Re: Simulation after estimation
Posted:
Tue Jun 22, 2010 12:14 pm
by jpfeifer
Dear George,
usually it is possible to proceed this way. The manual explicitely states:
After running estimation, the parameters and the variance matrix of the shocks are set to the mode for maximum likelihood
estimation or posterior mode computation without Metropolis iterations.
Hence, running stoch_simul after estimation does the simulation at the posterior mode.
However, note that some interesting features like IRFs are some moments can also be computed from the estimation command by using bayesian_irf and moments_varendo.
Re: Simulation after estimation
Posted:
Tue Jun 22, 2010 12:29 pm
by George
Thank you so much for this answer. So does this mean that I can declare my "stoch_simul" command immediately after my "estimation" command?
And is it possible to run the simulation in this way using the posterior mean after Metropolis rather than at the posterior mode after the optimization stage?
Re: Simulation after estimation
Posted:
Sun Aug 29, 2010 6:11 pm
by htastan
Just a followup question on this.
Are the following commands equivalent?
(1)
estimation(datafile=trdatam,mode_check,mh_replic=500000,mode_compute=6);
stoch_simul gy_obs gc_obs gi_obs tby_obs;
(2)
estimation(datafile=trdatam,mode_check,mh_replic=500000,mode_compute=6,moments_varendo) gy_obs gc_obs gi_obs tby_obs;
Thanks in advance
Re: Simulation after estimation
Posted:
Mon Aug 30, 2010 6:44 am
by jpfeifer
According to the new manual, the parameters are set to posterior mean after Metropolis-Hastings. Hence, both commands are almost the same. The difference is the Bayesian approach in estimation. moments_varendo should for example give you the "Mean of the posterior distribution" for the moments. stoch_simul will give you the moments at the mean of the posterior distribution of parameters.
Re: Simulation after estimation
Posted:
Wed Sep 07, 2011 12:44 am
by bigbigben
What if the posterior mean is different from the posterior mode? Does it indicate a problem or we should just pick whatever we like?
Re: Simulation after estimation
Posted:
Wed Sep 07, 2011 10:17 am
by bigbigben
A followup question is if there is a variable in the outcome file containing the name of list of estimated parameters. I want to find a more efficient way to do simulation with estimated parameters. Manual copy and paste is too time-consuming. However, I can only find a list of all parameter names in M_.param_names, but no such thing for estimated parameter names.
Re: Simulation after estimation
Posted:
Wed Sep 07, 2011 12:41 pm
by jpfeifer
No, this is not a problem per se, it only indicates that the posterior distribution is somewhat irregular, see
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=3343.
Regarding the follow-up, the names of the estimated parameters are stored in the workspace structure "bayestopt_" in the filed "name".
Re: Simulation after estimation
Posted:
Tue Aug 04, 2015 10:44 am
by dominik
Hi
i think i might have found an inconsistency in dynare.
The manual says:
"After running estimation, the parameters M_.params and the variance matrix M_.Sigma_e of the shocks are set to the mode for maximum likelihood estimation or posterior mode computation without Metropolis iterations.
After estimation with Metropolis iterations (option mh_replic > 0 or option load_mh_file set) the parameters M_.params and the variance matrix M_.Sigma_e of the shocks are set to the posterior mean."
Runing the following estimation
estimation(datafile=DataUSobstot,first_obs=100, mode_compute = 0, mode_file=SW_tot_do12_8308_mode,mh_jscale=0.3,mh_replic =2000,moments_varendo,plot_priors=0) dYobs dCobs dIobs Lobs dWobs PIEobs Robs q;
i find that the parameters are set to their posterior means only as the variable that are directly on the workspace, (e.g the variable 'alpha' thats saved directly on the workspace )
yet in M_.params the values are those of the posterior mode from the first stage of the estimation routine.
so there seems to be an inconsistency between the 2 sets of parameter values stored in different places. I dont know if this is general or specific to my code though.
Best Dominik
Re: Simulation after estimation
Posted:
Wed Aug 05, 2015 6:13 am
by jpfeifer
Hi,
that is a known bug of Dynare that should be fixed in the unstable version.