ArticleslgStudy

mathematics

Distance correlation

Distance correlation is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Distance correlation rather than just read about it. In short: In statistics and in probability theory, distance correlation is a measure of dependence between two paired random vectors of arbitrary, not necessarily equal, dimension. The population distance correlation coefficient is zero if and only if the random vectors are independent.

Distance correlation — main illustration
Distance correlation — illustration

Key takeaways

  • Distance correlation belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Distance correlation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Distance correlation from memory before moving on to harder problems.

Reference excerpt

In statistics and in probability theory, distance correlation is a measure of dependence between two paired random vectors of arbitrary, not necessarily equal, dimension. The population distance correlation coefficient is zero if and only if the random vectors are independent. Thus, distance correlation measures both linear and nonlinear association between two random variables or random vectors. This is in contrast to Pearson's correlation, which can only detect linear association between two random variables. Distance correlation can be used to perform a statistical test of dependence with a permutation test. One first computes the distance correlation (involving the re-centering of Euclidean distance matrices) between two random vectors, and then compares this value to the distance correlations of many shuffles of the data.

Background The classical measure of dependence, the Pearson correlation coefficient, is mainly sensitive to a linear relationship between two variables. Distance correlation was introduced in 2005 by Gábor J. Székely in several lectures to address this deficiency of Pearson's correlation, namely that it can easily be zero for dependent variables. Correlation = 0 (uncorrelatedness) does not imply independence while distance correlation = 0 does imply independence. The first results on distance correlation were published in 2007 and 2009. It was proved that distance covariance is the same as the Brownian covariance. These measures are examples of energy distances. The distance correlation is derived from a number of other quantities that are used in its specification, specifically: distance variance, distance standard deviation, and distance covariance. These quantities take the same roles as the ordinary moments with corresponding names in the specification of the Pearson product-moment correlation coefficient.

Definitions

Distance covariance Let us start with the definition of the sample distance covariance. Let (Xk, Yk), k = 1, 2, ..., n be a statistical sample from a pair of real valued or vector valued random variables (X, Y). First, compute the n by n distance matrices (aj, k) and (bj, k) containing all pairwise distances

aj,k=‖Xj−Xk‖,j,k=1,2,…,n,bj,k=‖Yj−Yk‖,j,k=1,2,…,n, where ||⋅ ||denotes Euclidean norm. Then take all doubly centered distances

Aj,k:=aj,k−a‾j⋅−a‾⋅k+a‾⋅⋅,Bj,k:=bj,k−b‾j⋅−b‾⋅k+b‾⋅⋅, where a‾j⋅ is the j-th row mean, a‾⋅k is the k-th column mean, and a‾⋅⋅ is the grand mean of the distance matrix of the X sample. The notation is similar for the b values. (In the matrices of centered distances (Aj, k) and (Bj,k) all rows and all columns sum to zero.) The squared sample distance covariance (a scalar) is simply the arithmetic average of the products Aj, k Bj, k:

dCovn2(X,Y):=1n2∑j=1n∑k=1nAj,kBj,k. The statistic Tn = n dCov2n(X, Y) determines a consistent multivariate test of independence of random vectors in arbitrary dimensions. For an implementation see dcov.test function in the energy package for R. The population value of distance covariance can be defined along the same lines. Let X be a random variable that takes values in a p-dimensional Euclidean space with probability distribution μ and let Y be a random variable that takes values in a q-dimensional Euclidean space with probability distribution ν, and suppose that X and Y have finite expectations. Write

aμ(x):=E⁡[‖X−x‖],D(μ):=E⁡[aμ(X)],dμ(x,x′):=‖x−x′‖−aμ(x)−aμ(x′)+D(μ). Finally, define the population value of squared distance covariance of X and Y as

dCov2(X,Y):=E⁡[dμ(X,X′)dν(Y,Y′)]. One can show that this is equivalent to the following definition:

