matrixpwr {astsa}R Documentation

Powers of a Square Matrix

Description

matrixpwr computes powers of a square matrix, including negative powers for nonsingular matrices.

%^% is a more intuitive interface as an operator.

Usage

matrixpwr(A, power)

A %^% power

Arguments

A

a square matrix

power

single numeric

Details

Raises matrix to the specified power. The matrix must be square and if power < 0, the matrix must be nonsingular.

Note that %^% is defined as "%^%" <- function(A, power) matrixpwr(A, power)

If power = 0, the identity matrix is returned.

Value

Returns matrix raised to the given power.

Author(s)

D.S. Stoffer

References

You can find demonstrations of astsa capabilities at FUN WITH ASTSA.

The most recent version of the package can be found at https://github.com/nickpoison/astsa/.

In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.

The webpages for the texts are https://www.stat.pitt.edu/stoffer/tsa4/ and https://www.stat.pitt.edu/stoffer/tsda/.

Examples

# 2-state Markov transition matrix to steady state
P = matrix(c(.7,.4,.3,.6), 2)       
P %^% 50

# surround with parentheses if used in an expression
c(.5,.5) %*% (P%^%50)

# Inverse square root
Q = var(econ5)
Q %^% -.5

[Package astsa version 1.14 Index]