Page 1 of 1

log-linearization

PostPosted: Mon Feb 21, 2011 5:00 pm
by John123
Hi all,

i want to log-linearize a model by Dynare. I calculated the steady state values by hand and wrote the model in terms of exp(log(variable)). Running the file generates always an error.
It would be great if you could help me. thank you

Re: log-linearization

PostPosted: Mon Feb 21, 2011 6:07 pm
by jpfeifer
When you put
Code: Select all
resid(1);

after your initval-command, Dynare shows you the residuals:
Residuals of the static equations:
Equation number 1 : 0
Equation number 2 : -3.3333
Equation number 3 : 3.4997
Equation number 4 : -0.01
Equation number 5 : -0.21583
Equation number 6 : -1
Equation number 7 : 1
Equation number 8 : -0.442
Equation number 9 : -2
Equation number 10 : -1.2867
Equation number 11 : 0.1
Equation number 12 : 0.5

Hence, your steady state is incorrect. The reason may be your try to get a loglinearization. Do not put variables as exp(log(x)). Rather, you have to use exp(x) because if in your original model you used x_orig and now you use exp(x), it means that you performed a variable substitution: x=log(x_orig).
But when you use exp(log(x)), exp and log cancel and you are back to x=x_orig. Note also that if a variable is already in logs in the original model (for example if you have shocks that are defined as percentage deviations from steady state), you do not replace them by their logs through putting exp() as you would then get log(log(x)).

Re: log-linearization

PostPosted: Tue Feb 22, 2011 7:48 am
by John123
Thank you for your hints! I changed the model, as you told me. I also tried writing the error terms not in exp()-form.But i still get an error message, that the steady state values are wrong. i can't understand that, because i calculated them by hand and the model is very easy. Do you have any idea, where there problem might be?

Re: log-linearization

PostPosted: Tue Feb 22, 2011 7:57 am
by jpfeifer
Could you post the new mod-file? And did you consider that the steady state value of a variable transformed to be in logs has to be the log of the steady state value of the original variable? Moreover, by using the resid(1) command you can look at the residuals of the equations in order to get the steady state one by one. Try starting with the equations for the exogenous processes and work from there to the more complicated ones.