Skip to content
Snippets Groups Projects
Commit 35229d00 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Removed NaNs in M_.Correlation_matrix if they are the consequence of variances...

Removed NaNs in M_.Correlation_matrix if they are the consequence of variances (of structural innovations) calibrated to zero.
(cherry picked from commit b907e82e)
parent 71276102
Branches
Tags
No related merge requests found
......@@ -67,6 +67,14 @@ end
% Set the correlation matrix if necessary.
if ~isequal(estim_params_.ncx,nnz(tril(M_.Sigma_e,-1)))
M_.Correlation_matrix = diag(1./sqrt(diag(M_.Sigma_e)))*M_.Sigma_e*diag(1./sqrt(diag(M_.Sigma_e)));
% Remove NaNs appearing because of variances calibrated to zero.
if any(isnan(M_.Correlation_matrix))
zero_variance_idx = find(~diag(M_.Sigma_e));
for i=1:length(zero_variance_idx)
M_.Correlation_matrix(zero_variance_idx(i),:) = 0;
M_.Correlation_matrix(:,zero_variance_idx(i)) = 0;
end
end
end
data = dataset_.data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment