Routines for stochastic matrices, based on mpmath
Compute the stochastic eigenvector (or stationary distribution vector) of an irreducible stochastic (or Markov) matrix, by using the Grassmann-Taksar-Heyman (GTH) algorithm, a numerically stable variant of Gaussian elimination.
- Source code
- Illustration 1:
Basic usage and comparison with
mpmath.eig
- Illustration 2:
mp
versusfp
- Illustration 3:
Comparison with
numpy.linalg.eig
andscipy.linalg.eig
- pytest