# IRFs using decision rules

**URL:** <https://forum.dynare.org/t/irfs-using-decision-rules/4749>\
**Category:** Dynare help (legacy posts)\
**Created:** [8 June 2015 07:47 UTC](https://forum.dynare.org/t/irfs-using-decision-rules/4749 "2015-06-08T07:47:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mharding](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mharding](https://forum.dynare.org/u/mharding)\
**Post date:** [8 June 2015 07:47 UTC](https://forum.dynare.org/t/irfs-using-decision-rules/4749/1 "2015-06-08T07:47:14Z")

</div>

Dear all,

I am trying to produce IRFs using the decision rules generated by Dynare. According to the manual, at the first order approximation the stylized approximation of the model is: y\_{t}=y\_s+A\*(y\_{t-1}-y\_s)+B\*u\_{t}. If I get this correctly, feeding a 1sd to the first exogenous variable (sd=0.0073) to get a 20 period IRF should be like this:

[code]u\_1 = [0.0073 0 0 0 0]’;  
u\_f = zeros([5 19]);  
u\_t = [u\_1 u\_f];

y = oo\_.dr.ys;

for i=1:20  
y(:,i+1) = oo\_.dr.ys + oo\_.dr.ghx\*(y([3 6 7 12 17 18 19 20],i)-oo\_.dr.ys([3 6 7 12 17 18 19 20])) + oo\_.dr.ghu\*u\_t(:,i);  
IRF(:,i) = y(:,i+1)-oo\_.dr.ys;  
end[/code]

where I have 8 state variables, the monetary base, capital, net worth, the price of capital and 4 variables ruling the shocks process (m, k, n, q, e, b, A, x). The state variables are selected in order declaration, which in this case is the same as DR-order, since I have no mixed variables.

My problem is that with this I cannot replicate the IRFs produced automatically with stoch\_simul, but rather get some explosive path for the IRFs. The code of the model is also attached.

Any help is much appreciated!  
[CD08\_nonlinear\_ss5\_ed.mod](https://forum.dynare.org/uploads/default/original/2X/0/03e316fa28f3074d58749227fc73feb7395ca6fe.mod) (9.47 KB)

---

<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:** [9 June 2015 08:38 UTC](https://forum.dynare.org/t/irfs-using-decision-rules/4749/2 "2015-06-09T08:38:36Z")

</div>

For things like this, please use the simult\_ function of Dynare. For an example, see e.g. [sites.google.com/site/pfeiferecon/RBC\_news\_shock\_model.mod](https://sites.google.com/site/pfeiferecon/RBC_news_shock_model.mod)

---

<div class="post-metadata">

**Author:** ![mharding](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/3da27b/32.png) [@mharding](https://forum.dynare.org/u/mharding)\
**Post date:** [10 June 2015 07:48 UTC](https://forum.dynare.org/t/irfs-using-decision-rules/4749/3 "2015-06-10T07:48:01Z")

</div>

Thank you Johannes! This is very helpful, it works perfectly fine for first, second and third order approximations.  
Best,  
Martin
