algorithm_functions.stationary_distribution#
- algorithm_functions.stationary_distribution(Matrix: ndarray) ndarray #
Calculates the stationary distribution of a transition matrix.
A QR decomposition is used to calculate the stationary distribution.
- Parameters:
Matrix (np.ndarray) – A transition matrix.
- Raises:
Exception – If the provided matrix is not a transition matrix (if it contains values larger than 1, smaller than 0 or the row sum is not equal to 1).
- Returns:
np.ndarray – The stationary distribution.