Page 1 of 1

How are "moments of simulated variables" computed in Dynare

PostPosted: Mon Oct 12, 2015 9:05 pm
by xh@econ
Dear all,

I'm trying to understand the "moments of simulated variables" reported by Dynare. But I have some questions about how these moments are calculated.

I use the following code to simulate the model:
stoch_simul(order=3,irf=60,pruning,periods=200,hp_filter=1600) K C I;

Then I use the simulated series stored in the file "oo_.endo_simul" to work out the moments. However, they are quite different from the reported moments in the output window.

For example, I take the simulated series of C as
sim_C = oo_.endo_simul(declare_order_C,:);
Then I compute mean(sim_C), which is slightly different from the mean reported. But the std(sim_C), skewness(sim_C) and kurtosis(sim_C) are at odds with those reported by Dynare.

I cannot figure out where the problem is. Can anyone give me some help? I really appreciate it.

Re: How are "moments of simulated variables" computed in Dyn

PostPosted: Tue Oct 13, 2015 8:25 am
by jpfeifer
Dynare provides moments of the filtered variables (hp_filter=1600) in your case. However, the simulated variables in the workspace are the unfiltered ones. To compare them to the reported filtered moments, you would have to filter them.