Solving models containing leading variables with and without expectations

Dear all,

I’m having difficulty understanding what Dynare does to solve models in a specific case. I’ve read Villemot’s note about what Dynare does, especially equations 7 and 8, but I confess I couldn’t understand it. In particular, how does Dynare arrange a system of leading variables (i.e. expressed in t+1) both with and without the expectation operator? For example, in a simple three-equation new-keynesian model, the GDP variable appears with a lead in expectation E_t(y_{t+1}) in the IS and Phillips equations and without the expectation y_{t+1} in the Taylor Rule. The same applies to inflation.

I presume I have to add auxiliary variables but I don’t know what the corresponding auxiliary equations would be. In my attempts I stumbled upon non-invertible matrices, all-zero columns, etc. Could anyone explain this in more detail? I’d be happy to share the model with you to explain the problem.

Thank you very much for your help.

I don’t understand the question. In the Taylor rule, you do not have y(+1), just y

Hi Johannes,

Thank you for your prompt reply. What I meant was that, in the Taylor Rule, the interest rate depends on the contemporaneous GDP and inflation gaps:
i_{t+1}=\rho i_t+ (1-\rho)(\gamma_y y_{t+1}+\gamma_{\pi}\pi_{t+1})+shock.

In this case, how does Dynare arrange variables and equations to obtain the system (to be solved) in the typical format:

A[x^p_{t+1}, E_t[x^j_{t+1}]]' = B[x^p_t,x^j_t]'+shocks

where superscripts p and j are pre-determined variables and non-pre-determined variables, respectively?

I appreciate your attention.


You seem to have the AB-form as in Blanchard-Kahn in mind. You need to shift your Taylor rule by one period to the back. Then you will see that i_{t-1} shows up, which is a predetermined variable. To stay in the AB form, you need to introduce an auxiliary variable that captures the lagged interest rate and an equation linking i_t to the future value of the lagged interest rate/your auxiliary variable.

Hi Johannes,

Thank you for your reply. Indeed, shifting the Taylor Rule one period back and replacing i_t with r_{t+1} is what I did to solve a model with the Blanchard-Kahn method. It is good to find out that Dynare does that too so I’m in the right track. Does Villemot’s paper say that Dynare shifts equations in cases like this? (the paper’s notation is too difficult to find that out).
The reason why I ask what Dynare does is that Dynare’s output is different from the output I reach by solving by hand my own model (with a colleague in Brazil). While Dynare’s and our IRFs are the same, Dynare presents one more eigenvalue than our solution requires. In Dynare’s output, both forward-looking variables E_t[y_{t+1}] and E_t[\pie_{t+1}] are reported as if they were pre-determined (in the state variables’ vector in the Decision Rule). We can understand it for inflation (the Phillips curve has a lagged term) but we can’t understand how GDP would appear as pre-determined in Dynare’s output. What would be the auxiliary variable and equation? Could you give us a hand? The .mod file is attached.


CM.mod (1.6 KB)

Your fourth equation contains


Clearly y(-1) is a predetermined variable.

Hi Johannes,

In that case, I’m afraid that it is unclear to me how to enter equations in Dynare. There is a y(-1) because the fourth equation was shifted back so that variable c (credit) appears contemporaneously and with a lag, c and c(-1). What would be the correct way to enter the fourth equation given that c is predetermined and y forward-looking? The fourth equation in the original model is:


Thank you

That cannot be the right timing. Everything dated (+1) can only be expected or predetermined.

Thank you,

I believe that I am still missing something . What would be the problem with the equation in my previous post? In practice, how should I write it in Dynare, given that y is forward-looking (there is an E_t[y_{t+1}] in another equation)?

The problem in your previous equation is that you have c_{t+1}, i.e. consumption at time t+1 instead of only the expectations of consumption E_t(c_{t+1}). For that lead, you would need an auxiliary variable as well if that is the correct timing.
Having y_t and E_t(y_{t+1}) is not a problem. It is a forward-looking variable. However, if you also have y_{t-1}, you again need an auxiliary variable to capture the lag.

Hi Johannes,

The variable c in our model is credit, not consumption. Credit is predetermined and depends on past GDP and interest rate:

I understand that this equation must be shifted back in Dynare. The problem arises because GDP is forward-looking:

How can I enter such equations on Dynare? I understand that inserting the auxiliary variable y_aux(+1) = y, as you suggest, would violate the rank condition. It is a very simple model, it shouldn’t be difficult to enter. Nonetheless, the instructions seem to be unclear about how to enter the equations in simple cases like this. What auxiliary variables do I have to create by hand and what variables are automatically created by Dynare?


You need to get the timing convention straight. c_{t+1} is not predetermined as it is in the future. It would make sense to state that c_{t} is predetermined in an equation
But even in this case, you would not enter the equation with that timing. The correct way in Dynare would be
This is similar to how you would enter a low of motion for capital. Capital at the end of the period is determined by investment in that period. Similarly, credit at the end of the period is determined by output and the interest rate in that period.

Note also that do not need to introduce auxiliary variables in Dynare. The program will create them if necessary if you entered the equations with the proper timing.

Hi Johannes,

What we are trying to figure out is how to enter Dynare equations where a purely pre-determined variable (credit c_t in our model) depends on a purely forward-looking variable (GDP y_t in our model) but with a lag. Consider our model’s credit equation (in deviation from SS):

c_{t+1}=\eta c_t + \lambda y_t + etc

I don’t think it’d be correct to enter this equation with this timing in Dynare because credit is not forward-looking. It would also be a mistake to shift the equation back as GDP is not pre-determined (and, for other reasons, we can’t have GDP in the right hand side of the decision rule). So, how should I enter this equation in Dynare? Is this something you have seen before?

Thank you

This is exactly like a law of motion for capital:
k_{t+1}=i_t +(1-\delta)k_t
Here, predetermined capital depends on the forward-looking investment. The correct way to enter this equation is


i.e. only the predetermined variable gets shifted. Alternatively, use

predetermined_variables k;

to the same effect.

Thank you very much, Johannes.

Your help is much appreciated. I believe that this solves the problem. The key issue was that my co-author and I were not aware of the command predetermined_variables.

Kind regards,