function eigenvalues¶
- deeptime.markov.tools.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
mu ((M,) ndarray, optional) – Stationary distribution of 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.
If reversible=True the the eigenvalues of the similar symmetric matrix sqrt(mu_i / mu_j) p_{ij} will be computed.
The precomputed stationary distribution will only be used if reversible=True.
Examples
>>> import numpy as np >>> from deeptime.markov.tools.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.j, 0.9+0.j, -0.1+0.j])