smpower function

Symmetric Matrix Power

Symmetric Matrix Power

Raise symmetric matrix to specified power. Default calculates symmetric square root.

smpower(X, power = 0.5, tol = NULL)

Arguments

  • X: Symmetric real-valued matrix.
  • power: Power to apply to eigenvalues of X.
  • tol: Stability tolerance for eigenvalues.

Note

Default tolerance is tol = max(dim(X)) * .Machine$double.eps.

Details

Basically returns tcrossprod(Y$vec%*%diag(Y$val^power),Y$vec) where Y = eigen(X,symmetric=TRUE).

Returns

Returns X raised to specified power.

Author(s)

Nathaniel E. Helwig helwig@umn.edu

Examples

########## EXAMPLE ########## X <- crossprod(matrix(rnorm(2000),100,20)) Xsqrt <- smpower(X) # square root Xinv <- smpower(X,-1) # inverse Xisqrt <- smpower(X,-0.5) # inverse square root
  • Maintainer: Nathaniel E. Helwig
  • License: GPL (>= 2)
  • Last published: 2019-03-13

Useful links