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.
silicon
Sébastien Villemot 2023-03-16 15:54:51 +01:00
parent b7477ac0b6
commit 441173ec5a
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 1 additions and 8 deletions

View File

@ -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
sd = sqrt(diag(cmm));
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);
end
[VV,DD,WW] = eig(cc);
id = find(diag(DD)>tol_deriv);
siTMP = si_dMOMENTS./repmat(sd,[1 totparam_nbr]);
MIM = (siTMP'*VV(:,id))*(DD(id,id)\(WW(:,id)'*siTMP));