# msmtools.analysis.stationary_distribution¶

msmtools.analysis.stationary_distribution(T)

Compute stationary distribution of stochastic matrix T.

Parameters: T ((M, M) ndarray or scipy.sparse matrix) – Transition matrix mu – Vector of stationary probabilities. (M,) ndarray

Notes

The stationary distribution $$\mu$$ is the left eigenvector corresponding to the non-degenerate eigenvalue $$\lambda=1$$,

$\mu^T T =\mu^T.$

Examples

>>> import numpy as np
>>> from msmtools.analysis import stationary_distribution

>>> T = np.array([[0.9, 0.1, 0.0], [0.4, 0.2, 0.4], [0.0, 0.1, 0.9]])
>>> mu = stationary_distribution(T)
>>> mu
array([ 0.44444444, 0.11111111, 0.44444444])