Learn R Programming

corpcor (version 1.5.2)

mpower: Compute the Power of a Real Symmetric Matrix

Description

mpower computes $m^alpha$, i.e. the alpha-th power of the real symmetric matrix m.

Usage

mpower(m, alpha)

Arguments

m
a real-valued symmetric matrix.
alpha
exponent.

Value

  • mpower returns a matrix of the same dimensions as m.

Details

The matrix power of m is obtained by first computing the spectral decomposition of m, and subsequent modification of the resulting eigenvalues.

Note that m is assumed to by symmetric, and only its lower triangle (diagonal included) is used in eigen.

For computing the matrix power of cor.shrink use the vastly more efficient function powcor.shrink.

See Also

powcor.shrink, eigen.

Examples

Run this code
# load corpcor library
library("corpcor")

# generate symmetric matrix
p = 10
n = 20
X = matrix(rnorm(n*p), nrow = n, ncol = p)
m = cor(X)

m %*% m
mpower(m, 2)

solve(m)
mpower(m, -1)

msq = mpower(m, 0.5)
msq %*% msq
m

mpower(m, 1.234)

Run the code above in your browser using DataLab