pyemma.msm.analysis.eigenvalues

pyemma.msm.analysis.eigenvalues(T, k=None, ncv=None, reversible=False, mu=None)

Find eigenvalues of the transition matrix.

Parameters:
  • T ((M, M) ndarray or sparse matrix) – Transition matrix
  • k (int (optional)) – Compute the first k eigenvalues of T
  • ncv (int (optional)) – The number of Lanczos vectors generated, ncv must be greater than k; it is recommended that ncv > 2*k
  • reversible (bool (optional)) – Indicate that transition matrix is reversible. Will compute its stationary distribution mu (unless given) and then compute the eigenvalues of the symmetric matrix sqrt(mu_i / mu_j) which is equivalent but much faster
  • mu (numpy.ndarray, shape=(d)) – Stationary distribution of T. Will only be used if reversible=True in order to symmetrize T.
Returns:

w – Eigenvalues of T. If k is specified, w has shape (k,)

Return type:

(M,) ndarray

Notes

Eigenvalues are returned in order of decreasing magnitude.

Examples

>>> from pyemma.msm.analysis import eigenvalues
>>> T = np.array([[0.9, 0.1, 0.0], [0.5, 0.0, 0.5], [0.0, 0.1, 0.9]])
>>> w = eigenvalues(T)
>>> w
array([1.0+0.j, 0.9+0.j, -0.1+0.j])