This was very useful explanation!
I would, however, like to ask a further clarification.
Using the example above *_MJ.mod I tried to do the same exercise at order=3.
The IRFs somewhat differ from what we get at order=2. I attach the figures. In particular what confuses me is:
1.) at order=2, the shock to volatility increases volatility then it returns to its steady state value. However, at order=2, the volatility shock should not have the impact on the path of aggregate variables (only the constant in the policy function).
2.) At order=3, I expect the same behaviour of volatility as at order=2. However, it seems as it drops (after a positive shock) and remains at lower level. This obviously results in strange path of consumption.
https://lh3.googleusercontent.com/-q2P9VYSnDaw/TrBnkrqYQXI/AAAAAAAAAjQ/2e0nhJV7sco/h800/volatility.jpg
The results must come from the line change of simult_ command. With the last argument being order as far as I understand (function y_=simult_(y0,dr,ex_,iorder)].
I changed
irf2 = simult_(oo_.steady_state,oo_.dr,ex_,2);
to
irf3 = simult_(oo_.steady_state,oo_.dr,ex_,3);
Probably I misinterpreted something. Any ideas or suggestions on this point?
Best
Modified *_MJ.mod code:
[code]//-----------------------------------------------------------------------------------------------------------------------------------------------
var a, sigma_e, c, l, x, k, y;
varexo e, eta;
//-----------------------------------------------------------------------------------------------------------------------------------------------
parameters alfa, betta, gamma, mu, delta, phi, rho_a, rho_sigma_e, mean_sigma_e, sigma_eta;
alfa = 0.36; // capital’s share of output
betta = 0.99; // discount factor
gamma = -1; // RRA = 1 - gamma
mu = 0.32; // exponent on leisure in Cobb-Douglas part of utility
delta = 0.025; // depreciation
phi = 3; // capital adjustment factor
rho_a = 0.95; // persistence of TFP
rho_sigma_e = 0.97; // persistence of std dev of TFP innovations
mean_sigma_e = 0.008; // unconditional mean of std dev of TFP innovations
sigma_eta = 0.0003; // std dev of innovations to TFP volatility
//-----------------------------------------------------------------------------------------------------------------------------------------------
model(use_dll);
// output
y = exp(a)(k(-1)^alfa)(l^(1-alfa));
// labor-leisure
c=mu/(1-mu)(1-l)(1-alfa)exp(a)(k(-1)^(alfa))*(l^(-alfa));
// budget constraint
c = y - x;
// firm FOC for investment
(((c^mu)((1-l)^(1-mu)))^(gamma-1))(mu*(c^(mu-1))((1-l)^(1-mu)))=(1-2phi*(x/k(-1)-delta))betta(((c(+1)^mu)((1-l(+1))^(1-mu)))^(gamma-1))(mu*(c(+1)^(mu-1))((1-l(+1))^(1-mu)))( alfay(+1)/k + (1-delta + phi((x(+1)/k)^2 - delta^2))/(1-2phi(x(+1)/k-delta)) );
// law of motion for capital
k = (1-delta)k(-1) + x - phik(-1)*(x/k(-1)-delta)^2;
// stochastic process
sigma_e = rho_sigma_esigma_e(-1) + (1-rho_sigma_e)mean_sigma_e + sigma_etaeta;
a = rho_aa(-1) + sigma_e*e;
end;
//-----------------------------------------------------------------------------------------------------------------------------------------------
initval;
eta=0;
sigma_e = mean_sigma_e;
a=0;
e=0;
l=0.3;
k=5;
y=(k^alfa)(l^(1-alfa));
x = deltak;
c = y - x;
end;
steady;
check;
shocks;
var e = 1;
var eta = 1;
end;
%stoch_simul(order=2);
stoch_simul(order=3, periods=10000, replic=100);
ex_ = zeros(10,2);
ex_(1,2) = 1;
ex_(1,2) = 1;
irf2 = simult_(oo_.steady_state,oo_.dr,ex_,2);
irf3 = simult_(oo_.steady_state,oo_.dr,ex_,3);
irfA2=irf2(1,:)-oo_.steady_state(1);
irfA3=irf3(1,:)-oo_.steady_state(1);
irfSigma2=irf2(2,:)-oo_.steady_state(2);
irfSigma3=irf3(2,:)-oo_.steady_state(2);
cons2=irf2(3,:)-oo_.steady_state(3);
cons3=irf3(3,:)-oo_.steady_state(3);
close all;
figure;
subplot(3,2,1)
plot(irfA2);
legend(‘A 2nd ord’)
subplot(3,2,2)
plot(irfA3);
legend(‘A 3rd ord’)
subplot(3,2,3)
plot(irfSigma2);
legend(‘sigmae 2nd ord’)
subplot(3,2,4)
plot(irfSigma3);
legend(‘sigmae 3rd ord’)
subplot(3,2,5)
plot(cons2);
legend(‘cons 2nd ord’)
subplot(3,2,6)
plot(cons3);
legend(‘cons 3rd ord’)
[/code]