rustiefel {rstiefel} | R Documentation |
Siumlate a random orthonormal matrix from the uniform distribution on the Stiefel manifold.
rustiefel(m, R)
m |
the length of each column vector. |
R |
the number of column vectors. |
an m*R
orthonormal matrix.
Peter Hoff
Hoff(2007)
## The function is currently defined as
function (m, R)
{
X <- matrix(rnorm(m * R), m, R)
tmp <- eigen(t(X) %*% X)
X %*% (tmp$vec %*% sqrt(diag(1/tmp$val, nrow = R)) %*% t(tmp$vec))
}