egttools.utils.calculate_stationary_distribution

calculate_stationary_distribution(transition_matrix)[source]

Calculates stationary distribution from a transition matrix of Markov chain.

The use of this function is not recommended if the matrix is non-Hermitian. Please use calculate_stationary_distribution_non_hermitian instead in this case.

The stationary distribution is the normalized eigenvector associated with the eigenvalue 1

Parameters

transition_matrix (Union[numpy.ndarray, scipy.sparse.csr_matrix, scipy.sparse.csc_matrix]) – A 2 dimensional transition matrix

Returns

A 1-dimensional vector containing the stationary distribution

Return type

numpy.ndarray