# IRFs for a sequence of unanticipated shocks

Hi,

In this paper of Jakab & kumhof, they state “Figure 5 shows impulse responses for a sequence of unanticipated shocks whereby, over a period of six quarters, the standard deviation of borrower riskiness drops by around 30%.”

As they say “impulse responses” they most probably mean they are performing a stochastic simulation. If I am right, how is it possible to implement a stochastic simulation for “a sequence of unanticipated shocks” in dynare? Based on my limited understanding of dynare, in stochastic simulations only the first period of the shock’s occurrence is unanticipated. I know I will probably be directed to the simult_ related posts but I dont understand what differenciates the code between a shock that is unexpected in period 1 & expected from periods 2 to 6 and a shock that is unexpected throughout periods 1 to 6 in the simult_ form. I would appreciate any help on how to replicate such a shock.

As soon as you are dealing with stochastic simulations, all shocks are unanticipated at all periods (unless you specify them as news shocks, i.e. as moving average processes). Anticipation would be modeled in a perfect foresight context.

Thank you for your response. I searched more around this topic and reached the conclusion below. Please correct me if I am wrong in any of them.
If the shock is defined as \epsilon then for stochastic simulation and/or simult_:

1. If the shock is included in Dynare as +\epsilon then it occurs in period 1 and is unexpected (it can reverberate in the following periods if the shock process is for example in AR(1) form but the discounted remnant of the initially unexpected shock is expected from periods 2 to \infty).

2. If the shock is included in Dynare as +\epsilon(-1) then it occurs in period 2 and is expected (it can reverberate in the following periods if the shock process is for example in AR(1) form and the discounted remnant of the initially expected shock is still expected from periods 3 to \infty).

3. In order to have an unexpected shock throughout period 1:4 in simult_, we have +\epsilon in Dynare and set:

shock_matrix(1,strmatch(‘eps’,M_.exo_names,‘exact’)) = 1;
shock_matrix(2,strmatch(‘eps’,M_.exo_names,‘exact’)) = 1;
shock_matrix(3,strmatch(‘eps’,M_.exo_names,‘exact’)) = 1;
shock_matrix(4,strmatch(‘eps’,M_.exo_names,‘exact’)) = 1;

1. In order to have an unexpected shock in period 1 and expected throughout period 2:4 in simult_, we change +\epsilon to +\epsilon_1+\epsilon_2(-1)+\epsilon_3(-2)+\epsilon_4(-3) in Dynare and set:

shock_matrix(1,strmatch(‘eps1’,M_.exo_names,‘exact’)) = 1;
shock_matrix(1,strmatch(‘eps2’,M_.exo_names,‘exact’)) = 1;
shock_matrix(1,strmatch(‘eps3’,M_.exo_names,‘exact’)) = 1;
shock_matrix(1,strmatch(‘eps4’,M_.exo_names,‘exact’)) = 1;

• We can also use a single shock \epsilon in item #4 and repeat it with different lags instead of defining different shocks, if the value of the shock remains the same.
• What was explained for the AR(1) process shock in items #1 and #2 are also naturally held for items #3 and #4.

Most of what I said is based on this post, if I understood it right.

That is correct, except for the single shock part of item 4.