| get.stationaryDistribution | R Documentation |
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.
get.stationaryDistribution(x)
x |
An object of S3 class |
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.
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).
mm, fitmm, get.limitDistribution
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.