get.stationaryDistribution: Stationary distribution of a Markov chain

View source: R/allgenerics.R

get.stationaryDistributionR Documentation

Stationary distribution of a Markov chain

Description

Computes the stationary distribution \mu of a Markov chain (Z_n)_{n \in \mathbb{N}} with transition matrix P, i.e. the probability vector solution of \mu P = \mu.

Usage

get.stationaryDistribution(x)

Arguments

x

An object of S3 class mm (see mm) or mmfit (see fitmm).

Details

Notation (see smmR-package for the complete description of the models): (Z_n)_{n \in \mathbb{N}} is a Markov chain of order k on E, with s = \textrm{card}(E) and transition matrix ptrans of dimension (s^k, s).

For a Markov chain of order k > 1, ptrans (of dimension (s^k, s)) is first written as the transition matrix of the Markov chain of order 1 of the words of length k, of dimension (s^k, s^k); the stationary distribution is then a distribution on these words.

The chain is assumed irreducible, so that the stationary distribution is unique. For semi-Markov chains, see get.limitDistribution.

Value

A vector of length s^k (named with the words of length k for k > 1) giving the values of the stationary distribution; for k = 1, a vector of length s = \textrm{card}(E).

See Also

mm, fitmm, get.limitDistribution

Examples

x <- mm(states = c("a", "b"), init = c(0.5, 0.5), k = 1,
        ptrans = matrix(c(0.9, 0.1, 0.3, 0.7), nrow = 2, byrow = TRUE))
get.stationaryDistribution(x)   # 0.75 0.25

# Order 2: distribution on the words "aa", "ab", "ba", "bb"
y <- mm(states = c("a", "b"), init = rep(1/4, 4), k = 2,
        ptrans = matrix(c(0.9, 0.1, 0.5, 0.5, 0.2, 0.8, 0.3, 0.7),
                        nrow = 4, byrow = TRUE))
get.stationaryDistribution(y)


smmR documentation built on Nov. 28, 2026, 1:06 a.m.