I have a very large sparse matrix which represents a transition martix in a Markov Chain, i.e. the sum of each row of the matrix equals one and I'm interested in finding the first eigenvalue and its corresponding vector which is smaller than one. I know that the eigenvalues are bounded in the section [-1, 1] and they are all real (non-complex).
I am trying to calculate the values using python's scipy.sparse.eigs
function, however, one of the parameters of the functions is the number of eigenvalues/vectors to estimate and every time I've increased the number of parameters to estimate, the numbers of eigenvalues which are exactly one grew as well.
Needless to say, I am using the which
parameter with the value 'LR'
in order to get the k largest eigenvalues, with k being the number of values to estimate.
Does anyone have an idea how to solve this problem (finding the first eigenvalue smaller than one and its corresponding vector)?
Calculating eigen values of very large sparse matrices in python
Asked Answered
I agree with @pv. If your matrix S
was symmetric, you could see it as a laplacian matrix of the matrix I - S
. The number of connected components of I - S
is the number of zero-eigenvalues of this matrix (i.e, the dimension of the space associated to eigenvalue 1 of S
). You could check the number of connected components of the graph whose similarity matrix is I - S*S'
for a start, e.g. with scipy.sparse.csgraph.connected_components
.
and what do i do if the matrix is not symmetric? –
Salvation
© 2022 - 2024 — McMap. All rights reserved.
eigs
with this value? In other words, is this a real property of the matrix, or an error in the code? – Homerhomerescipy
. As far as I can tellscipy
is using a 3rd party library (ARPACK
) for the actual calculations – Salvation