Using same sequence of shocks in two models

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Using same sequence of shocks in two models

Postby kipfilet » Thu Nov 14, 2013 4:24 pm

Hi,

I have a very basic question that I am sure could be readily answered by a Dynare specialist. I went through the documentation but did not find anything enlightening on this issue.

I have two mod files to simulate similar, but different, models. I would like to simulate one model, and then apply the exact same sequence of shocks to the second one so as to compare the responses of the endogenous variables. Anyone knows a fast way to input the oo_.exo_simul sequence in the second model? Thanks a lot in advance!
kipfilet
 
Posts: 27
Joined: Thu Oct 04, 2012 5:24 am

Re: Using same sequence of shocks in two models

Postby kipfilet » Thu Nov 14, 2013 5:36 pm

I just noticed that stoch_simul seems to use a fixed seed, so my problem is fixed. Thanks.
kipfilet
 
Posts: 27
Joined: Thu Oct 04, 2012 5:24 am

Re: Using same sequence of shocks in two models

Postby StephaneAdjemian » Thu Nov 28, 2013 9:24 am

Hi,

Yes the seed of the random generators is fixed but it may be risky to rely on this and it's not really general. For instance, you could not handle a case where in the second model you have an additional shock and/or a case where the number of periods is greater in the second model. Also if in the second mod file you call a routine/command that generates random numbers (that's not always transparent) before the call to stoch_simul you won't get the same numbers for the shocks. I think that the safest (and more general) approach is two write both models in the same model block. This is what we do when we simulate models with efficient and non efficient variables (to compute an output gap for instance).

Best,
Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Using same sequence of shocks in two models

Postby kipfilet » Wed Dec 04, 2013 8:25 pm

Thanks for the tip, didn't know you could do that. Much obliged!
kipfilet
 
Posts: 27
Joined: Thu Oct 04, 2012 5:24 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests