Metric Multidimensional Scaling
Introduction
Metric MDS (also called classical MDS or principal coordinates analysis) takes a distance matrix and produces a low-dimensional configuration whose pairwise Euclidean distances approximate the input distances. It is used for visualisation of similarity or distance data.
Prerequisites
Distance metrics, PCA.
Theory
Given a distance matrix \(D\), form the doubly-centred inner-product matrix \(B = -\frac{1}{2} (I - J/n) D^2 (I - J/n)\). Eigendecompose \(B\); top \(k\) eigenvectors scaled by \(\sqrt{\text{eigenvalue}}\) give the configuration.
For Euclidean distances derived from raw data, classical MDS is equivalent to PCA on the centred data.
Assumptions
Distance matrix; eigenvalues assumed non-negative for Euclidean-embeddable distances.
R Implementation
# Classical MDS on US city distances
data(UScitiesD)
mds <- cmdscale(UScitiesD, k = 2, eig = TRUE)
plot(mds$points, type = "n")
text(mds$points, labels = labels(UScitiesD))
# Eigenvalues and variance explained
mds$eig[1:5]
cumsum(mds$eig[1:5] / sum(mds$eig[1:5]))Output & Results
2D coordinates approximating inter-city distances; eigenvalues indicate dimensional importance.
Interpretation
“Classical MDS on 10 US-city distances produced a 2D configuration where the east-west and north-south structure was immediately visible.”
Practical Tips
- Stress value measures fit; lower is better.
- Use only the positive eigenvalues for the configuration.
- For non-Euclidean distances (network, genetic), consider non-metric MDS.
- In ecology / microbiome, this is called principal coordinates analysis (PCoA).
- Add Procrustes analysis to align MDS solutions across datasets.