# Loop over parameters to find maximized welfare

**URL:** <https://forum.dynare.org/t/loop-over-parameters-to-find-maximized-welfare/12358>\
**Category:** Optimal Policy\
**Created:** [3 September 2018 14:11 UTC](https://forum.dynare.org/t/loop-over-parameters-to-find-maximized-welfare/12358 "2018-09-03T14:11:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![MichelleHuang](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/bc79bd/32.png) [@MichelleHuang](https://forum.dynare.org/u/MichelleHuang)\
**Post date:** [4 September 2018 08:18 UTC](https://forum.dynare.org/t/loop-over-parameters-to-find-maximized-welfare/12358/3 "2018-09-04T08:18:33Z")

</div>

Thank you for your quick reply!!! It’s real helpful!!

But I still have some questions:

1. done

2. I am not sure whether my shock size is correct… I just follow the .mod file from  
Matteo Iacoviello, 2015. " **[Financial Business Cycles](https://ideas.repec.org/a/red/issued/14-27.html)** ," [Review of Economic Dynamics](https://ideas.repec.org/s/red/issued.html), Elsevier for the Society for Economic Dynamics, vol. 18(1), pages 140-164, January.  
And my model structure is basically modified from it. But I don’t know what’s the effect of different scale of shock size. Should I choose my shock size based on the parameter values? If not, how should I choose my shock size?  
I change the shock size to an ordinary case as below:

3. There is still an error after I change the shock size. And the error is the same as before. I know that my model violate Blanchard & Kahn conditions when rho=1.0. My question is that, since the .m file still run without just stopping, does my model structure need an overall modification? or could I think my model works well but the parameter looping range should be modified?

4. In the previous forum topics, there is a code to show where the error happens.

Sorry for all these questions, and thank you very much for your time.

---

_[View the full topic](https://forum.dynare.org/t/loop-over-parameters-to-find-maximized-welfare/12358)._
