# Looping a model

**URL:** <https://forum.dynare.org/t/looping-a-model/17880>\
**Category:** Steady state\
**Created:** [14 April 2021 15:16 UTC](https://forum.dynare.org/t/looping-a-model/17880 "2021-04-14T15:16:38Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [15 April 2021 18:04 UTC](https://forum.dynare.org/t/looping-a-model/17880/6 "2021-04-15T18:04:32Z")

</div>

Use

> [@Loop over parameters](https://forum.dynare.org/t/loop-over-parameters/3335/2):
>
> You are not actually setting the parameter. What you should do is use the the set\_param\_value command. Moreover, if you have an analytic steady state, use a steady\_state\_model block instead of initval. You can find an example for such a loop here: [[Need help to check Matlab compatibility](http://forum.dynare.org/t/need-help-to-check-matlab-compatibility/3192/1)). Basically, you need to write a Matlab m-file with the following parts: rhos = 0.8:0.05:1.05; first\_time = 1; for i=1:length(rhos) if first\_time set\_param\_value('rho',rhos(i)); dynare your\_…

---

_[View the full topic](https://forum.dynare.org/t/looping-a-model/17880)._
