Substitution of endo lags

Dear All
when i run my code, received this error:

Substitution of endo lags >= 2: added 1 auxiliary variables and equations.
ERROR: There are 23 equations but 22 endogenous variables!

But in my model block, i have 22 equation and not 23.
anybody knows what happen?

Best Regards

As Dynare states, it substitutes one variable with a lag of (-2) with an auxiliary variable. That adds one variable and one equation. If you forget about this, you have 22 equations as you said, but you also only have 21 declared variables:

var m c r w l pi rk mc y a k i g mb dg fr oil p gro_mb pi_star nu;

many thanks for your answer
how i run this file?

Find the missing equation.


I was just trying to understand how Dynare plugs in variables from one equation to the other while solving the model as I am working to get an analytical solution on my own.

I have the following IS equation, where c, g, t, b, r, pi are endogenous variables:


I also have the following equations for t and b in the model,



The model works fine otherwise. I wanted to understand that if it is okay to plug in for t(+1) in the IS equation by taking the equation for ‘t’ one-period-ahead, even though my model originally has the equation for variable ‘t’ in period t.

Also, if I can substitute the equation for ‘t’ in the equation for b, such that these two steps could eliminate the variable ‘t’ in the model.

I was trying to derive a state-space representation analytically for a big model and this clarification would be very helfpul for that. Thank you very much!

As long as the equations are purely backward-looking, they are essentially definitions. It is safe to plug in then as you are not changing the information set.

Thank you very much for the clarification!

I have a 7-equation linear model which works fine, but when I reduce it to 5 equations using the substitutions I mentioned above, the B-K conditions are not satisfied, so I was wondering if what I’m doing is incorrect.

In that case, you must have introduced a mistake somewhere. But what is the point of reducing the number of equations?

Right, I’m checking for mistakes now, thank you very much.

The aim is to get an analytical solution for a big model, so I’m trying to reduce the number of equations to get the simplest possible state-space representation (Although 5 equations would not be very helpful for that goal).

If I can please request your help with another query:

I have the IS equation as:


And equations for t and b,



If I substitute the equation for variable ‘t’ in the equation for ‘b’ as I asked in my earlier post above, also plug-in for variable ‘t’ for period (t) as well as (t+1) in the IS equation, I can get rid of variable ‘t’ from the model completely. However, I do remain with epsT and epsT(+1) in doing that.

While I have seen this approach before, I am not sure how to make the state-state form on my own for this. Dynare is treating epsT as a forward-looking and I am not sure if I have come across exogenous variables to be forward-looking. Am I doing something incorrect by doing this?

I would really appreciate your help with this, thank you very much!

Dynare will internally introduce an auxiliary endogenous variable storing the leaded exogenous variable. That allows you to only have contemporaneous shocks in your model setup (essentially the opposite of how news shocks are introduced).

I see, thank you very much!

While writing the model/state-space form on paper myself, is it okay to then ignore these auxiliary variables -like epsT(+1)- or are they still needed for the state-space representation?

No, they are needed.

Thank you very much!