# Issue with Ramsey Optimal policy

**URL:** <https://forum.dynare.org/t/issue-with-ramsey-optimal-policy/19226>\
**Category:** Optimal Policy\
**Created:** [2 November 2021 09:41 UTC](https://forum.dynare.org/t/issue-with-ramsey-optimal-policy/19226 "2021-11-02T09:41:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azus](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@Azus](https://forum.dynare.org/u/Azus)\
**Post date:** [2 November 2021 09:41 UTC](https://forum.dynare.org/t/issue-with-ramsey-optimal-policy/19226/1 "2021-11-02T09:41:18Z")

</div>

Hi everyone, I am trying to to run the attached file in order to obtain the Ramsey optimal policy in the framework of a subsidy. However, Dynare returns this error:

ERROR: You cannot include exogenous variables in the planner objective. Please define an auxiliary endogenous variable like eps\_aux=epsilon and use it instead of the varexo.

The model is loglinear.

Thank you very much for the help!  
[Sussidio\_MC\_NKPC.mod](https://forum.dynare.org/uploads/short-url/bR4zfBWD9T8BBHEZLPRpjPaZvpV.mod) (6.3 KB)

---

<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:** [2 November 2021 16:58 UTC](https://forum.dynare.org/t/issue-with-ramsey-optimal-policy/19226/2 "2021-11-02T16:58:27Z")

</div>

The specific message is a bug. The problem is your using an undefined object `chi` in the `planner_objective`. I guess it must be defined as a parameter.  
Also note that in

```auto
chi=1/(n_bar^phi)*(S^sigma);

```

the `S` was not defined.

---

<div class="post-metadata">

**Author:** ![Azus](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@Azus](https://forum.dynare.org/u/Azus)\
**Post date:** [2 November 2021 17:48 UTC](https://forum.dynare.org/t/issue-with-ramsey-optimal-policy/19226/3 "2021-11-02T17:48:50Z")

</div>

Thank you very much, I will try to fix this.

Is there any problem concerning the fact that my model is loglinear? Can I use this approach nevertheless?

Thank you again

---

<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:** [2 November 2021 17:52 UTC](https://forum.dynare.org/t/issue-with-ramsey-optimal-policy/19226/4 "2021-11-02T17:52:17Z")

</div>

Generally, welfare is a higher order property. A loglinear (first order) model is only appropriate under certain conditions like an undistorted steady state.

---

<div class="post-metadata">

**Author:** ![Azus](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@Azus](https://forum.dynare.org/u/Azus)\
**Post date:** [4 November 2021 09:05 UTC](https://forum.dynare.org/t/issue-with-ramsey-optimal-policy/19226/5 "2021-11-04T09:05:09Z")

</div>

Thank you very much professor! In the end I fixed the problem by considering the model in level
