Align paired configurations by rotation, translation and optional scaling. Work through a proper-rotation example and distinguish geometric fit from economic meaning.
Procrustes analysis
Procrustes analysis aligns corresponding points in two configurations by choosing transformations that minimise their mismatch. Depending on the variant, those transformations can include translation, rotation, reflection and uniform rescaling. In quant research, it can help compare two asset or factor representations when a change of coordinate orientation obscures how similar their geometry is.
The essential input is correspondence: row i in one configuration must represent the same object as row i in the other. Aligning two asset maps requires matching asset identities first. Procrustes does not discover an unknown pairing merely because the matrices have the same dimensions.
Decide what the alignment may remove
Removing translation treats the origin as arbitrary. Removing rotation treats the orientation of the axes as arbitrary. Allowing reflection also discards handedness; allowing uniform scaling discards overall size. These choices determine what a small residual means.
For a size-preserving alignment, put n paired points in the rows of A,B∈Rn×d and solve
Q,tmin∥AQ+1t−B∥F2,Q⊤Q=I.
Here t is a row vector, 1 is the n-component column of ones, and the Frobenius norm squared sums the squared coordinate errors over all pairs. There is no rescaling in this objective. An orthogonal matrix preserves distances, but may have determinant −1 and include a reflection. If reflections are forbidden, add det(Q)=+1: the proper or constrained orthogonal problem. Lawrence, Bernal and Witzgall distinguish these constraints explicitly.
Coordinate units and weights matter. Equal weighting of raw dollar and basis-point coordinates has a different meaning from equal weighting after standardisation. A residual is interpretable only alongside the metric, permitted transformations and normalisation convention.
A triangle that moves without changing size
Take three synthetic, dimensionless paired points:
Pair
Input A
Target B
1
(0,0)
(2,3)
2
(1,0)
(2,2)
3
(0,1)
(3,3)
For this example, allow translation and a proper rotation only: no rescaling and no reflections. With points stored as rows, the transformation is
Q=(01−10),t=(2,3),B=AQ+1t.
Right-multiplication by this Q sends (x,y) to (y,−x), a clockwise 90∘ rotation. The row-coordinate convention matters: applying the same displayed matrix on the left to column vectors would turn the other way.
To recover the transformation rather than assume it, first subtract each configuration's centroid:
aˉ=(1/3,1/3),bˉ=(7/3,8/3),Ac=A−1aˉ,Bc=B−1bˉ.
The translation disappears, leaving AcQ=Bc. Compute a singular value decomposition of the cross-product:
Ac⊤Bc=(−1/32/3−2/31/3)=UΣV⊤.
For the unrestricted orthogonal problem, a minimiser is UV⊤. To require determinant +1, use
Q=Udiag(1,…,1,det(UV⊤))V⊤.
The Kabsch–Umeyama result gives this determinant correction; these formulas use the row-coordinate convention above. Here it recovers exactly the displayed Q, which already has determinant +1. Restore translation using
t=bˉ−aˉQ=(2,3).
Every fitted point now equals its target, so the summed squared residual is 0. The three pairwise distances remain 1, 1 and 2. Nothing was stretched to improve the match.
Three dimensionless paired points A at (0,0), (1,0), (0,1) align with B at (2,3), (2,2), (3,3). After centring and a clockwise 90 degree rotation, fitted circles coincide with target squares. No rescaling or reflection; restored translation is (2,3), and squared residual is zero.
Original synthetic example. The left panel shows the two raw configurations; the right shows the centred target and rotated centred input coinciding. Each panel uses equal horizontal and vertical scales.
For the underlying factorisation and its geometry, see Singular Value Decomposition: A = UΣVᵀ. The public page is a preview; the full lesson requires membership.
Two SciPy functions, two output conventions
The similarly named functions answer different questions:
An orthogonal matrix mapping the first input towards the second, including possible reflections. It neither centres nor rescales the inputs. Its returned scale is the sum of the cross-product's singular values, not a fitted dilation. Centre the data yourself when fitting translation; a proper-rotation constraint needs separate enforcement.
Standardised configurations and a squared-error disparity. It centres and initially normalises both inputs, then fits the second towards the first with scaling and orthogonal transformations, including reflections. Only the first returned configuration is guaranteed to have squared Frobenius norm one.
The first function's scale is 4/3 for the centred triangle, even though the example uses no rescaling. The second returns zero disparity up to floating-point error, but its coordinates are standardised rather than the original table's coordinates. Raw squared residuals, mean errors and normalised disparities should not be compared as though they were the same statistic.
What the fit establishes
A small residual says that the paired geometry is close under the permitted transformations. It does not establish that two embeddings have the same economic interpretation, capture causal factors or give interchangeable forecasts. For example, rotating axes labelled with specific risk factors changes how coordinates relate to those labels, even while preserving distances.
An arbitrary regression coefficient matrix can shear and stretch different directions independently. That is a different mapping from the orthogonal or uniform-scale transformations specified here. Likewise, factor rotation concerns re-expressing a factor model; Procrustes fits an alignment to a supplied target configuration. The algebra overlaps, but the target and interpretation differ.