Hello everyone,

I am trying to compute Ramsey policy but I have to problems with this. First, the planner objective has habits on consumption so I need to run…

```
planner_objective((log(cons - hcons*cons(-1)) - lpsi*((lab^(1+vartheta))/(1+vartheta))));
ramsey_policy(planner_discount=0.99,order=1);
```

and I get the error:

ERROR: Leads and lags on variables are forbidden in ‘planner_objective’

Is there a way of introducing lags in the planner objective? If not, how can I get an equivalent function?

Second, does anyone know whether it is possible to compute ramsey policy in Dynare for a model that uses external funtions? When I change the objetive equation to avoid the lags problem and use this command

```
planner_objective((log(cons - hcons*cons) - lpsi*((lab^(1+vartheta))/(1+vartheta))));
ramsey_policy(planner_discount=0.99,order=1);
```

I get this new error:

ERROR: third order derivatives of external functions are not implemented

Thank you for your help!

M