Loading [MathJax]/extensions/tex2jax.js
scipy 1.10.1 Pypi GitHub Homepage
Other Docs

MethodsNotesParameters

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.

Methods

Notes

This class is closely related to special_ortho_group.

Some care is taken to avoid numerical error, as per the paper by Mezzadri.

Parameters

dim : scalar

Dimension of matrices

seed : {None, int, np.random.RandomState, np.random.Generator}, optional

Used for drawing random variates. If seed is None, the ~np.random.RandomState singleton is used. If seed is an int, a new RandomState instance is used, seeded with seed. If seed is already a RandomState or Generator instance, then that object is used. Default is None.

An Orthogonal matrix (O(N)) random variable.

See Also

special_ortho_group

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))
This generates one random matrix from O(3). It is orthogonal and has a determinant of +1 or -1.
Alternatively, the object may be called (as a function) to fix the `dim` parameter, returning a "frozen" ortho_group random variable:
rv = ortho_group(5)
# Frozen object with the same methods but holding the
# dimension parameter fixed.
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

special_ortho_groupspecial_ortho_group

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/stats/_multivariate.py#3600
type: <class 'type'>
Commit: