simOrtho {whitening} | R Documentation |
Simulate Random Orthogonal Matrix
Description
simOrtho
generates a random orthogonal matrix.
Usage
simOrtho(d, nonNegDiag = FALSE)
Arguments
d |
The dimension of the orthogonal matrix. |
nonNegDiag |
force the elements on the diagonal to be nonnegative (default: FALSE). |
Details
The algorithm is based on QR decomposition of a random matrix, see Section 3 page 404 in Stewart (1980).
Value
simOrtho
returns a real matrix of size d
times d
.
Author(s)
Korbinian Strimmer (https://strimmerlab.github.io).
References
G.W. Stewart. 1980. The efficient generation of random orthogonal matrices with an application to condition estimators. SIAM J. Numer. Anal. 17:403-409. <DOI:10.1137/0717034>
See Also
Examples
# load whitening library
library("whitening")
# simulate random orthogonal matrix
Q = simOrtho(4) # matrix of dimension 4x4
Q
zapsmall( crossprod(Q) )
zapsmall( tcrossprod(Q) )
[Package whitening version 1.4.0 Index]