orthogonal_procrustes(A, B, check_finite=True)
Given matrices A and B of equal shape, find an orthogonal matrix R that most closely maps A to B using the algorithm given in .
Note that unlike higher level Procrustes analyses of spatial data, this function only uses orthogonal transformations like rotations and reflections, and it does not use scaling or translation.
Matrix to be mapped.
Target matrix.
Whether to check that the input matrices contain only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
If the input array shapes don't match or if check_finite is True and the arrays contain Inf or NaN.
The matrix solution of the orthogonal Procrustes problem. Minimizes the Frobenius norm of (A @ R) - B
, subject to R.T @ R = I
.
Sum of the singular values of A.T @ B
.
Compute the matrix solution of the orthogonal Procrustes problem.
>>> from scipy.linalg import orthogonal_procrustes
... A = np.array([[ 2, 0, 1], [-2, 0, 0]])
Flip the order of columns and check for the anti-diagonal mapping
>>> R, sca = orthogonal_procrustes(A, np.fliplr(A))
... R array([[-5.34384992e-17, 0.00000000e+00, 1.00000000e+00], [ 0.00000000e+00, 1.00000000e+00, 0.00000000e+00], [ 1.00000000e+00, 0.00000000e+00, -7.85941422e-17]])
>>> sca 9.0See :
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.linalg._procrustes.orthogonal_procrustes
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.
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