| Statistics Toolbox | ![]() |
Syntax
Description
d = procrustes(X,Y)
determines a linear transformation (translation, reflection, orthogonal rotation, and scaling) of the points in matrix Y to best conform them to the points in matrix X. The "goodness-of-fit" criterion is the sum of squared errors. procrustes returns the minimized value of this dissimilarity measure in d. d is standardized by a measure of the scale of X, given by
i.e., the sum of squared elements of a centered version of X. However, if X comprises repetitions of the same point, the sum of squared errors is not standardized.
X and Y must have the same number of points (rows), and procrustes matches the ith point in Y to the ith point in X. Points in Y can have smaller dimension (number of columns) than those in X. In this case, procrustes adds columns of zeros to Y as necessary.
[d,Z] = procrustes(X,Y)
also returns the transformed Y values.
[d,Z,transform] = procrustes(X,Y)
also returns the transformation that maps Y to Z. transform is a structure with fields:
| c |
Translation component |
| T |
Orthogonal rotation and reflection component |
| b |
Scale component |
That is, Z = transform.b * Y * transform.T + transform.c.
Examples
This example creates some random points in two dimensions, then rotates, scales, translates, and adds some noise to those points. It then uses procrustes to conform Y to X, and plots the original X and Y, and the transformed Y.
X = normrnd(0,1,[10 2]); S = [0.5 -sqrt(3)/2; sqrt(3)/2 0.5]; Y = normrnd(0.5*X*S + 2,0.05,size(X)); [d,Z,tr] = procrustes(X,Y); plot(X(:,1),X(:,2),'rx',... Y(:,1),Y(:,2),'b.',... Z(:,1),Z(:,2),'bx');
See Also
References
[1] Seber, G.A.F., Multivariate Observations, Wiley, 1984
[2] Bulfinch, T., The Age of Fable; or, Stories of Gods and Heroes, Sanborn, Carter, and Bazin, Boston, 1855.
| princomp | qqplot | ![]() |