# Questions about Ramsey optimal policy

**URL:** <https://forum.dynare.org/t/questions-about-ramsey-optimal-policy/4962>\
**Category:** Optimal Policy\
**Created:** [30 August 2015 08:30 UTC](https://forum.dynare.org/t/questions-about-ramsey-optimal-policy/4962 "2015-08-30T08:30:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahar.bashiri01](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@sahar.bashiri01](https://forum.dynare.org/u/sahar.bashiri01)\
**Post date:** [30 August 2015 08:30 UTC](https://forum.dynare.org/t/questions-about-ramsey-optimal-policy/4962/1 "2015-08-30T08:30:21Z")

</div>

Dear all,

I have some questions about Ramsey optimal policy.

My model is a standard model with habit formation consumption. It works fine if I put Taylor rule as the monetary policy rule. But there’s a problem when I try to get the results under Ramsey optimal policy. The planner objective is a function of consumption expenditure and labour hours which I wrote it s follows:

planner\_objective log(c-h_c)-psi_(((wl^(lambdaw\*(1+v)/(1-lambdaw)))_(w\_star^(lambdaw_(1+v)/(1-lambdaw)))\*(l\_star^(1+v)))/(1+v));  
ramsey\_policy(planner\_discount=0.9976,order = 1,instruments=®);  
eliminare\_lagrange\_multipliers;

When I try to run the code, Dynare returns the following error message:

Error using dynare\_solve (line 60)  
An element of the Jacobian is not finite or NaN  
Error in evaluate\_steady\_state (line 66)  
[ys,check] = dynare\_solve([M.fname '_static’],…  
Error in steady_ (line 54)  
[steady\_state,params,info] =  
evaluate\_steady\_state(oo\_.steady\_state,M\_,options\_,oo\_,~options\_.steadystate.nocheck);  
Error in steady (line 81)  
[steady\_state,M\_.params,info] = steady\_(M\_,options\_,oo\_);  
Error in Ikeda\_main10\_ramsey (line 822)  
steady;  
Error in dynare (line 180)  
evalin(‘base’,fname) ;

I need help to solve the errors. Any help would be much appreciated!

Best Regards,  
Sahar Bashiri

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [30 August 2015 11:19 UTC](https://forum.dynare.org/t/questions-about-ramsey-optimal-policy/4962/2 "2015-08-30T11:19:19Z")

</div>

You are most probably going to need a steady state file for this exercise that provides the analytical steady state values conditional on the value of the instrument.

---

<div class="post-metadata">

**Author:** ![sahar.bashiri01](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@sahar.bashiri01](https://forum.dynare.org/u/sahar.bashiri01)\
**Post date:** [30 August 2015 17:35 UTC](https://forum.dynare.org/t/questions-about-ramsey-optimal-policy/4962/3 "2015-08-30T17:35:14Z")

</div>

Dear Professor,

Thank you very much for your help in advance.

I check the steady state values. The code works fine after eliminating some shocks. I have another questions, too.  
Is writing the planner objective with habit persistence in consumption as follows correct?

planner\_objective log(c-h_c)-psi_(((wl^(lambdaw\*(1+v)/(1-lambdaw)))_(w\_star^(lambdaw_(1+v)/(1-lambdaw)))\*(l\_star^(1+v)))/(1+v));

Best regards,  
Sahar Bashiri

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [31 August 2015 08:17 UTC](https://forum.dynare.org/t/questions-about-ramsey-optimal-policy/4962/4 "2015-08-31T08:17:13Z")

</div>

No, you are missing the lagged consumption term. To deal with this, define a new variable

```auto
c_lag=c(-1)
```

and define the part of the planner objective as

```auto
planner_objective log(c-h*c_lag)
```

---

<div class="post-metadata">

**Author:** ![sahar.bashiri01](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/e19b73/32.png) [@sahar.bashiri01](https://forum.dynare.org/u/sahar.bashiri01)\
**Post date:** [31 August 2015 11:15 UTC](https://forum.dynare.org/t/questions-about-ramsey-optimal-policy/4962/5 "2015-08-31T11:15:06Z")

</div>

I regard your reply for my questions. I would like to express my deepest appreciation for your help. .

Best regards,  
Sahar Bashiri
