matrix_power: Matrix power calculation

Description Usage Arguments Examples

Description

Calculate the nth power of a square matrix. When the given matrix is a Markov chain transition matrix, this is equivalent to the n-step transition matrix.

Usage

1
matrix_power(mat, n)

Arguments

mat

a square matrix

n

the power

Examples

1
2
3
x <- matrix(c(1:9), ncol=3)
matrix_power(mat=x, n=1)
matrix_power(mat=x, n=2)

ajohns24/MacBayes documentation built on May 19, 2019, 12:41 a.m.