Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

randomOrthogonalMatrix

Random orthogonal matrix


Description

Generate a random orthogonal basis matrix of dimension (nrow x ncol) using the method in Heiberger (1978).

Usage

randomOrthogonalMatrix(nrow, ncol, n = nrow, d = ncol, seed = NULL)

Arguments

nrow

the number of rows of the resulting orthogonal matrix.

ncol

the number of columns of the resulting orthogonal matrix.

n

deprecated. See nrow above.

d

deprecated. See ncol above.

seed

an optional integer argument to use in set.seed() for reproducibility. By default the current seed will be used. Reproducibility can also be achieved by calling set.seed() before calling this function.

Details

The use of arguments n and d is deprecated and they will be removed in the future.

Value

An orthogonal matrix of dimension nrow x ncol such that each column is orthogonal to the other and has unit lenght. Because of the latter, it is also called orthonormal.

References

Heiberger R. (1978) Generation of random orthogonal matrices. Journal of the Royal Statistical Society. Series C (Applied Statistics), 27(2), 199-206.

See Also

Examples

B <- randomOrthogonalMatrix(10,3)
zapsmall(crossprod(B))

mclust

Gaussian Mixture Modelling for Model-Based Clustering, Classification, and Density Estimation

v5.4.10
GPL (>= 2)
Authors
Chris Fraley [aut], Adrian E. Raftery [aut] (<https://orcid.org/0000-0002-6589-301X>), Luca Scrucca [aut, cre] (<https://orcid.org/0000-0003-3826-0484>), Thomas Brendan Murphy [ctb] (<https://orcid.org/0000-0002-5668-7046>), Michael Fop [ctb] (<https://orcid.org/0000-0003-3936-2757>)
Initial release
2022-05-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.