Skip to content
Snippets Groups Projects
Commit 491301c6 authored by MichelJuillard's avatar MichelJuillard
Browse files

th_autocovariances.m creates Gamma_y{nar+2} (variance decomposition)

even if there is a single shock. In that case variance decomposition
is one. It is better if Gamma_y has always the expected
size. disp_th_moments.m only displays variance decomposition if there
is more than one shock.
parent fbbe9881
No related branches found
No related tags found
No related merge requests found
......@@ -177,7 +177,10 @@ if options_.hp_filter == 0
end
end
% variance decomposition
if ~nodecomposition && M_.exo_nbr > 1 && size(stationary_vars, 1) > 0
if ~nodecomposition && M_.exo_nbr > 0 && size(stationary_vars, 1) > 0
if M_.exo_nbr == 1
Gamma_y{nar+2} = ones(nvar,1);
else
Gamma_y{nar+2} = zeros(nvar,M_.exo_nbr);
SS(exo_names_orig_ord,exo_names_orig_ord)=M_.Sigma_e+1e-14*eye(M_.exo_nbr);
cs = chol(SS)';
......@@ -203,6 +206,7 @@ if options_.hp_filter == 0
2}(stationary_vars,i)./vv2;
end
end
end
else% ==> Theoretical HP filter.
% By construction, all variables are stationary when HP filtered
iky = inv_order_var(ivar);
......@@ -244,7 +248,10 @@ else% ==> Theoretical HP filter.
end
end
% Variance decomposition
if ~nodecomposition && M_.exo_nbr > 1
if ~nodecomposition && M_.exo_nbr > 0
if M_.exo_nbr == 1
Gamma_y{nar+2} = ones(nvar,1);
else
Gamma_y{nar+2} = zeros(nvar,M_.exo_nbr);
SS(exo_names_orig_ord,exo_names_orig_ord) = M_.Sigma_e+1e-14*eye(M_.exo_nbr);
cs = chol(SS)';
......@@ -290,6 +297,7 @@ else% ==> Theoretical HP filter.
end
end
end
end
if isoctave
warning('on', 'Octave:divide-by-zero')
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment