Reputation: 3177
I have this annoying problem and I haven't figured it out yet. I have a matrix and I want to find the eigenvectors, so I write:
val,vec = np.linalg.eig(mymatrix)
and then I got vec . My problem is when others from my group do the same with the same matrix (mymatrix) we dont get the same eigenvectors !!
Someone who can put up an explanation?
Upvotes: 2
Views: 4095
Reputation: 879083
The fundamental property of an eigenvector x
is
A x = lambda x
for some constant lambda
.
If x
is an eigenvector, so is -x
:
A (-x) = - A x = - lambda x = lambda (-x)
Note also that the set of eigenvectors may not be unique. For example, any vector (of the appropriate dimension) can be an eigenvector of the identity matrix.
np.linalg.eig
tries to return a set of eigenvectors, but does not guarantee a particular, unique set.
Upvotes: 6