hhh4contacts (version 0.13.1)

stationary: Stationary Distribution of a Transition Matrix

Description

This auxiliary function determines the stationary distribution from a transition matrix.

Usage

stationary(P)

Value

the stationary probability vector.

Arguments

P

a transition matrix, i.e., a square matrix where all rows sum to 1.

Author

Leonhard Held

Examples

Run this code
Cgrouped_norm <- contactmatrix(normalize = TRUE)
Cgrouped_norm
(p <- stationary(Cgrouped_norm))
(Cpowered <- make_powerC(Cgrouped_norm)(1e6))
stopifnot(all.equal(Cpowered[1,], p))

Run the code above in your browser using DataLab