log-linearization

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

log-linearization

Postby dynare_user » Wed Mar 07, 2012 12:44 pm

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
dynare_user
 
Posts: 2
Joined: Wed Mar 07, 2012 12:41 pm

Re: log-linearization

Postby jpfeifer » Wed Mar 07, 2012 10:10 pm

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)).
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: log-linearization

Postby dynare_user » Thu Mar 08, 2012 8:23 am

Thank you very much jpfeifer
Best.
dynare_user
 
Posts: 2
Joined: Wed Mar 07, 2012 12:41 pm

Re: log-linearization

Postby missredridinghood » Sun Dec 07, 2014 6:51 am

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.
missredridinghood
 
Posts: 19
Joined: Tue Nov 11, 2014 12:37 am

Re: log-linearization

Postby jpfeifer » Sun Dec 07, 2014 7:29 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: log-linearization

Postby missredridinghood » Sun Dec 07, 2014 12:10 pm

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?
missredridinghood
 
Posts: 19
Joined: Tue Nov 11, 2014 12:37 am

Re: log-linearization

Postby missredridinghood » Tue Dec 09, 2014 10:12 am

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

Thanks!
missredridinghood
 
Posts: 19
Joined: Tue Nov 11, 2014 12:37 am

Re: log-linearization

Postby jpfeifer » Tue Dec 09, 2014 12:45 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests