# Second order approximation and the IRF explosive

**URL:** <https://forum.dynare.org/t/second-order-approximation-and-the-irf-explosive/11515>\
**Category:** Optimal Policy\
**Created:** [21 March 2018 14:10 UTC](https://forum.dynare.org/t/second-order-approximation-and-the-irf-explosive/11515 "2018-03-21T14:10:46Z")\
**Posts on this page:** 1\
**Showing post:** 26

<div class="post-metadata">

**Author:** ![Grant](https://forum.dynare.org/letter_avatar_proxy/v4/letter/g/a5b964/32.png) [@Grant](https://forum.dynare.org/u/Grant)\
**Post date:** [10 May 2018 14:43 UTC](https://forum.dynare.org/t/second-order-approximation-and-the-irf-explosive/11515/26 "2018-05-10T14:43:30Z")

</div>

Dear Prof. Jpfeifer,

Many thanks for your generous help. It helped me a lot!

I notice that you didn’t put the stoch\_simul command in the mod-file. However, in the post [Optimal policy parameters in a non-linear model](https://forum.dynare.org/t/optimal-policy-parameters-in-a-non-linear-model/11772/9), you indicated me that the maximization code should be put after a stoch\_simul-command because that one is needed to initialize all the structures used. Could you please help me explain whether should I put the maximization code right after the stoch\_simul command or just delete it? And why？

Besides, how can I set the grid step during the process of optimal parameter value search? For example, I define the range of the parameters to be optimized as 0 to 3, rather than 0 to Inf in your posted code, and I also want to set the grid search step is 0.01 during this range. How can I do it in dynare?

I am looking forward to your reply.

---

_[View the full topic](https://forum.dynare.org/t/second-order-approximation-and-the-irf-explosive/11515)._
