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?

Dear George,
usually it is possible to proceed this way. The manual explicitely states:

[quote]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.
[/quote]

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.

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?

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;

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.

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.

No, this is not a problem per se, it only indicates that the posterior distribution is somewhat irregular, see [Should we use posterior mean or posterior mode).
Regarding the follow-up, the names of the estimated parameters are stored in the workspace structure “bayestopt_” in the filed “name”.

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

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