Bug in the function PosteriorIRF.m
Posted: Sat Nov 28, 2009 10:29 am
Hi,
I found a bug in the PosteriorIRF.m function. Look at the code for compution the IRFs to orthogonalized shocks.
There should be cs = transpose(chol(SS)); and SS should be replaced by cs after this command, so that the code will be the same as in the function stoch_simul.m.
I found a bug in the PosteriorIRF.m function. Look at the code for compution the IRFs to orthogonalized shocks.
- Code: Select all
SS(M_.exo_names_orig_ord,M_.exo_names_orig_ord) = M_.Sigma_e+1e-14*eye(M_.exo_nbr);
SS = transpose(chol(SS));
for i = 1:M_.exo_nbr
if SS(i,i) > 1e-13
y=irf(dr,SS(M_.exo_names_orig_ord,i), options_.irf, options_.drop,options_.replic,options_.order);
if options_.relative_irf
y = 100*y/cs(i,i);
end
for j = 1:nvar
if max(y(IndxVariables(j),:)) - min(y(IndxVariables(j),:)) > 1e-12
stock_irf_dsge(:,j,i,irun) = transpose(y(IndxVariables(j),:));
end
end
end
end
There should be cs = transpose(chol(SS)); and SS should be replaced by cs after this command, so that the code will be the same as in the function stoch_simul.m.