# Stochastic shocks

Hello everybody,

I am trying to see the reaction of an economy to multiple shocks, but I need those shocks to be simultaneous. Can this be done in Dynare with the command stoch_simul? Also, can I have shocks that last for more than one period? (I know how to do this with deterministic shocks, but I want to avoid using deterministic shocks).

Thank you,
Alexandra

Dear Alexandra,

A shock will last more than one period if he goes through an autoregressive process. For instance If productivity is an AR(1) process then the time t innovation to productivity will affect the economy at periods t, t+1, t+2, t+3,… I am not sure to understand your problem with stoch_simul. Do you want to compute IRFs with simultaneous shocks ?

Best,
Stéphane.

Hi!

Thank you for your answer. Here are some details about what I’m trying to code in Dynare: I have a variable - b - that needs to follow an autoregressive process for only 3 periods, and afterwards it should be zero. For this I’ve introduced a dummy variable - d - (an exogenous variable) that takes the value 1 in the first 3 periods, and 0 afterwards, such that my equation looks like this in Dynare: b=drhob(-1)+e_b, where e_b is the initial shock and rho the autoregressiv parameter. With deterministic shocks, I have the following code:

shocks;
var e_b; periods 1; values 0.01;
var d; periods 1:3; values 1;
end;
simul(periods=20);

Can I do the same thing using stochastic shocs (stoch_simul)? That is, obtain an unique set of IRFs in response of these two simultaneous shocks (e_b and d). Also, the variable d needs to be 1 at all times during 3 periods and not follow an autoregressive process.

Thank you,
Alexandra

Hi,

[quote=“ale”]Hi!

Thank you for your answer. Here are some details about what I’m trying to code in Dynare: I have a variable - b - that needs to follow an autoregressive process for only 3 periods, and afterwards it should be zero. For this I’ve introduced a dummy variable - d - (an exogenous variable) that takes the value 1 in the first 3 periods, and 0 afterwards, such that my equation looks like this in Dynare: b=drhob(-1)+e_b, where e_b is the initial shock and rho the autoregressiv parameter. With deterministic shocks, I have the following code:

shocks;
var e_b; periods 1; values 0.01;
var d; periods 1:3; values 1;
end;
simul(periods=20);

Can I do the same thing using stochastic shocs (stoch_simul)?

[/quote]

No. This trick only works with the deterministic solver.

[quote=“ale”]
That is, obtain an unique set of IRFs in response of these two simultaneous shocks (e_b and d). Also, the variable d needs to be 1 at all times during 3 periods and not follow an autoregressive process.

Thank you,
Alexandra[/quote]

Why don’t you consider MA shocks instead ? If you want shocks lasting for a finite number of periods this should be more appropriate.

Best,
Stéphane.

Hi Stephane,

Thank you for taking the time to answer! I’m not sure I understand correctly the use of MA shocks. Using MA shocks would solve only one of my problems (I would have a shock that lasts for more than one period), but I don’t see how this can help me with simultaneous shocks. I would still be obliged to use deterministic shocks, no? as I still need the two simultaneous shocks - e_b and d. (my equation would be: b=(d+d(-1)+d(-2))rhob+e_b, with two initial shocks: a unitary shock on d and a shock on e_b of say 0.01).

Best regards,
Alexandra

Alexandra, If my understanding is correct you don’t need simultaneaous shocks with an MA model. With such a model the effects of the time t innovation (e_b) last for a finite number of periods (set by the number of lags in the moving average model for b). Your equation would be, for instance, b = e_b + theta_1*e_b(-1) + theta_2 * e_b(-2).

Best, Stéphane.

Yeah, but like this I lose the autoregressive part on my variable b (in my previous post it was supposed to read rho*b**(-1)** ). I am actually in a very specific configuration, for three periods b follows an autoregressive process (but in order to initialise it, I need a shock) and afterward it should be 0.

Thanks,
Alexandra

I don’t know you model… But I believe that you don’t need such a non linear model for b. Suppose b = rho*b(-1)+eb. Then you can rewrite this AR(1) as an MA(oo):

b_t = \sum_{i=0}^{\infty} \rho^i eb_{t-i}
]

At time t the effect of innovation eb_t is 1,
At time t+1 the effect of innovation eb_t is given by rho,
At time t+2 the effect of innovation eb_t is given by rho^2, …

If my understanding is correct you try to truncate this infinite sum with the second variable d. If this is what you are trying to do, the correct (and hopefully simpler) way is to use an MA model as mentionned in the previous post with theta_1 = rho and theta_2 = rho^2 (the effects of eb last for three periods in this case). Obviously here the limitation is that the number of lags is a parameter (not a variable)…

Best,
Stéphane.

Ok…so you used Wold’s decomposition. Now I get your point. Thank you for your explanations. I’ll try this and see how it works.

Best regards,
Alexandra