powered by
Computes the root of the Gramian X^TX.
root.matrix.crossprod(X)
a symmetric matrix V where V^2 equals X^TX
V
V^2
X^TX
a matrix
set.seed(1) n <- 100 p <- 3 X <- matrix(rnorm(n*p),nrow=n, ncol=p) test <- root.matrix.crossprod(X) ## control results t(X) %*% X test %*% test
Run the code above in your browser using DataLab