Reputation: 6372
I need to find the principal left eigenvector of a matrix. How can I do this with numpy or scipy?
Upvotes: 0
Views: 1774
Reputation: 14377
Using the eigendecomposition of the transpose for example.
import numpy as np
A = np.random.randn(10, 10)
v, V = np.linalg.eig(A.T)
Then left_vec = V[:, 0].T
is your vector. Test it by evaluating
print left_vec.dot(A)
print left_vec * v[0]
Upvotes: 2