# Shocks for multiple periods

I’m forecasting macro variables for several countries when we impose shocks on variables such as the unemployment rate, federal funds rate, etc. Currently, I am able to impose 1 period shocks. Example, if the equation for federal funds rate (defined by a Taylor rule) is measured in % terms as follows:

fed_funds_rate = linear combination of variables + error_ffr

Then, to impose an 80 % upward shock on the rate, I code:
var error_ffr; stderr 0.8

But this is only for one period. How can I extend it to last for more than 1 periods?

I tried

var error_ffr;
periods 1:4;
values 10;

But I don’t think this is the right way. I would also like to save these impulse responses evaluated for multiple periods for other usage in MATLAB.

Are we talking anticipated or surprise shocks in each period? See also

Thank you. That helps

By the way, if I write the standard error for two different variables, example:

var error_ffr; stderr 0.8;
var error_inflation_rate 0.7;

resid;
steady(maxit = 700, solve_algo = 1);
stoch_simul(order=1, irf = 40, graph) names_of_variables

Will the impulse response graphs measure the impact due to both the aforementioned shocks on inflation rate and the federal funds?

No, you will get two sets of IRFs, one for each shock.

Do you have an example of Dynare code to impose multiple “surprise” shocks for multiple periods?

So far, I have imposed multiple shocks on the inflation rate and federal funds rate for one period only by creating a third exogenous variable; applying a scaling factor to it, and adding it to the equations that define the inflation rate and the federal funds rate. Then, I specified the variance of this third exogenous variable. The output is the impulse response for 2 simultaneous shocks imposed in one period.

I also explored the following which is mentioned in page 32 of the Dynare manual
var residual_inflation
periods 1:8
values 3

var residual_ffr
periods 1:8
values 5

resid;
steady;
stoch_simul(order = 1, irf = 30, graph)ffr inflation_rate output_gap

However, this doesn’t generate the IRFs. Why does it not produce the IRFs? I know you mentioned that simult_function can generate IRFs for anticipated shocks, but I wonder if we can modify the above snippet of code I just mentioned so that it also produces the desired IRFs ?

Your syntax above is for perfect foresight simulations, but you are doing stochastic simulations. You need to use the `simult_`-function as in the linked example.