A square matrix containing numeric or complex values.
power
A numeric value giving the power (exponent) to which x should
be raised.
complexOK
Logical value indicating whether the result is allowed to be complex.
Value
A matrix of the same size as x containing
numeric or complex values.
Details
These functions raise the matrix x to the desired power:
matrixsqrt takes the square root, matrixinvsqrt takes
the inverse square root, and matrixpower takes the specified
power of x.
Up to numerical error, matrixpower(x, 2) should be equivalent
to x %*% x, and matrixpower(x, -1) should be
equivalent to solve(x), the inverse of x.
The square root y <- matrixsqrt(x) should satisfy
y %*% y = x. The inverse square root
z <- matrixinvsqrt(x) should satisfy z %*% z = solve(x).
Computations are performed using the eigen decomposition
(eigen).