matrixpwr | 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 and some help on using R for time series analysis can be found at https://nickpoison.github.io/.
# 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(.2, .8) %*% (P %^% 50)
# Inverse square root
var(econ5) %^% -.5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.