Python package for evaluating Perron-Frobenius Eigenvalue of a real, square non-negative matrix

Is there an optimized package or method that evaluates the eigenvalue of the Perron-Frobenius real, square non-negative matrix? This can be significantly faster (especially for large and / or sparse matrices) than an exact calculation - provided that the eigenvalue of the Perron-Frobenius can be achieved by iterating the matrix. I hope there is an optimized package that does this.

+5
source share
1 answer

In scipy.sparse.linalgyou have a function eigsand eigshthat use ARPACK-library . You can read more in this tutorial , but if it a's a square matrix, possibly in a sparse format, then you can get its largest value, an eigenvalue, i.e. its eigenvalue Perron-Frobenius, and the corresponding eigenvector as:

val, vec = scipy.sparse.linalg.eigs(a, k=1, which='LM')
+4
source

All Articles