Commit b907e82e 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.
parent a5d84a90
......@@ -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;
......
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