Page 1 of 1

log-linearization

PostPosted: Wed Mar 07, 2012 12:44 pm
by dynare_user
Dear all,
I have a question about the log-linearization method. I would like to linearize the capital adjustment cost which takes the following form: (phi/2((k_t+1/k_t)-1)^2).
My question is: knowing that this form takes 0 at the steady state, is it possible to linearize it around its deterministci steady state. If yes, what is the result?

Thank you in advance.
Best regards

Re: log-linearization

PostPosted: Wed Mar 07, 2012 10:10 pm
by jpfeifer
You are not taking the log of the whole expression, but of k. k is not 0 in steady state. Hence, there is not a problem. If you want to see how the result looks, take a multivariate first order Taylor approximation in k and k(+1) of the expression where you substituted exp(k) for k (and similarly for k(+1)).

Re: log-linearization

PostPosted: Thu Mar 08, 2012 8:23 am
by dynare_user
Thank you very much jpfeifer
Best.

Re: log-linearization

PostPosted: Sun Dec 07, 2014 6:51 am
by missredridinghood
jpfeifer wrote:You are not taking the log of the whole expression, but of k. k is not 0 in steady state. Hence, there is not a problem. If you want to see how the result looks, take a multivariate first order Taylor approximation in k and k(+1) of the expression where you substituted exp(k) for k (and similarly for k(+1)).


Hello,

I tried this method and got the following (assuming the math is correct):

phi((k_ss/k_ss)-1) (log(k_t+1) - log(k_ss)) - phi((k_ss/k_ss)-1) (log(k_t+1) - log(k_ss)) = 0

If it was the actual taylor approximation then the equation would be log(phi/2((k_ss/k_ss)-1)^2) + (1/(phi/2((k_ss/k_ss)-1)^2))*phi((k_ss/k_ss)-1) (log(k_t+1) - log(k_ss)) - phi((k_ss/k_ss)-1) (log(k_t+1) - log(k_ss))

That equation above cannot be defined.

How can we handle this in log-linearization in Dynare or by hand, especially when you may have a budget constraint line of, for example,

y = c + i + phi/2((k_t+1/k_t)-1)^2

as part of your model.

Furthermore, suppose your adjustment cost is instead phi/2((i_t/k_t))^2, which would equal 0 in steady state. How can we handle this log-linearization?

Although I read your manual on log-linearization, can you please provide clarification?

Thanks.

Re: log-linearization

PostPosted: Sun Dec 07, 2014 7:29 am
by jpfeifer
Define marginal utility as uc and use
Code: Select all
predetermined_variables k;

to change Dynare's timing to beginning of period stock notation. With Hayashi capital adjustment costs, the first order condition will be:
Code: Select all
uc*(1+phi*(k(+1)/k-1))=beta*uc(+1)*(1-delta+(1-alpha)*y(+1)/k(+1)-phi/2*(2*(k(+2)/k(+1)-1)*(-1)*k(+2)/k(+1)+(k(+2)/k(+1)-1)^2));

Now to let Dynare perform a log-linearization, express everything as exp(log(k)) and redefine k=log(k) to get:
Code: Select all
uc*(1+phi*(exp(k(+1))/exp(k)-1))=beta*uc(+1)*(1-delta+(1-alpha)*y(+1)/exp(k(+1))-phi/2*(2*(exp(k(+2))/exp(k(+1))-1)*(-1)*exp(k(+2))/exp(k(+1))+(exp(k(+2))/exp(k(+1))-1)^2));

All terms in exp() initially have positive steady states. Taking logs of them in the process of redefining k=log(k) is thus not a problem. As I said, the Taylor approximation is conducted in the individual terms and none of them has a problematic steady state. That some of the terms completely cancel is also not a problem.

Re: log-linearization

PostPosted: Sun Dec 07, 2014 12:10 pm
by missredridinghood
Thanks for the reply. The dynare part is straight forward. :D

Another "lame question" I have is:

If I were to "log-linearize" the budget constraint by hand: y = c + i + phi/2((k_t+1/k_t)-1)^2

y_ss*(log(y_t) - log(y_ss)) = c_ss*(log(c_t) - log(c_ss)) + i_ss*(log(i_t) - log(i_ss)) + phi(k_ss/k_ss - 1)(log(k_t+1) - log(k_ss)) - phi(k_ss/k_ss - 1)(log(k_t) - log(k_ss))

I believe that it would reduce to this: y_ss*(log(y_t) - log(y_ss)) = c_ss*(log(c_t) - log(c_ss)) + i_ss*(log(i_t) - log(i_ss))

If I were to instead have a budget constraint and I log-linearize this by hand: y = c + i + (phi/2(i_t/k_t)^2)k_t

I would get: y_ss*(log(y_t) - log(y_ss)) = c_ss*(log(c_t) - log(c_ss)) + i_ss(1+phi(i_ss/k_ss) )(log(i_t) - log(i_ss)) - phi(i_ss/k_ss)^2 *k_ss (log(k_t) - log(k_ss)) +
phi/2(i_ss/k_ss)^2 k_ss (log(k_t) - log(k_ss))

Would this meaning programming this log linearization, not by using exp be problematic?

Would this then reduce to y_ss*(log(y_t) - log(y_ss)) = c_ss*(log(c_t) - log(c_ss)) + i_ss*(log(i_t) - log(i_ss)) because the adjustment cost (phi/2(i_t/k_t)^2)k_t equals 0 in the steady state?

Re: log-linearization

PostPosted: Tue Dec 09, 2014 10:12 am
by missredridinghood
Can someone please confirm that what I wrote in the last post was correct?

Thanks!

Re: log-linearization

PostPosted: Tue Dec 09, 2014 12:45 pm
by jpfeifer
Log-linearization by hand is never a problem. I haven't fully checked your computations, but they look correct. Generally, adjustment costs like the ones you use are 0 to first order. That's why they typically drop from the resource constraint. Only in the FOCs, where the dynamics is described, do they show up. Here, the second order effect is relevant.