Calculates the n-th power of a square matrix, where n can be a
positive or negative integer or a fractional power.
Usage
mpower(A, n)
A %^% n
Value
Returns the matrix \(A^n\)
Arguments
A
A square matrix. Must also be symmetric for non-integer powers.
n
matrix power
Author
Michael Friendly
Details
If n<0, the method is applied to \(A^{-1}\).
When n is an
integer, the function uses the Russian peasant method, or repeated squaring
for efficiency.
Otherwise, it uses the spectral decomposition of A,
\(\mathbf{A}^n = \mathbf{V} \mathbf{D}^n \mathbf{V}^{T}\)
requiring a symmetric matrix.