pyemma.msm.analysis.rdl_decomposition

pyemma.msm.analysis.rdl_decomposition(T, k=None, norm='auto', ncv=None)

Compute the decomposition into eigenvalues, left and right eigenvectors.

Parameters:
  • T ((M, M) ndarray or sparse matrix) – Transition matrix
  • k (int (optional)) – Number of eigenvector/eigenvalue pairs
  • norm ({'standard', 'reversible', 'auto'}, optional) –

    which normalization convention to use

    norm  
    ‘standard’ LR = Id, is a probabilitydistribution, the stationary distributionof T. Right eigenvectors Rhave a 2-norm of 1
    ‘reversible’ R and L are related via L[0, :]*R
    ‘auto’ reversible if T is reversible, else standard.
  • ncv (int (optional)) – The number of Lanczos vectors generated, ncv must be greater than k; it is recommended that ncv > 2*k
Returns:

  • R ((M, M) ndarray) – The normalized (“unit length”) right eigenvectors, such that the column R[:,i] is the right eigenvector corresponding to the eigenvalue w[i], dot(T,R[:,i])``=``w[i]*R[:,i]
  • D ((M, M) ndarray) – A diagonal matrix containing the eigenvalues, each repeated according to its multiplicity
  • L ((M, M) ndarray) – The normalized (with respect to R) left eigenvectors, such that the row L[i, :] is the left eigenvector corresponding to the eigenvalue w[i], dot(L[i, :], T)``=``w[i]*L[i, :]

Examples

>>> from pyemma.msm.analysis import rdl_decomposition
>>> T = np.array([[0.9, 0.1, 0.0], [0.5, 0.0, 0.5], [0.0, 0.1, 0.9]])
>>> R, D, L = rdl_decomposition(T)

Matrix with right eigenvectors as columns

>>> R
array([[  1.00000000e+00,   7.07106781e-01,   9.90147543e-02],
       [  1.00000000e+00,  -5.50368425e-16,  -9.90147543e-01],
       [  1.00000000e+00,  -7.07106781e-01,   9.90147543e-02]])

Diagonal matrix with eigenvalues

>>> D
array([[ 1.0+0.j,  0.0+0.j,  0.0+0.j],
       [ 0.0+0.j,  0.9+0.j,  0.0+0.j],
       [ 0.0+0.j,  0.0+0.j, -0.1+0.j]])

Matrix with left eigenvectors as rows

>>> L
array([[  4.54545455e-01,   9.09090909e-02,   4.54545455e-01],
       [  7.07106781e-01,   2.80317573e-17,  -7.07106781e-01],
       [  4.59068406e-01,  -9.18136813e-01,   4.59068406e-01]])