matrixpwr {astsa} | R Documentation |
matrixpwr
computes powers of a square matrix, including negative powers for nonsingular matrices.
%^%
is a more intuitive interface as an operator.
matrixpwr(A, power) A %^% power
A |
a square matrix |
power |
single numeric |
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.
Returns matrix raised to the given power.
D.S. Stoffer
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/.
# 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