Skip to contents

A well-behaved continuous-time Markov chain converges to a unique stationary distribution, here called \(\pi\). This distribution satisfies $$\pi Q = 0,$$ subject to \(\sum_{j=1}^N \pi_j = 1\), where \(Q\) is the infinitesimal generator of the Markov chain. This function solves the linear system of equations above for a given generator matrix.

Usage

stationary_ct(Q)

stationary_cont(Q)

Arguments

Q

infinitesimal generator matrix of dimension c(nStates, nStates) (dense or sparse, e.g. from Matrix) or array of such matrices of dimension c(nStates, nStates, nTracks) if the stationary distribution should be computed for several matrices at once

Value

either a single stationary distribution of the continuous-time Markov chain (vector of length nStates) or a matrix of stationary distributions of dimension c(nTracks, nStates) with one stationary distribution in each row

See also

generator to create a generator matrix

Other stationary distribution functions: stationary(), stationary_p()

Examples

# single matrix
Q = generator(c(-2,-2))
Pi = stationary_ct(Q)
# multiple matrices
Q = array(Q, dim = c(2,2,10))
Pi = stationary_ct(Q)