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
parent
b7477ac0b6
commit
441173ec5a
|
@ -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,WW] = eig(cc);
|
||||||
[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
|
|
||||||
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));
|
||||||
|
|
Loading…
Reference in New Issue