Page 1 of 1

IRFs using decision rules

PostPosted: Mon Jun 08, 2015 7:47 am
by mharding
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: Select all
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


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!

Re: IRFs using decision rules

PostPosted: Tue Jun 09, 2015 8:38 am
by jpfeifer
For things like this, please use the simult_ function of Dynare. For an example, see e.g. https://sites.google.com/site/pfeiferecon/RBC_news_shock_model.mod

Re: IRFs using decision rules

PostPosted: Wed Jun 10, 2015 7:48 am
by mharding
Thank you Johannes! This is very helpful, it works perfectly fine for first, second and third order approximations.
Best,
Martin