########## 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
Run the code above in your browser using DataLab