bundles / scipy latest / scipy / stats / _multivariate / special_ortho_group_gen
class
scipy.stats._multivariate:special_ortho_group_gen
Signature
class special_ortho_group_gen ( seed = None ) Members
Summary
A Special Orthogonal matrix (SO(N)) random variable.
Extended Summary
Return a random rotation matrix, drawn from the Haar distribution (the only uniform distribution on SO(N)) with a determinant of +1.
The dim keyword specifies the dimension N.
Parameters
dim: scalarDimension of matrices
seed: {None, int, np.random.RandomState, np.random.Generator}, optionalUsed for drawing random variates. If
seedisNone, the~np.random.RandomStatesingleton is used. Ifseedis an int, a newRandomStateinstance is used, seeded with seed. Ifseedis already aRandomStateorGeneratorinstance, then that object is used. Default isNone.
Methods
rvs(dim=None, size=1, random_state=None)Draw random samples from SO(N).
Notes
The rvs method returns a random rotation matrix drawn from the Haar distribution, the only uniform distribution on SO(N). The algorithm generates a Haar-distributed orthogonal matrix in O(N) using the rvs method of ortho_group, then adjusts the matrix to ensure that the determinant is +1.
For a random rotation in three dimensions, see scipy.spatial.transform.Rotation.random.
Examples
import numpy as np from scipy.stats import special_ortho_group x = special_ortho_group.rvs(3)✓
np.dot(x, x.T)
✗import scipy.linalg
✓scipy.linalg.det(x)
✗rv = special_ortho_group(5)
✓See also
- ortho_group
- scipy.spatial.transform.Rotation.random
Aliases
-
scipy.stats._multivariate.special_ortho_group_gen