Tutorials › Exam PA - Predictive Analytics › Why High-Dimensional Distances Become Less Informative

Exam PA · Clustering and Similarity Structure · Tutorial 607 of 966

Why High-Dimensional Distances Become Less Informative

See how distance concentration arises, quantify its effect on neighbor rankings, and identify practical ways to make distance-based analysis more informative.

Intermediate 12 min read

What You'll Learn

  • Define distance concentration and describe the assumptions behind a common squared-distance result.
  • Calculate the mean, variance, and relative variation of squared Euclidean distances.
  • Account for the shared query when comparing distances to two candidate neighbors.
  • Explain why many dimensions can obscure a meaningful nearest-neighbor distinction.
  • Use feature scaling appropriately and recognize when irrelevant variables require selection or reduction.

Why Distance Can Lose Its Meaning

Distance-based methods rely on nearby observations being meaningfully more alike than distant ones. In clustering, for example, a distance can influence assignments, cluster construction, and how a new observation relates to existing groups. But as the number of measured features grows, distances can become increasingly similar in relative terms. A nearest observation may still be mathematically closest, while its advantage over other observations becomes small compared with the overall distances.

This phenomenon is called distance concentration. It is not a claim that every high-dimensional data set has useless distances. Its severity depends on the distributions of the features, their dependence, their scales, and whether they contain useful signal. The key warning is that adding dimensions does not automatically add useful information: many weak, noisy, or redundant features can make distance comparisons harder to interpret.

Definition: Distance concentration is the tendency for distances between observations to become similar relative to their typical size as the number of dimensions increases. For squared Euclidean distance \(D_p=\sum_{j=1}^{p}(X_j-Z_j)^2\), if the coordinate contributions are independent and identically distributed with finite mean \(m>0\) and variance \(\tau^2\), then \(E[D_p]=pm\), \(\operatorname{Var}(D_p)=p\tau^2\), and the coefficient of variation is \(\tau/(m\sqrt{p})\). Thus, relative variation in squared distances decreases as \(p\) grows.

The assumptions in this definition matter. Independence and identical distributions give the simple variance formula. Correlation among features changes the variance of the sum; unequal distributions mean the coordinate contributions need not share the same mean or variance. If features have very different units or scales, a few coordinates can dominate the distance instead of concentration being the main issue. And if added dimensions contain strong, relevant signal, they may improve rather than weaken comparisons.

A Uniform-Coordinate Calculation

A convenient illustration takes two observations whose coordinates are independent draws from a Uniform(0,1) distribution. In one coordinate, write their values as \(Q\) and \(X\), so their squared distance contribution is \(D=(Q-X)^2\). The mean and variance of this contribution can be calculated exactly.

$$ E[D]=\frac{1}{6}, \qquad E[D^2]=\frac{1}{15}, \qquad \operatorname{Var}(D)=\frac{1}{15}-\left(\frac{1}{6}\right)^2=\frac{7}{180}. $$

For \(p\) independent coordinates, the mean squared distance is \(p/6\), and its variance is \(7p/180\). Its standard deviation grows in proportion to \(\sqrt{p}\), while its mean grows in proportion to \(p\). Consequently, its coefficient of variation shrinks in proportion to \(1/\sqrt{p}\). This is the central mechanism: distances may still differ in absolute terms, but those differences become smaller relative to the distance scale.

Worked Example: Quantifying Concentration Across Many Coordinates

Suppose two hypothetical observations have 1,400 independent coordinates, with every coordinate independently distributed as Uniform(0,1). Find the mean and standard deviation of their squared Euclidean distance, then calculate its coefficient of variation. Use the formulas for independent, identically distributed coordinate contributions.

Method. For one coordinate, the squared difference has mean \(1/6\) and variance \(7/180\). Independence across the 1,400 coordinates lets us add means and variances.

Mean. The mean squared distance is \(1{,}400(1/6)=233.3333\).

Variance and standard deviation. The variance is \(1{,}400(7/180)=9{,}800/180=54.4444\). The standard deviation is \(\sqrt{54.4444}\approx7.3786\).

Relative variation. The coefficient of variation is \(7.3786/233.3333\approx0.03162\), or about \(3.162\%\). Equivalently, the formula gives \(\sqrt{(7/180)1{,}400}/(1{,}400/6)=\sqrt{1.4/1{,}400}\).

Check and common mistake. The standard deviation is much smaller than the mean, and their ratio is about \(3.2\%\). The variance of a sum of independent contributions is the sum of their variances, not the sum of their standard deviations. This calculation concerns squared distance; it should not be presented as an exact coefficient of variation for the unsquared Euclidean distance.

