Commit e1a0fd05 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Bugfix for conditional variance decomposition

sigma_e_is_diagonal was erroneously set to 0 if the covariance matrix was diagonal, but contained a 0 on the main diagonal.
parent 103b6cf8
......@@ -82,7 +82,7 @@ end
% Set sigma_e_is_diagonal flag (needed if the shocks block is not declared in the mod file).
M_.sigma_e_is_diagonal = 1;
if estim_params_.ncx || ~isequal(nnz(M_.Sigma_e),length(M_.Sigma_e))
if estim_params_.ncx || any(nnz(tril(M_.Sigma_e,-1)))
M_.sigma_e_is_diagonal = 0;
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment