MarkovChainModel.stationary_distribution

MarkovChainModel.stationary_distribution(tol=1e-07, max_iterations=1000)[source]

Computes the stationary distribution of the Markov chain using power iteration.

Parameters
  • tol (float) -- The tolerance to use when checking if the power iteration has converged. As soon as the norm between the vectors of two successive iterations is below this value, the iteration is stopped.

  • max_iterations (int) -- The maximum number of iterations to run if the tolerance does not indicate convergence.

Return type

Tensor

Returns

A tensor of shape [num_states] with the stationary distribution (i.e. the

eigenvector corresponding to the largest eigenvector of the transition matrix, normalized to describe a probability distribution).