Are Dynare's stochastic shocks truely random?

Dear forum,

my simulation results make me wonder if Dynare repeats the exact same sequence of shocks in its stochastic specification.

My general task was to generate multiple simulated time series in order to extract a distribution of correlations generated by my model. However, I was surprised to receive the exact same time series in every simulaion despite using the stochastic Dynare specification.

Checking my suspicion, I also ran simulations of the Dynare example based on Jesus Fernandez-Villaverde (Basic RBC Model with Monopolistic Competion, stochastic version). The result is the same.

Is it possible that Dynare only gives one sequence of shocks i.e. shocks are not truely random but only have the property of a zero mean & given variance? Or do I have a knot in my thinking somewhere?

To see what I mean, please find the mod file to the RBC example attached. My adaptations only serve to extract the shock sequence:

  • I added another endogenous variable (“shock_history”, line 2),
  • and introduced a further equation into the model (“shock_history=e”, where e is the stochastic shock, line 24).
  • I also decreased the number of simulated periods to 300, supressed IRFs as well as all other output.
    I have not looped the simulation yet. I ran it twice “by hand” and cleared MATLAB as well as the mod’s directory between the simulations.

Thank you,
RBC_Monop_JFV.mod (916 Bytes)

In recent versions of Dynare, the random number generator seed has been fixed by default to generate results that are replicable across different runs on different computers at different times. Hence, if you want to generate several different simulation samples, you should use the set_dynare_seed-command (page 59 of the manual).

That’s it. Thanks so much.