# Notation - Steady State - Residuals

Dear all,

I have three questions where hopefully someone has some fresh ideas. Thanks a lot! :

1. Notation: Is it a problem if exp()-notation and log-linearised notations are mixed in models?
In my model, I am not sure which initial values to choose if the variable, e.g. c, figures
both in an exp()-notation and in a log-linearised equation. (See for example (na12.mod) attached below)

2. Finding a steady state: Is it possible that exp()-notation cannot be used in an external steady state-file? When using the below steady-state-file Matlab tells me: “exp” previously appeared to be used as a function or command, conflicting with its use here as the name of a variable. A possible cause of this error is that you forgot to initialize the variable, or you have initialized it implicitly using load or eval."

How then can I use an external steady state-file if I have some equations of the model only in exp()-notation
and others (like the New Keynesian Philips Curve) only in log-linearized notation?
Log-linearizing those equations with sums (currently in exp()-notation) would result in having to specify the steady state-values for almost all the variables of my model as almost all variables appear in the two equations in exp()-notation. And using a steady_state_model-block would not solve the problem of different
notations, would it? Is there a way out or any idea what else I can do in order to find a steady state?

1. Residuals: So far, I understood that the residuals can help understand which equations might still contain an
error or a wrong starting value. Also, if the residual is big the error will be more influential than if it is
small. If my residuals are now the below (for na12.mod) how could I use this information? There
still seem to be a lot of errors but the residuals are not huge. What else can it tell me other than
“look at all the equations with residuals different from 0 again”? Would playing with initial values
and looking at how the residuals change actually be an advisable strategy?
Equation number 1 : -0.46169
Equation number 2 : 0
Equation number 3 : -0.37068
Equation number 4 : -0.74135
Equation number 5 : 0
Equation number 6 : 0
Equation number 7 : 0
Equation number 8 : 0.45
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : -0.014414
Equation number 12 : -0.38438
Equation number 13 : 0
Equation number 14 : -0.12356
Equation number 15 : 0.12356
Equation number 16 : 0
Equation number 17 : -0.11623
Equation number 18 : -0.12356
Equation number 19 : 0.092669
Equation number 20 : 0
na12.mod (2 KB)

You should first read [Non-linear vs. exp() vs. log-linearized models).

1.) You can combine linear and nonlinear equations, but you need to make sure to define the corresponding relation between the log-level of the variable and the percentage deviation from trend. The nonlinear equations contain separate variables (e.g. y) that are not percentage deviations from steady state (e.g. yhat). To link them to the percentage deviations, you need to define them as separate variabes and link them to the linearized ones by

``y_hat=log(y)-log(steady_state(y))``

For y you then need to provide steady state values.

1. The line
``exp(yf)=exp(yhstar)+exp(bstar)-exp(bstar);``

is not proper assignment in Matlab. It needs to be

``yf=log(exp(yhstar)+exp(bstar)-exp(bstar));``
1. Statements like
``exp(phstar+yhstar)``

are usually not compatible with a proper substitution. Usually you have to substitute every variable individually, i.e.

``exp(phstar)+exp(yhstar)``

What you should to is solve the model without exp-notation first. Then either do the substitution after you computed the steady state of the levels correctly so that you know the log-levels or, even better, simply define the log-levels of the variables you need as additional variables:

``log_y=log(y)``

That would be less error-prone.