Page 1 of 1

Problems with nonlinear model

PostPosted: Sat Nov 19, 2011 4:02 pm
by teofala
Dear all,

I'm currently learning how to use Dynare, and I tried to build and run a very simple model (simpliefied version of Kim, 2000). I log-linearized the model by hands and I run it in dynare (with the linear command), obatining very good results, IRF, etc. However, I wanted then to put directly the non-linearized version of the model in dynare, and I got very strange results, in terms of IRF. For example:

1. Capital starts growing at time t and not t+1, and its response is too high.
2. Output responds positively to a contractionary monetary shock.

As a results all the other variables (y, c,...) react quite differently with respect to the log-linearized model. I check the equations many times, especially the timing of capital, but I cannot find any typos. I attach the mod file. Could you please help me? Thanks a lot!

Teodoro

Re: Problems with nonlinear model

PostPosted: Sat Nov 19, 2011 6:06 pm
by jpfeifer
Have you performed a variable substitution to assure that Dynare does a log-linearization instead of a linearization (i.e. put everything in exp()). If not, this might explain a different size of the IRFs (althoug the general shape and sign should be the same). Moreover, capital at t+1 is entered as k into Dynare due to the timing convention. Hence, if k moves at time t it means this is the value for k at t+1.
However, if the signs are wrong, there must be something else. If the steady states of both models are identical (use the steady; command to display them), there is an issue with the timing. However, this must also be identical in both models and should be easy to check.

Re: Problems with nonlinear model

PostPosted: Sat Nov 19, 2011 11:38 pm
by teofala
thanks for your reply. I express all the variables in exp() and all the initval in log(). Is this the correct procedure? Something changes, but not the capital that is still moving at time t. It seems to me impossible, since I think I use the correct timing notation for k.
A second question: doing this transformation, I still would have the moments of the variables in %age (as in the log-linearized case)? Because, I would like to get the moments of the variables in levels. Thanks for the help.

Teodoro

Re: Problems with nonlinear model

PostPosted: Sun Nov 20, 2011 10:40 am
by jpfeifer
Hi,
1. No, if you put everything in logs, you will get the moments for the data in percentage deviations. However, a simple application of the delta method shows that they are the same up to first order (multiplied with the steady state value). So if you go to first order, there is no need to distinguish linearization and log-linearization.
2. As I explained, if you get the timing in Dynare correct, the displayed change in k at time t in the IRFs means that the value of capital chosen today that becomes productive tomorrow, i.e. K_t+1 in typical article notation, changes. Hence, changes in k_t in Dynare IRFs reflect investment made at time t. This can be seen from Dynare's notation of the law of motion for capital:
k=(1-delta)*k(-1)+i;

Re: Problems with nonlinear model

PostPosted: Sun Nov 20, 2011 10:53 am
by teofala
So, if I understood correctly, if I want the moments of the levels, I just need to run the model in nonlinear form (like that I posted) withouth exp()? Is this the case?

Concerning capital timing, capital was in any case still moving on impact. I tried different expression, and I found that, surprisingly, this works:

exp(k)=exp(i(-2))+(1-delta)*exp(k(-1));

Using this equation, capital begins to move in period t+1. Is anyone able to explain this fact?


Thank you!

Teodoro

Re: Problems with nonlinear model

PostPosted: Sun Nov 20, 2011 12:54 pm
by jpfeifer
Up to first order, the moments of the linearized variables correspond to the ones of the log-linearized variables, scaled with the steady state values.

Capital in Dynare has to move at time t ! Please read carefully what I wrote. What is displayed as capital at time t is next period's (!!!!) capital stock. Look at my equation in the last post. k is influenced by i. So if investment moves at time t, so does capital. This is correct, becaues not k enters the current production function but k(-1), which does not move!
Your version that supposedly works now introduces two quarters time to build, which is wrong.

Re: Problems with nonlinear model

PostPosted: Mon Nov 21, 2011 9:35 am
by teofala
Thank you for your help, jpfeifer. Now I understand.