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

rsop

Random sample of matrices in SO(p)


Description

Random sample of matrices in SO(p).

Usage

rsop(n, p)

Arguments

n

The sample size, the number of matrices you want to generate.

p

The dimensionality of the matrices.

Details

The idea is very simple. Start with a unit vector pointing at the north pole (1,0,...,0). Then generate random numbers from a standard normal and scale them so that they have a unit length. To put it differently, a sample of n values from the uniform distribution on the sphere is generated. Then calculate the rotation matrix required to go from the north pole to each of a generated vector.

Value

If n = 1 one matrix is returned. If n is greater than 1, an array with n matrices inside.

Author(s)

Michail Tsagris R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Giorgos Athineou <gioathineou@gmail.com>

References

G. J. A. Amaral, I. L. Dryden & Andrew T. A. Wood (2007). Pivotal Bootstrap Methods for k-Sample Problems in Directional Statistics and Shape Analysis. Journal of the American Statistical Association, 102(478): 695-707.

See Also

Examples

x1 <- rsop(1, 3)
x2 <- rsop(10, 3)
x3 <- rsop(100, 10)

Directional

A Collection of R Functions for Directional Data Analysis

v4.9
GPL-2
Authors
Michail Tsagris, Giorgos Athineou, Anamul Sajib, Eli Amson, Micah J. Waldstein
Initial release
2021-03-26

We don't support your browser anymore

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