Unexpected Eigenvectors In Numpy
I have seen this question, and it is relevant to my attempt to compute the dominant eigenvector in Python with numPy. I am trying to compute the dominant eigenvector of an n x n ma
Solution 1:
You are just misinterpreting eig
's return. According to the docs, the second return argument is
The normalized (unit “length”) eigenvectors, such that the column v[:,i] is the eigenvector corresponding to the eigenvalue w[i].
So the eigenvector corresponding to eigenvalue 1
is not [ 0.4472136 , -0.70710678]
, but [-0.70710678, -0.70710678]
, as can be easily verified:
>>>markov.dot([ 0.4472136 , -0.70710678]) # not an eigenvector
array([ 0.21634952, -0.59167474])
>>>markov.dot([-0.70710678, -0.70710678]) # an eigenvector
array([-0.70710678, -0.70710678])
Post a Comment for "Unexpected Eigenvectors In Numpy"