Learn R Programming

smacof (version 2.1-7)

Procrustes: Procrustean Similarity Transformations

Description

Solves the Procrustean problem of fitting one (MDS) configuration (testee) to another (target) MDS configuration.

Usage

Procrustes(X, Y)

# S3 method for procr plot(x, plot.type = "jointplot", plot.dim = c(1,2), main, xlab, ylab, xlim, ylim, asp = 1, pch = 20, col.X = "cadetblue", col.Y = "gray", col.Yhat = "coral1", label.conf = list(label = TRUE, pos = 3, cex = 0.8), arrows = TRUE, length = 0.10, legend = list(plot = TRUE, labels = c("Target", "Testee"), pos = "bottomright"), ...)

Value

Returns an object of class procr with:

X

Input target configuration

Y

Input testee configuration

Yhat

Procrustes transformed (fitted) configuration

translation

Translation vector

dilation

Dilation factor

rotation

Rotation-reflection matrix

confdistX

Configuration distances X

confdistY

Configuration distances Y

confdistYhat

Configuration distances of fitted configuration

congcoef

Congruence coefficient

aliencoef

Alienation coefficient

r

Correlation coefficient between X and Y-hat (shrinkage ratio)

pairdist

Pairwise object distances (sorted)

Arguments

X

Target configuration

Y

Testee configuration

x

Object of class procr

plot.type

Either "jointplot" or "transplot"

plot.dim

Vector with dimensions to be plotted.

main

Plot title.

xlab

Label of x-axis.

ylab

Label of y-axis.

xlim

Scale x-axis.

ylim

Scale y-axis.

pch

Plot symbol.

asp

Aspect ratio.

col.X

Color target configuration.

col.Y

Color testee configuration.

col.Yhat

Color transformed configuration.

label.conf

List with arguments for plotting the labels of the configurations in a configuration plot (logical value whether to plot labels or not, label position, label color).

length

length of the edges of the arrow head (in inches).

arrows

For "transplot" only, whether arrows should be plotted or not.

legend

List with arguments for plotting the legend.

...

Additional plot arguments.

Details

Y is going to be modified by finding an optimal dilation factor, an optimal translation and rotation for Y such that it is a similar as possible to X. X remains untouched.

References

Borg, I., & Groenen, P. J. F. (2005). Modern Multidimensional Scaling and Unfolding (2nd ed.). Springer.

Mair, P., Groenen, P. J. F., De Leeuw, J. (2022). More on multidimensional scaling in R: smacof version 2, Journal of Statistical Software, 102(10), 1-47. tools:::Rd_expr_doi("10.18637/jss.v102.i10")

Borg, I. and Mair, P. (2022). A note on Procrustean fittings of noisy configurations. Austrian Journal of Statistics, 51, 1-9. tools:::Rd_expr_doi("10.17713/ajs.v51i4.1423")

Examples

Run this code
## artificial example:
X <- matrix(c(1, -1, -1, 1, 2, 2, -2, -2), ncol = 2)
Y <- matrix(c(0.07, 0.93, 1.93, 1.07, 2.62, 3.12, 1.38, 0.88), ncol = 2)
op <- par(mfrow = c(1,2))
plot(X[,1], X[,2], xlim = c(-3, 3), ylim = c(-2, 3.5), asp = 1, xlab = "", ylab = "")
rect(-1, -2, 1, 2)
points(Y[,1], Y[,2], xlim = c(-3, 3), col = "gray")
polygon(Y[,1], Y[,2], border = "gray")
fitp <- Procrustes(X, Y)
plot(fitp$Yhat[,1], fitp$Yhat[,2], col = "red", xlim = c(-3, 3), ylim = c(-2, 3.5), 
     asp = 1, xlab = "", ylab = "")
polygon(fitp$Yhat[,1], fitp$Yhat[,2], border = "red")
par(op)

## MDS example:
eastD <- sim2diss(EW_eng$east)
attr(eastD, "Labels") <- abbreviate(attr(eastD, "Labels"))
fit.east <- mds(eastD, type = "ordinal")
westD <- sim2diss(EW_eng$west)
attr(westD, "Labels") <- abbreviate(attr(westD, "Labels"))
fit.west <- mds(westD, type = "ordinal", init = torgerson(eastD))

fit.proc <- Procrustes(fit.east$conf, fit.west$conf)
fit.proc

## Configuration plots; Procrustes plots.
plot(fit.east, main = "MDS East Germany")   ## MDS plot East Germany
plot(fit.west, main = "MDS West Germany")   ## MDS plot West Germany

## Procrustes configurations (X and Yhat)
plot(fit.proc, ylim = c(-1, 1),  col.X = "cadetblue", col.Yhat = "brown", pch = 19, 
    legend = list(pos = "topleft", labels = c("East Germany", "West Germany"))) 
    
## Procrustes transformations (Y and Yhat)
plot(fit.proc, plot.type = "transplot", length = 0.05, ylim = c(-1,1), 
     legend = list(pos = "bottomright", 
     labels = c("West Germany (untransformed)", "West Germany (transformed)")))

Run the code above in your browser using DataLab