Why the Formula Holds

Let \(D_1,\ldots,D_p\) be independent coordinate contributions with the same mean \(m\) and variance \(\tau^2\). Linearity of expectation gives \(E[\sum_jD_j]=\sum_jE[D_j]=pm\). Independence makes every covariance between distinct contributions zero, so the variance of the sum is the sum of the variances, \(p\tau^2\). Dividing the standard deviation \(\sqrt{p}\tau\) by the mean \(pm\) gives \(\tau/(m\sqrt{p})\). The decrease in relative variation follows directly; it is not an additional assumption.

For a nonnegative distance, taking a square root does not remove the effect. When squared distances are concentrated around a positive mean, a first-order approximation gives \(\sqrt{D_p}\) a relative standard deviation roughly half that of \(D_p\). This approximation describes small relative fluctuations; it is not an exact formula for the distribution of Euclidean distance.

The Shared-Query Trap in Nearest-Neighbor Comparisons

A nearest-neighbor comparison asks about two distances from the same query observation. Their coordinate contributions are not generally independent, because both use the same query coordinate. Ignoring this shared value can overstate the variability of the difference between the two distances.

The Uniform(0,1) example makes the dependence explicit. Let \(Q\) be the query coordinate and \(X\) and \(Z\) be independent Uniform(0,1) candidate coordinates, also independent of \(Q\). Set \(A=(Q-X)^2\) and \(B=(Q-Z)^2\). Conditional on \(Q=q\), each expected contribution is \(q^2-q+1/3\). The covariance of \(A\) and \(B\) is the variance of this conditional expectation, which is \(1/180\). Thus the variance of their difference is not simply twice the variance of one contribution.

$$ \operatorname{Var}(A-B) =\operatorname{Var}(A)+\operatorname{Var}(B)-2\operatorname{Cov}(A,B) =2\left(\frac{7}{180}\right)-2\left(\frac{1}{180}\right) =\frac{1}{15}. $$

For completeness, the conditional expectation \(h(Q)=Q^2-Q+1/3\) has mean \(1/6\). Expanding its square gives \(E[h(Q)^2]=1/30\), so \(\operatorname{Var}(h(Q))=1/30-(1/6)^2=1/180\). This is the covariance just used. The shared query coordinate induces positive covariance: when the query is in a position that tends to make both candidate distances large, it tends to affect both together.

Worked Example: A Small Neighbor Advantage Among Many Added Features

In two observed coordinates, candidate A has squared distance \(1.00\) from a query, while candidate B has squared distance \(1.50\). Now add 98 coordinates. For each added coordinate, the query and both candidates have independent Uniform(0,1) values; the same query value is used to calculate both candidate distances. Estimate the probability that B ends up closer after the added coordinates are included. Use a normal approximation for the sum of 98 contributions, and state its limitation.

Method. Let the added squared-distance totals be \(T_A\) and \(T_B\). In each added coordinate, both candidates have the same expected squared contribution, \(1/6\), so \(E[T_A-T_B]=0\). The observed two-coordinate advantage for A is \(0.50\); B becomes closer if \(T_A-T_B>0.50\).

Account for the shared query. From the one-coordinate derivation, the variance of the difference between the two candidates' contributions is \(1/15\), not \(2(7/180)\). Across 98 independent query-coordinate pairs, \(\operatorname{Var}(T_A-T_B)=98/15=6.5333\), and its standard deviation is \(\sqrt{98/15}\approx2.5560\).

Approximate the reversal probability. By a normal approximation to the sum of 98 independent, bounded coordinate differences, \(T_A-T_B\) is approximated by \(N(0,98/15)\). Therefore,

$$ P(T_A-T_B>0.50) \approx 1-\Phi\left(\frac{0.50}{2.5560}\right) =1-\Phi(0.1956) \approx 0.4224. $$

Check and common mistake. The approximated probability is below one-half because A begins with a \(0.50\) advantage, but it is still substantial: random added dimensions can readily reverse the ranking. Treating the two totals as independent would give variance \(98(14/180)=7.6222\) and standard deviation about \(2.7608\), overstating the variability. The normal probability is an approximation, not an exact probability; the exact difference is a sum of bounded, non-normal contributions.

Scaling, Selection, and Reduction

Distance concentration and scale imbalance are distinct problems. Euclidean distance squares raw coordinate differences, so a variable measured in large units can dominate even when it is not more important. Standardization can address unit differences, but it does not make irrelevant features useful. If many uninformative coordinates remain, their accumulated contributions can still obscure the distinctions that matter.

Worked Example: How Scaling Changes the Nearest Candidate

