<p>So Lets use a present value Hamiltonian here:</p>

<p>$H=e^{-pt}u(c)+\lambda(\dot k)$</p>

<p>FOC:
wrt c: $0=e^{-pt}u'(c)-\lambda$</p>

<p>wrt k: $-\dot\lambda=\lambda[(1-\tau)r -g]$</p>

<p>Take the FOC from consumption and differentiate wrt to time:</p>

<p>$\dot\lambda =-\gamma c^{-\gamma-1}\dot c e^{-pt+gt(1-\gamma)}e^{(1-\gamma)v(n)}+c^{-\gamma}e^{-pt+ gt(1-\gamma)}e^{(1-\gamma)v(n)}[(1-\gamma)(g+v'(n)\dot n)-p]$</p>

<p>Then substitute back in the FOC for consumption:</p>

<p>$\dot\lambda =-\gamma c^{-1}\dot c\lambda +\lambda[(1-\gamma)(g+v'(n)\dot n)-p]$</p>

<p>Then substitute this guy into the Foc for capital:</p>

<p>$g-(1-\tau )r=-\dot c/c\gamma+(1-\gamma)[g+v'(n)\dot n]-p$</p>

<p>leading to: </p>

<p>$r(1-\tau)=p+(\dot c/c +g)\gamma+(1-\gamma)[-v'(n)\dot n] $</p>

CC BY-SA 3.0
2016-08-22T18:35:01.300Z
Thank you for your answer, but unfortunately I still don't get it completely. How do I get the $\rho$ from equation $(10)$? And when you differentiate for $n$, it is $c^{-\gamma}e^{gt(1-\gamma)}e^{(1-\gamma)v(n)} (1-\gamma)v'(n)\dot{n}$, isn't it. Could you please show me how to substitute it correctly, if I am wrong.
Frodo361
CC BY-SA 3.0
2016-08-22T18:40:11.633Z
Well I assumed your FOC for consumption was correct. Are you using current value or present value Hamiltonian? And I don't differentiate n, I differentiate wrt t . I did forget the g so I put that back in.
VCG
CC BY-SA 3.0
2016-08-22T18:53:27.027Z
It looks like you did PV Hamiltonian, and that means you're missing the $e^{pt}$ term from the foc.
VCG
CC BY-SA 3.0
2016-08-22T19:55:53.630Z
Thank you so much. You really helped me. The equation after your line with "Then substitute back in the FOC for consumption" is in fact $-\dot{\lambda}$ so you have to switch the signs, but after that everything is correct in my opinion. It's seems like Mankiw and Weinzierl made a mistake there, because they have in their equation $(10)$ $[...+(1-\gamma)v'(n) \dot{n}]$. You have observed it with a $-$, like Ferede also did....
Frodo361
CC BY-SA 3.0
2016-08-22T21:01:23.893Z
I have posted something new in my question on the top. I think the last two equations from your answer have wrong signs...
Frodo361
CC BY-SA 3.0
2016-08-22T21:07:04.500Z
You sure I switched signs? Do you explicitly see an error in my math or is it simply not getting what they got?
VCG
CC BY-SA 3.0
2016-08-22T21:13:32.127Z
I'm pretty sure :$\dot\lambda =\gamma c^{-1}\dot c\lambda -\lambda[(1-\gamma)(g+v'(n)\dot n)-p]= \lambda \Big(\gamma \dot{c}/c - [(1-\gamma)(g+v'(n)\dot n)-p]\Big)$, so it has to be $
g-(1-\tau)r=\gamma \dot{c}/c - (1-\gamma)(g+v'(n)\dot{n})+p$
Frodo361
CC BY-SA 3.0
2016-08-22T21:27:00.177Z
So I checked again, and the problem with your answer is that the gs dont cancel. I did make a mistake, but made it twice, so I get the same final answer.
VCG
CC BY-SA 3.0
2016-08-22T21:30:50.027Z
I see it now. Thank you AGAIN. Really helping me out right now!
Frodo361
CC BY-SA 3.0
2016-08-22T21:49:02.077Z
Wait did you figure it out? Cause I'd like to know how they got to their answer.
VCG
CC BY-SA 3.0
2016-08-22T22:18:25.710Z
No, I see, that you did this mistake more than once and your equation does not change in the end. I don't know about this sign in Mankiw's equation. The only thing I can say is, that Ferede has his equation like yours with $\dot c/c= \frac{1}{\gamma} [(1-\tau_k)r-\gamma g - \rho +(1-\gamma)v'(n) \dot n]$ (page 5, equation 8 [link](http://www.degruyter.com/view/j/bejeap.2008.8.1/bejeap.2008.8.1.1948/bejeap.2008.8.1.1948.xml))) , which leads to the same. Maybe Mankiw has done a mistake there. I don't know
Frodo361
CC BY-SA 3.0
2016-08-22T23:34:20.500Z
Okay. Is there still any problem with my answer?
VCG
CC BY-SA 3.0
2016-08-22T17:27:59.110Z
2016-08-22T21:22:41.267Z
2016-08-22T21:22:41.267Z
VCG
<p>I am reading <em>Dynamic scoring: A back-of-the-envelope guide</em> by Mankiv and Weinzierl (<a href="http://www.people.hbs.edu/mweinzierl/paper/dynamicscoring.pdf" rel="nofollow">here</a>) and on page 1420, I don't get the FOC in equation $(10)$, which says $r=...$.
I do get the FOC with $v'(n)=...$ by using Lagrange. </p>

<p>I found the same FOC in a paper from Ferede (<em>Dynamic Scoring in the Ramsey Growth Model</em>, <a href="http://www.degruyter.com/view/j/bejeap.2008.8.1/bejeap.2008.8.1.1948/bejeap.2008.8.1.1948.xml" rel="nofollow">here</a>) and he says, that it </p>

<blockquote>
  <p><em>is obtained by combining the first order conditions of the utility
  maximization with respect to capital and consumption</em> (page 5).</p>
</blockquote>

<p>But I only observe $\lambda=-c^{-\gamma}e^{gt(1-\gamma)}e^{(1-\gamma)v(n)}$ from the FOC w.r.t. consumption and $-\lambda[(1-\tau_k)r-g]=0$ from the FOC w.r.t. capital. </p>

<p><strong>How am I supposed to get $\dot{n}$ and $\dot{c}$ there?</strong></p>

<p>Well let me show you, what I have got: The Lagrange-function is given by: </p>

<p>$$L=\frac{1}{1-\gamma}[c^{1-\gamma}e^{gt(1-\gamma}e^{(1-\gamma)v(n)}-1]-\lambda [(1-\tau_n)wn + (1-\tau_k)rk - c - gk +T - \dot{k}]$$ </p>

<p>So the FOC w.r.t. consumption is given by $\frac{\partial L}{\partial c}=c^{-\gamma}e^{gt(1-\gamma)} e^{(1-\gamma)v(n)}+\lambda=0$, while the FOC w.r.t. to capital is $-\lambda[(1-\tau_k)r-g]=0$. </p>

<p>So the equation for $\dot{\lambda}$ is based on the equation $\frac{\partial \lambda}{\partial t}=\frac{\partial \lambda}{\partial c} \frac{\partial c}{\partial t}$. And you are fully differentiating it.</p>

<p>I hope someone can help me.</p>

<p>NEW:
So again: $\lambda=e^{-pt}u'(c)$. So you are indeed right with your equation after your words "Then substitute back in the FOC for consumption", but then you substitute it to the FOC wrt to k: $\dot{\lambda}=\lambda[g-(1-\tau)r]$, so we get $\gamma \dot{c}/c - (1-\gamma)(g+v'(n)\dot{n})+p=g-(1-\tau)r$, so that the signs don't fit anymore and this unfortunately leads to something else than equation $(10)$.</p>

CC BY-SA 3.0
2016-08-22T18:58:29.540Z
So you should be using a Hamiltonian here, not a Lagrangian, because you're objective function is an integral over time.
VCG
CC BY-SA 3.0
2016-08-22T19:09:44.033Z
I wrote it all out. Your problem came from incorrect FOCs and yes you need to totally differentiate, because it's a foc so the choice variables are functions of all the parameters.
VCG
<macroeconomics><utility><preferences>
FOC for King–Plosser–Rebelo preferences
Frodo361
# FOC for King–Plosser–Rebelo preferences

(Asked by: username_0 on 2016-08-22)

I am reading *Dynamic scoring: A back-of-the-envelope guide* by Mankiv and Weinzierl ([here](http://www.people.hbs.edu/mweinzierl/paper/dynamicscoring.pdf)) and on page 1420, I don't get the FOC in equation $(10)$, which says $r=...$.
I do get the FOC with $v'(n)=...$ by using Lagrange.

I found the same FOC in a paper from Ferede (*Dynamic Scoring in the Ramsey Growth Model*, [here](http://www.degruyter.com/view/j/bejeap.2008.8.1/bejeap.2008.8.1.1948/bejeap.2008.8.1.1948.xml)) and he says, that it

> *is obtained by combining the first order conditions of the utility
> maximization with respect to capital and consumption* (page 5).

But I only observe $\lambda=-c^{-\gamma}e^{gt(1-\gamma)}e^{(1-\gamma)v(n)}$ from the FOC w.r.t. consumption and $-\lambda[(1-\tau\_k)r-g]=0$ from the FOC w.r.t. capital.

**How am I supposed to get $\dot{n}$ and $\dot{c}$ there?**

Well let me show you, what I have got: The Lagrange-function is given by:

$$L=\frac{1}{1-\gamma}[c^{1-\gamma}e^{gt(1-\gamma}e^{(1-\gamma)v(n)}-1]-\lambda [(1-\tau\_n)wn + (1-\tau\_k)rk - c - gk +T - \dot{k}]$$

So the FOC w.r.t. consumption is given by $\frac{\partial L}{\partial c}=c^{-\gamma}e^{gt(1-\gamma)} e^{(1-\gamma)v(n)}+\lambda=0$, while the FOC w.r.t. to capital is $-\lambda[(1-\tau\_k)r-g]=0$.

So the equation for $\dot{\lambda}$ is based on the equation $\frac{\partial \lambda}{\partial t}=\frac{\partial \lambda}{\partial c} \frac{\partial c}{\partial t}$. And you are fully differentiating it.

I hope someone can help me.

NEW:
So again: $\lambda=e^{-pt}u'(c)$. So you are indeed right with your equation after your words "Then substitute back in the FOC for consumption", but then you substitute it to the FOC wrt to k: $\dot{\lambda}=\lambda[g-(1-\tau)r]$, so we get $\gamma \dot{c}/c - (1-\gamma)(g+v'(n)\dot{n})+p=g-(1-\tau)r$, so that the signs don't fit anymore and this unfortunately leads to something else than equation $(10)$.

**Tags:** macroeconomics, utility, preferences
> **Comments:**
> **username_1**: So you should be using a Hamiltonian here, not a Lagrangian, because you're objective function is an integral over time.  
> **username_1**: I wrote it all out. Your problem came from incorrect FOCs and yes you need to totally differentiate, because it's a foc so the choice variables are functions of all the parameters.  

---

## 1 answers

### Answer by username_1 on 2016-08-22. Score: 1

So Lets use a present value Hamiltonian here:

$H=e^{-pt}u(c)+\lambda(\dot k)$

FOC:
wrt c: $0=e^{-pt}u'(c)-\lambda$

wrt k: $-\dot\lambda=\lambda[(1-\tau)r -g]$

Take the FOC from consumption and differentiate wrt to time:

$\dot\lambda =-\gamma c^{-\gamma-1}\dot c e^{-pt+gt(1-\gamma)}e^{(1-\gamma)v(n)}+c^{-\gamma}e^{-pt+ gt(1-\gamma)}e^{(1-\gamma)v(n)}[(1-\gamma)(g+v'(n)\dot n)-p]$

Then substitute back in the FOC for consumption:

$\dot\lambda =-\gamma c^{-1}\dot c\lambda +\lambda[(1-\gamma)(g+v'(n)\dot n)-p]$

Then substitute this guy into the Foc for capital:

$g-(1-\tau )r=-\dot c/c\gamma+(1-\gamma)[g+v'(n)\dot n]-p$

leading to:

$r(1-\tau)=p+(\dot c/c +g)\gamma+(1-\gamma)[-v'(n)\dot n] $

> **Comments:**
> **username_0**: Thank you for your answer, but unfortunately I still don't get it completely. How do I get the $\rho$ from equation $(10)$? And when you differentiate for $n$, it is $c^{-\gamma}e^{gt(1-\gamma)}e^{(1-\gamma)v(n)} (1-\gamma)v'(n)\dot{n}$, isn't it. Could you please show me how to substitute it correctly, if I am wrong.  
> **username_1**: Well I assumed your FOC for consumption was correct. Are you using current value or present value Hamiltonian? And I don't differentiate n, I differentiate wrt t . I did forget the g so I put that back in.  
> **username_1**: It looks like you did PV Hamiltonian, and that means you're missing the $e^{pt}$ term from the foc.  
> **username_0**: Thank you so much. You really helped me. The equation after your line with "Then substitute back in the FOC for consumption" is in fact $-\dot{\lambda}$ so you have to switch the signs, but after that everything is correct in my opinion. It's seems like Mankiw and Weinzierl made a mistake there, because they have in their equation $(10)$ $[...+(1-\gamma)v'(n) \dot{n}]$. You have observed it with a $-$, like Ferede also did....  
> **username_0**: I have posted something new in my question on the top. I think the last two equations from your answer have wrong signs...  
> **username_1**: You sure I switched signs? Do you explicitly see an error in my math or is it simply not getting what they got?  
> **username_0**: I'm pretty sure :$\dot\lambda =\gamma c^{-1}\dot c\lambda -\lambda[(1-\gamma)(g+v'(n)\dot n)-p]= \lambda \Big(\gamma \dot{c}/c - [(1-\gamma)(g+v'(n)\dot n)-p]\Big)$, so it has to be $ g-(1-\tau)r=\gamma \dot{c}/c - (1-\gamma)(g+v'(n)\dot{n})+p$  
> **username_1**: So I checked again, and the problem with your answer is that the gs dont cancel. I did make a mistake, but made it twice, so I get the same final answer.  
> **username_0**: I see it now. Thank you AGAIN. Really helping me out right now!  
> **username_1**: Wait did you figure it out? Cause I'd like to know how they got to their answer.  
> **username_0**: No, I see, that you did this mistake more than once and your equation does not change in the end. I don't know about this sign in Mankiw's equation. The only thing I can say is, that Ferede has his equation like yours with $\dot c/c= \frac{1}{\gamma} [(1-\tau_k)r-\gamma g - \rho +(1-\gamma)v'(n) \dot n]$ (page 5, equation 8 [link](http://www.degruyter.com/view/j/bejeap.2008.8.1/bejeap.2008.8.1.1948/bejeap.2008.8.1.1948.xml))) , which leads to the same. Maybe Mankiw has done a mistake there. I don't know  
> **username_1**: Okay. Is there still any problem with my answer?  

---

