I have observed that both Octave and Matlab return different eigenvectors when invoking eig(X) several times. The eigenvalues stay the same but the eigenvectors change despite there being no change in X. I suspect this is because of random initialization somewhere inside the code for eig(). Any clues where the randomness comes from?
Is there a way to remove the randomness (for example user specified seed for all random number generation)?
I have manually ported some code from Matlab to Armadillo C++ library. In Armadillo I always get the same eigenvectors every time. The ported code has a bug somewhere but I am finding it impossible to hunt it down because of the eigenvectors changing from invocation to invocation in Matlab/Octave.
Aucun commentaire:
Enregistrer un commentaire