Compute the square-root and inverse square-root of a non-negative definite matrix.
factor_covariance(S, rank = NA)
S
matrix
rank
rank of svd