bundles / scipy 1.17.1 / scipy / stats / _multivariate / ortho_group_gen
class
scipy.stats._multivariate:ortho_group_gen
Signature
class ortho_group_gen ( seed = None ) Members
Summary
An Orthogonal matrix (O(N)) random variable.
Extended Summary
Return a random orthogonal matrix, drawn from the O(N) Haar distribution (the only uniform distribution on O(N)).
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 O(N).
Notes
This class is closely related to special_ortho_group.
Some care is taken to avoid numerical error, as per the paper by Mezzadri.
Examples
import numpy as np from scipy.stats import ortho_group x = ortho_group.rvs(3)✓
np.dot(x, x.T)
✗import scipy.linalg
✓np.fabs(scipy.linalg.det(x))
✗rv = ortho_group(5)
✓See also
- special_ortho_group
Aliases
-
scipy.stats._multivariate.ortho_group_gen