Skip to content
Snippets Groups Projects
Verified Commit aada743d authored by Sébastien Villemot's avatar Sébastien Villemot Committed by Stéphane Adjemian
Browse files

Remove workaround for eig() function under Octave

The eig() function has been been able to return the left eigenvectors since at
least Octave 4.4.
parent 5ec2c4aa
No related branches found
No related tags found
No related merge requests found
...@@ -335,14 +335,7 @@ if info(1) == 0 %no errors in solution ...@@ -335,14 +335,7 @@ if info(1) == 0 %no errors in solution
cmm = simulated_moment_uncertainty(ind_dMOMENTS, periods, replic,options_,M_,oo_); %covariance matrix of moments cmm = simulated_moment_uncertainty(ind_dMOMENTS, periods, replic,options_,M_,oo_); %covariance matrix of moments
sd = sqrt(diag(cmm)); sd = sqrt(diag(cmm));
cc = cmm./(sd*sd'); cc = cmm./(sd*sd');
if isoctave
[VV,DD] = eig(cc);
%fix for older Matlab versions that do not support computing left eigenvalues, see http://mathworks.com/help/releases/R2012b/matlab/ref/eig.html
[WW,~] = eig(cc.');
WW = conj(WW);
else
[VV,DD,WW] = eig(cc); [VV,DD,WW] = eig(cc);
end
id = find(diag(DD)>tol_deriv); id = find(diag(DD)>tol_deriv);
siTMP = si_dMOMENTS./repmat(sd,[1 totparam_nbr]); siTMP = si_dMOMENTS./repmat(sd,[1 totparam_nbr]);
MIM = (siTMP'*VV(:,id))*(DD(id,id)\(WW(:,id)'*siTMP)); MIM = (siTMP'*VV(:,id))*(DD(id,id)\(WW(:,id)'*siTMP));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment