# Mix of equations in levels and log linearized form

Hi,

In my dynare code, all equations are in levels. However one equation is an infinite sum which I had to be written in log-linearized form recursively. I entered that equation in the following way for the variable say z , ln(z/zbar)=A*ln(z+1/zbar)+ ln (X/Xbar) where, A is a parameter and zbar and Xbar are steady state values for the variables z and X which I calculated by solving the model. Is this approach correct? Or do I need to log-linearize every equation in the model to make it consistent?

Thank You!

As far as I know, you must either work with all equations log-linearized or with them all in levels (so you must linearize the rest of your model or write this infinite sum in its level).

No, you can combine linearized and nonlinear equations provided that i) you only use a first order approximation and ii) correctly link the levels and percentage deviations. If z is the level of a variable, then

``````zhat=log(z)-log(steady_state(z))
``````
1 Like

Dear all,
I’m merging two models. One in level and one that is already log-linearized. To save effort, I tried to declare both model and model (linear) in the same .mod file. What I mean to say:

model;
… level equations…
end;
model (linear);
… log-linearized equations…
end;

It didn’t work, however, I believe that this possibility could help several members of the community and I think that it is something relatively simple to implement in a new version of Dynare. I would like to leave this suggestion.

You can concatenate model equations. But as the final model will be nonlinear, the `linear` keyword is not helpful. Also, how would Dynare automatically link the equations in your model? I think that this is a rather special use case.