Simulation after estimation

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.

Simulation after estimation

Postby George » Tue Jun 22, 2010 11:43 am

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
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: Simulation after estimation

Postby jpfeifer » Tue Jun 22, 2010 12:14 pm

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.
------------
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

Re: Simulation after estimation

Postby George » Tue Jun 22, 2010 12:29 pm

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?
George
 
Posts: 25
Joined: Thu Aug 14, 2008 11:36 am

Re: Simulation after estimation

Postby htastan » Sun Aug 29, 2010 6:11 pm

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
htastan
 
Posts: 10
Joined: Wed Mar 31, 2010 12:10 pm

Re: Simulation after estimation

Postby jpfeifer » Mon Aug 30, 2010 6:44 am

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.
------------
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

Re: Simulation after estimation

Postby bigbigben » Wed Sep 07, 2011 12:44 am

What if the posterior mean is different from the posterior mode? Does it indicate a problem or we should just pick whatever we like?
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Re: Simulation after estimation

Postby bigbigben » Wed Sep 07, 2011 10:17 am

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.
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Re: Simulation after estimation

Postby jpfeifer » Wed Sep 07, 2011 12:41 pm

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".
------------
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

Re: Simulation after estimation

Postby dominik » Tue Aug 04, 2015 10:44 am

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
dominik
 
Posts: 22
Joined: Tue May 13, 2014 1:48 pm

Re: Simulation after estimation

Postby jpfeifer » Wed Aug 05, 2015 6:13 am

Hi,
that is a known bug of Dynare that should be fixed in the unstable version.
------------
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 4 guests