Uncond. second moments-actual data vs. estimated DSGE model

Dear all,

after the estimation of a DSGE model researchers usually compare unconditional second moments in the estimated DSGE model with those based on the actual data. Here is an example how unconditional second moments can be computed for the estimated DSGE model (this example is based on ALLV paper: Bayesian Estimation of an Open Economy DSGE Model with Incomplete Pass-Through):

For the model, we report the median from the simulated distribution of moments, computed from the 12,204
samples of length 92 periods each, which were generated by simulating the DSGE model using parameters bootstrapped
off the posterior distribution.

Does anyone know how to implement this in Dynare?

Best,

At the current stage, this is a bit complicated. Proposed functionality for this can be found at github.com/DynareTeam/dynare/pull/871

Dear jpfeifer,

thank you for your answer. Is there any other (simplest) way to do this exercise in Dynare - to compare moments of data generated by the estimated DSGE model with those based on the actual data? What do you suggest?

Maybe the use of get_simul_replications.m (from your personal web page) together with the command stoch_simul after the estimation of a DSGE model?

Best regards,

If you are a bit more flexible, you can immediately compare the theoretical moments of the model with the ones of the data. An example is the GarciaCiccoetal2010.mod on my homepage. But this implies that you use first differences as the filter.

If I understand you correctly, you simply compare the theoretical moments that are calculated after using the command stoch_simul?

Not exactly. The theoretical moments come from the estimation routine using the moments_varendo, not from stoch_simul.

Dear Mr jpfeifer,

thank you very much for your help. As you suggested I additionally included the command moments_varendo in the estimation command. But in this case the estimation does not finish. It ends up with Bayesian irf-s, but Dynare does not execute, for example, smoother, filtered_vars, shock_decomposition (graphs for these things are missing). In the end there is also no estimation time displayed.

I use the following:
estimation(datafile=MyData, presample = 0, prefilter = 0, mh_replic = 200000, mode_compute=6,
mh_nblocks = 2, mh_jscale = 0.25, filtered_vars, smoother, moments_varendo, bayesian_irf, graph_format = (fig,pdf));

shock_decomposition pi_data dy_data di_data dc_data;

My version of Dynare is 4.4.3.

Do you have any suggestion what’s going wrong?

Thank you.

You most probably did not wait until the computations were finished. Computing endogenous moments can take quite long.

I finally got the results!

Results are stored in oo_.PosteriorTheoreticalMoments which is of the following structure:
-covariance
-correlation
-VarianceDecomposition
*Mean
*Median
*Variance
*HPDinf
*HPDsup
*deciles
*density
-ConditionalVarianceDecomposition
*Steps
*Mean
*Median
*Variance
*HPDinf
*HPDsup
*deciles
*density

My question is: where exactly are the unconditional second moments of endogenous variables stored?

Best,

In the covariance field of course.