# Optimal simple rule

**URL:** <https://forum.dynare.org/t/optimal-simple-rule/6158>\
**Category:** Optimal Policy\
**Created:** [22 April 2017 18:19 UTC](https://forum.dynare.org/t/optimal-simple-rule/6158 "2017-04-22T18:19:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_V](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@S\_V](https://forum.dynare.org/u/S_V)\
**Post date:** [22 April 2017 18:19 UTC](https://forum.dynare.org/t/optimal-simple-rule/6158/1 "2017-04-22T18:19:51Z")

</div>

Dear Prof. Pfeifer,

I would like to find the value of a parameter (phiP) which minimizes the variance of consumption using osr. However, Dynare is unable to find a solution. I wondered if there was something I may be doing wrong? When I make some minor changes to the osr weights, I get astronomical values of phiP which I would like to lie between -1 and 1.

Can I also ask whether there is some way I could find the optimal value of this parameter which maximizes intertemporal utility?

Please find attached a zip file. The file to run is the run.m file which should in turn run cycle\_irf.

Many thanks  
[Forum.zip](https://forum.dynare.org/uploads/default/original/2X/3/3d36061d39883bd304c54eebba836eb7cd1f0b3f.zip) (1.26 MB)

---

<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:** [25 April 2017 18:23 UTC](https://forum.dynare.org/t/optimal-simple-rule/6158/2 "2017-04-25T18:23:31Z")

</div>

1. What do you mean with

```auto
Dynare is unable to find a solution
```

When I run the code with the unstable version, I get

> [@](#):
>
> OPTIMAL VALUE OF THE PARAMETERS:
> 
> phiP 22373.3
> 
> Objective function : 1.62781e-05

which is a solution

1. It is not unheard of that optimal parameters may be infinity (essentially full stabilization). In those cases, people often restrict the parameter range. In the unstable version, you can use

`osr_param_bounds;
phiP, -1, 1;
end;
`

1. What do you mean with

> [@](#):
>
> find the optimal value of this parameter which maximizes intertemporal utility

You want a welfare function that is maximized using that parameter?

---

<div class="post-metadata">

**Author:** ![S\_V](https://forum.dynare.org/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@S\_V](https://forum.dynare.org/u/S_V)\
**Post date:** [25 April 2017 21:07 UTC](https://forum.dynare.org/t/optimal-simple-rule/6158/3 "2017-04-25T21:07:03Z")

</div>

Many thanks Prof. Pfeifer.

I think that was my problem, I used the stable version. I will try with the unstable version and I am sure all should be fine then. Thanks for letting me know about the bounds as well. I wasn’t aware of that feature.

With regards to 3), I meant is there a way to find the value of the parameter phiP which maximizes welfare (I already have a welfare function)?

---

<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:** [26 April 2017 17:04 UTC](https://forum.dynare.org/t/optimal-simple-rule/6158/4 "2017-04-26T17:04:23Z")

</div>

Regarding 3, that is not available as a boxed solution. The problem is that this only makes sense in a model with order=2, because otherwise stochastics is not going to affect the mean of welfare. But it can be easily implemented in Dynare if necessary