dCov2(X,Y):=E⁡[‖X−X′‖‖Y−Y′‖]+E⁡[‖X−X′‖]E⁡[‖Y−Y′‖]−E⁡[‖X−X′‖‖Y−Y″‖]−E⁡[‖X−X″‖‖Y−Y′‖]=E⁡[‖X−X′‖‖Y−Y′‖]+E⁡[‖X−X′‖]E⁡[‖Y−Y′‖]−2E⁡[‖X−X′‖‖Y−Y″‖], where E denotes expected value, and (X,Y), (X′,Y′), and (X″,Y″) are independent and identically distributed. The primed random variables (X′,Y′) and (X″,Y″) denote independent and identically distributed (iid) copies of the variables X and Y and are similarly iid. Distance covariance can be expressed in terms of the classical Pearson's covariance, cov, as follows:

dCov2(X,Y)=cov⁡(‖X−X′‖,‖Y−Y′‖)−2cov⁡(‖X−X′‖,‖Y−Y″‖). This identity shows that the distance covariance is not the same as the covariance of distances, cov(‖X − X' ‖, ‖Y − Y' ‖). This can be zero even if X and Y are not independent. Alternatively, the distance covariance can be defined as the weighted L2 norm of the distance between the joint characteristic function of the random variables and the product of their marginal characteristic functions:

dCov2(X,Y)=1cpcq∫ℝp+q|φX,Y(s,t)−φX(s)φY(t)|2|s|p1+p|t|q1+qdtds where φX,Y(s,t), φX(s), and φY(t) are the characteristic functions of (X, Y), X, and Y, respectively, p, q denote the Euclidean dimension of X and Y, and thus of s and t, and cp, cq are constants. The weight function (cpcq|s|p1+p|t|q1+q)−1 is chosen to produce a scale equivariant and rotation invariant measure that doesn't go to zero for dependent variables. One interpretation of the characteristic function definition is that the variables eisX and eitY are cyclic representations of X and Y with different periods given by s and t, and the expression ϕX, Y(s, t) − ϕX(s) ϕY(t) in the numerator of the characteristic function definition of distance covariance is simply the classical covariance of eisX and eitY. The characteristic function definition clearly shows that dCov2(X, Y) = 0 if and only if X and Y are independent.

Distance variance and distance standard deviation The distance variance is a special case of distance covariance when the two variables are identical. The population value of distance variance is the square root of

dVar2(X):=E⁡[‖X−X′‖2]+E2[‖X−X′‖]−2E⁡[‖X−X′‖‖X−X″‖], where X, X′, and X″ are independent and identically distributed random variables, E denotes the expected value, and f2(⋅)=(f(⋅))2 for function f(⋅), e.g., E2[⋅]=(E⁡[⋅])2. The sample distance variance is the square root of

dVarn2(X):=dCovn2(X,X)=1n2∑k,ℓAk,ℓ2, which is a relative of Corrado Gini's mean difference introduced in 1912 (but Gini did not work with centered distances). The distance standard deviation is the square root of the distance variance.

Distance correlation The distance correlation of two random variables is obtained by dividing their distance covariance by the product of their distance standard deviations. The distance correlation is the square root of

… excerpt ends here. Continue reading the full article.

Illustrations

Distance correlation: Several sets of (x, y) points, with the distance correlation coefficient of x and y for each set. Compare to the graph on correlation
Several sets of (x, y) points, with the distance correlation coefficient of x and y for each set. Compare to the graph on correlation

Worked examples

Example 1 — a first encounter with Distance correlation

Start with the simplest possible case. Write down what Distance correlation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Distance correlation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Distance correlation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Distance correlation

In research
Distance correlation appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Distance correlation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Distance correlation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Covariance and correlation, Statistical distance, Theory of probability distributions, so understanding it makes those chapters shorter.
In everyday life
Look for Distance correlation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Distance correlation” →

How to study Distance correlation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Distance correlation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Distance correlation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Distance correlation in simple terms?

In statistics and in probability theory, distance correlation is a measure of dependence between two paired random vectors of arbitrary, not necessarily equal, dimension. The population distance correlation coefficient is zero if and only if the random vectors are independent.

Why does Distance correlation matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Distance correlation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Distance correlation.

Tags

  • Covariance and correlation
  • Statistical distance
  • Theory of probability distributions

Keep exploring