Learn R Programming

oeli (version 0.5.2)

stationary_distribution: Stationary distribution

Description

This function computes the stationary distribution corresponding to a transition probability matrix.

Usage

stationary_distribution(tpm, soft_fail = FALSE)

Value

A numeric vector.

Arguments

tpm

A transition probability matrix.

soft_fail

Either TRUE to return the discrete uniform distribution if the computation of the stationary distribution fails for some reason, or FALSE to throw an error.

Examples

Run this code
tpm <- matrix(0.05, nrow = 3, ncol = 3)
diag(tpm) <- 0.9
stationary_distribution(tpm)

Run the code above in your browser using DataLab