Log-linearization

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

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)).

Thank you very much jpfeifer
Best.

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.

Define marginal utility as uc and use

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:

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:

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.

Thanks for the reply. The dynare part is straight forward. :smiley:

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?

Can someone please confirm that what I wrote in the last post was correct?

Thanks!

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.