A hypothetical clustering analysis compares a query with two candidate accounts using age and annual mileage. The query is age 40 and has annual mileage 10,000. Candidate A is age 42 with mileage 20,000; candidate B is age 50 with mileage 15,000. The training data have standard deviations of 10 years for age and 10,000 miles for mileage. Compare nearest candidates using raw Euclidean distance and then using the specified standardized coordinates.

Raw distances. For A, squared distance is \((42-40)^2+(20{,}000-10{,}000)^2=4+100{,}000{,}000=100{,}000{,}004\). For B, it is \((50-40)^2+(15{,}000-10{,}000)^2=100+25{,}000{,}000=25{,}000{,}100\). Raw distance ranks B as closer.

Standardized distances. Divide each coordinate difference by its training standard deviation. For A, the squared distance is \((2/10)^2+(10{,}000/10{,}000)^2=0.04+1=1.04\). For B, it is \((10/10)^2+(5{,}000/10{,}000)^2=1+0.25=1.25\). Standardized distance ranks A as closer.

Check and common mistake. The rankings differ because raw mileage differences dominate the raw calculation, while standardization gives the two variables comparable scale. Standardization should use quantities estimated from the training data and then be applied consistently to new observations. It is not a guarantee that the resulting features are relevant, independent, or equally informative.

A practical response to weak distance distinctions is to examine the variables before relying on a distance-based method. The earlier material on redundant predictors highlights why duplicating similar information can give that information extra influence. Other useful responses include selecting features based on the analysis objective, removing clearly uninformative variables, and using a lower-dimensional representation when it preserves meaningful structure. Feature reduction requires its own judgment: discarding dimensions can remove noise, but it can also discard signal.

1
Check the distance definition.
Confirm that the chosen distance is appropriate for the feature types and that its behavior is understood.
2
Inspect units and redundancy.
Identify variables with much larger scales and features that repeat similar information.
3
Consider relevance and dimension.
Evaluate whether each feature contributes useful distinction; consider selection or reduction when many features add mostly noise.
4
Reassess the resulting structure.
Compare distance behavior and clustering results under reasonable feature choices, and describe conclusions as sensitive if they change materially.

Interpretation and Exam Traps

Distance concentration is a warning about interpretation, not a rule that clustering must fail above a particular number of features. A small relative spread in distances means the nearest and farthest observations may be less separated proportionally. It does not, by itself, prove that a clustering result is wrong or that a particular feature should be removed. The analyst must consider the feature distributions, the objective, and whether the resulting groups are useful and stable.

  • Adding dimensions is not automatically adding information. Noise can accumulate and dilute a small difference in relevant coordinates.
  • Do not assume candidate distances are independent. When comparing two candidates to one query, the shared query can induce covariance.
  • Do not confuse scaling with feature selection. Scaling adjusts units; it does not eliminate irrelevant information.
  • Do not state the independence formula without its assumptions. Correlated coordinate contributions add covariance terms to the variance.
Key takeaway: Under independent, similarly distributed coordinate contributions, relative variation in squared Euclidean distances decreases as dimension grows. In nearest-neighbor comparisons, account for the shared query; in practice, investigate scale, redundancy, and relevance before trusting small distance differences.

Check Your Understanding

For each problem, identify the assumptions needed and check whether the requested quantity is a distance, squared distance, or difference between two distances.

  1. Two observations have 500 independent Uniform(0,1) coordinates. Find the mean, variance, standard deviation, and coefficient of variation of their squared Euclidean distance. (Answer: mean \(=83.3333\), variance \(=19.4444\), standard deviation \(\approx4.4096\), coefficient of variation \(\approx0.0529\).)
  2. Under the same independent Uniform(0,1) assumptions, calculate the mean and standard deviation of squared Euclidean distance for 75 coordinates. (Answer: mean \(=12.5\), variance \(=35/12\approx2.9167\), standard deviation \(\approx1.7078\).)
  3. A query and two independent Uniform(0,1) candidates share the same query value in each of 30 independent coordinates. Find the variance and standard deviation of the difference between the candidates' total squared distances. (Answer: variance \(=30/15=2\), standard deviation \(=\sqrt{2}\approx1.4142\).)
  4. Use the age-and-mileage data in the scaling example, with training standard deviations of 10 years and 10,000 miles. Which candidate is closer before scaling, and which is closer after standardization? (Answer: B is closer before scaling; A is closer after standardization.)
  5. For 20 added independent Uniform(0,1) coordinates with a shared query, what are the variance and standard deviation of the difference between two candidates' added squared-distance totals? (Answer: variance \(=20/15=4/3\), standard deviation \(=\sqrt{4/3}\approx1.1547\).)
Clinical Biostats