pyemma.msm.analysis.eigenvectors¶
-
pyemma.msm.analysis.
eigenvectors
(T, k=None, right=True, ncv=None)¶ Compute eigenvectors of given transition matrix.
Parameters: - T (numpy.ndarray, shape(d,d) or scipy.sparse matrix) – Transition matrix (stochastic matrix)
- k (int (optional)) – Compute the first k eigenvectors
- ncv (int (optional)) – The number of Lanczos vectors generated, ncv must be greater than k; it is recommended that ncv > 2*k
Returns: eigvec – The eigenvectors of T ordered with decreasing absolute value of the corresponding eigenvalue. If k is None then n=d, if k is int then n=k.
If right = True, the right eigenvectors are returned as column vectors. If right = False, the left eigenvectors are returned as row vectors
Return type: numpy.ndarray, shape=(d, n)
See also
Notes
Eigenvectors are computed using the scipy interface to the corresponding LAPACK/ARPACK routines.
The returned eigenvectors \(v_i\) are normalized such that
\[\langle v_i, v_i \rangle = 1\]This is the case for right eigenvectors \(r_i\) as well as for left eigenvectors \(l_i\).
If you desire orthonormal left and right eigenvectors please use the rdl_decomposition method.
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]]) >>> R = eigenvalues(T)
Matrix with right eigenvectors as columns
>>> R array([[ 5.77350269e-01, 7.07106781e-01, 9.90147543e-02], [ 5.77350269e-01, -5.50368425e-16, -9.90147543e-01], [ 5.77350269e-01, -7.07106781e-01, 9.90147543e-02]])