Stochastic simulations with lagged shocks

Dear Professor,

I have a simple AR type model were I introduce a contemporary and a lagged shock.
This is just one equation model: 0.9*a = 0.2*a(-1) + 0.1*a(+1) + 0.3*e - 0.4*e(-1)
Dynare internally produces two equations where the second equation relates exogenous shocks with lags.
The equations matrix is:

jacobia =

    0.4      -0.2         0        0.9     -0.1     -0.3
      0        0          1        0          0        -1

I guess the unknowns are [e1, a(-1), . ,a ,a(+1), e2; 0, 0, e1(+1), 0, e2].

Here e1 = e(-1), e2 = e and jacobia is a Jacobian matrix passed to “dyn_first_order_solver.m” function.

Why an additional equation for shocks e1,e2 is introduced? Obviously, e1(+1) = e = e2.
Is this setting equivalent to a shock of 0.3 at period 1 and -0.4 at period 2?

When I run simulations without this additional equation by LBJ method (perfect foresight),
I am getting different results than when assuming this identity equation.

The lagged (A), contemporaneous(B) and lead (C) matrices are:
A =
0.4 -0.2
0 0

B =
0 0.9
1 0

C =

The corresponding variables are: [e1,a(-1)]; [e2,a], and [e1(+1),a(+1)].

Should matrices B, C read?
B =
-0.3 0.9
1 0

C =
0 -0.1
-1 0

Thank you,

var a;
varexo e;

0.9*a = 0.2*a(-1) + 0.1*a(+1) + 0.3*e - 0.4*e(-1);

var e;
stderr 1;


I am not sure I understand the question. Dynare will introduce auxiliary variables and equations to transform the problem into one where only contemporaneous endogenous variables appear and where you only have 1 lead or lag for the endogenous. In your case, the equation system is:
0.9\, {a}_{t}=0.2\, {a}_{t-1}+0.1\, {a}_{t+1}+0.3\, {e}_{t}-0.4\, {AUX\_EXO\_LAG\_1\_0}_{t-1}\\ {AUX\_EXO\_LAG\_1\_0}_{t}={e}_{t}

Thank you, Professor Pfeifer.

My question is related to addition of extra equation(s) for exogenous variable(s).
For example, if lag of shock e is 1, then Dynare generates 2x6 Jacobian, if 2 - 3x8 Jacobian, etc…

I understand that Dynare adds additional equation for lead endogenous variable(s) (a(+1)).
For example, matrices D and E in the dyn_first_order_solver are:
D =
0 0 -0.1
1. 0 0
0 1. 0
E =
-0.4 0.2 -0.9
0 0 0
0 0 1.
I think this is what Villemot in his paper was saying…

Is this extra equation for exogenous shock necessary?


Thank you, Prof. Pfeifer

My understanding is that by introducing endogenous variable AUX_EZXO_LAG_1 you make shock at period 2 to be anticipated. What would happen if an agent at period 1 is not anticipated future shocks at periods 2 onward?


No, that shock is not anticipated. Dynare creates an endogenous variable that stores the value of the exogenous variable. That endogenous variable then enters with a one period lag in the main equation. That way, the resulting system only contains contemporaneous shocks.

Thank you, Professor Pfeiffer.

If shock at period 2 we’re not anticipated, then solution at period one would be the same if you had lagged shocks or not. By introducing endogenous variables for lagged exogenous shocks Dynare makes future shocks anticipated. Unanticipated shocks would be if this problem with lagged shocks were simulated without introducing these endogenous variables assuming shocks happen at period 1 and 2.

How can I run stochastic simulations with lagged and not anticipated shocks?


I don’t get what you are saying. Dynare’s transformation is fully equivalent to the original model. It does not change the information set. The fact that you used e(-1) in the original model indicates that the shock was already known one period earlier.

Dear Professor Pfeifer

The Dynare solution satisfies original equation up to 14 digits.

What I was trying to say is that you may have a scenario with both anticipated and not anticipated shocks. For example, agent may his view on variable a to be 1% at period 2. Then you would have to
find a shock value that satisfy this path of endogenous variable. I think this would be not possible under the current settings.


You still did not specify what exactly you are trying to do. It sounds like you want to do something like