# Query regarding stoch_simul

Dear Prof Pfeifer,

I have the following note extracted from a paper on simulation.

" The model is solved using third-order perturbations around the stochastic steady state in Dynare++ 4.4.3.The moments are computed using a simulation of 3,000 economies at quarterly frequency for 304 quarters, from which the first 80 quarters are not considered for the calculation of the moments (“burn in-period”)."

To comply with the above specification, I have given the following command in dynare file
stoch_simul(drop=80, order=3, periods=304) ;

My question is how do I specify the the simulation of 3000 economies in the stoch_simul command.

Many Thanks
Ammu

In that case, the authors used Dynare++. You would need to use the

provided with Dynare++ and feed it 3,000 different shock sequences.

In case you are using Dynare, you can use the

See github.com/JohannesPfeifer/DSGE_mod/tree/master/Hansen_1985 for an example

Dear Prof Pfeiffer,

In the Dynare guide, Simul _replics is given as “Number of series to simulate when empirical moments are requested (i.e. periods > 0). Note that if this option is greater than 1, the additional series will not be used for computing the empirical moments but will simply be saved in binary form to the file ‘FILENAME_simul’. Default: 1.”

When I give stoch_simul(drop=80, simul_replic=3000, order=3, periods=304), the moments of the simulated variables are same as when I give stoch_simul(drop=80, order=3, periods=304) i.e. without the simul_replic.

Is it possible to get the moments which is inclusive of the 3000 economies?

Many Thanks
Ammu

The computed moments are always only based on one replication. The

replications are only stored (as documented in the manual). The linked file above shows you how to read in these simulations using the

file

Hello Prof,

If I use dynare++ and simulate using “dynare_simul”, i give the following command

% Simulate variables in 'ENDO_search.mod
Ts = 304;
shocks = zeros(1,Ts)./0;
Vdyn = dynare_simul(‘ENDO_search.mat’,shocks);

But the statement in paper gives “The moments
are computed using a simulation of 3,000 economies at quarterly frequency
for 304 quarters, from which the first 80 quarters are not considered for the
calculation of the moments (‘‘burn in-period’’).”

How do i incorporate feeding 3000 different shock sequences to the above code and how do I include the burn in period as well? I am sorry but I cannot find any examples online on this one to replicate.

Many Thanks
Ammu

You need to loop over the above commands in Matlab with different shocks in each step. The burn-in just means you drop the first 80 periods of the result. Note that you are not properly drawing random shocks in your code. You need to use `randn`