rustiefel: Siumlate a Uniformly Distributed Random Orthonormal Matrix

Description Usage Arguments Value Author(s) References Examples

View source: R/rustiefel.R

Description

Siumlate a random orthonormal matrix from the uniform distribution on the Stiefel manifold.

Usage

1
rustiefel(m, R)

Arguments

m

the length of each column vector.

R

the number of column vectors.

Value

an m*R orthonormal matrix.

Author(s)

Peter Hoff

References

Hoff(2007)

Examples

1
2
3
4
5
6
7
## 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))
  }

rstiefel documentation built on June 12, 2018, 5:19 p.m.