Joint Distributions, Covariance, and Correlation
Joint distributions describe how two or more random variables behave together; covariance measures the linear co-movement of and ; correlation is its dimensionless, scale-free normalization confined to . Used everywhere: statistics, finance, signal processing, machine learning. Concepts crystallized by Galton and Pearson (1880s–1890s).
The full joint distribution contains everything about how variables relate, but it is a complicated object (a surface or a table). Covariance and correlation compress that interdependence into a single number capturing only the linear trend. This is both their power (one interpretable scalar) and their danger (they are blind to nonlinear structure). Correlation answers exactly one question: "As rises above its mean, does tend to rise or fall above its mean, and how strongly — measured in standard-deviation units?"
Formal Statement
For two random variables :
Discrete case — the joint PMF is
Derivation hint: probabilities of a complete, mutually exclusive set of outcomes sum to 1.
Continuous case — the joint PDF satisfies
Derivation hint: probability is the volume under the joint density surface over region . The marginal distributions recover each variable alone by summing/integrating out the other:
Derivation hint: collapse the joint over all values of the variable being eliminated (law of total probability). The conditional density is
Derivation hint: restrict to the slice and renormalize so the slice integrates to 1. Here are realized values, are realized values, a region in the plane.
and are independent iff the joint factors into marginals for all :
Derivation hint: substitute the product form into the conditional definition [4]; the marginal cancels.
The covariance of and with means is
Derivation hint: average the product of deviations from the mean — positive when they deviate together, negative when oppositely. An equivalent, computation-friendly form:
Derivation hint: expand the product in [6], use linearity of expectation, and cancel terms. The expectation of a product for the continuous case is
Derivation hint: law of the unconscious statistician applied to the function .
The (Pearson) correlation coefficient is the normalized covariance:
Derivation hint: divide covariance by the product of standard deviations to cancel all units and bound the result. Symbols: are standard deviations, .
For random variables and constants :
Derivation hint: additive shifts leave deviations unchanged; scale factors pull out of expectation.
Derivation hint: expand and collect the cross term.
Derivation hint: apply Cauchy–Schwarz to the centered variables (see proof below).
Derivation hint: equality in Cauchy–Schwarz holds iff the centered variables are linearly dependent.
Why It Holds / Derivation
We prove [12] via the Cauchy–Schwarz inequality on centered variables.
Step 1. Define the centered variables , , so , , , .
Step 2. For any real , the quantity since it is the expectation of a square. Expand:
Derivation hint: square the binomial inside, apply linearity of expectation.
Step 3. This is a quadratic in that is always , so its discriminant must be :
Derivation hint: a non-negative parabola opening upward has at most one real root; .
Step 4. Substitute back:
Derivation hint: divide [15] by and take square roots.
Step 5 (equality case). Equality holds iff the discriminant is zero, i.e. for some , which forces almost surely — a perfect linear relationship , proving [13].
∎Step 1. If independent, by [5].
Step 2. Then
Derivation hint: the double integral separates into a product of single integrals because the integrand factors.
Step 3. By [7], , hence .
Caution: the converse is false — see the counterexample below.
∎Pearson, building directly on Francis Galton's work on heredity, gave the correlation coefficient its modern mathematical definition (the "product-moment correlation") in the 1890s. He founded the world's first university statistics department at University College London (1911) and the journal Biometrika. Pearson formalized many tools — the chi-squared test, the method of moments, the correlation coefficient named for him — though his reputation is shadowed by his promotion of eugenics. His insistence that statistical relationships could be quantified without invoking causation set the philosophical tone for modern applied statistics.
Building Intuition
Picture a cloud of data points on the – plane. Draw the two mean lines and , splitting the plane into four quadrants. Covariance is essentially the average signed area of the rectangles formed by each point's deviations :
- A point in the upper-right (both above mean) or lower-left (both below) contributes a positive product.
- A point in the upper-left or lower-right contributes a negative product.
If the cloud tilts up-right, positives dominate → positive covariance. If it tilts down-right, negatives dominate → negative. If it's a symmetric blob, contributions cancel → zero. Correlation then asks: "After stretching/squashing each axis to standard-deviation units, how tight is the tilt?" means the points fall on a perfect line; means no linear tilt at all (but possibly a curved relationship you can't see in ).
Worked Examples
Given. A joint PMF table over , :
Step 1 — marginals. , . , .
Step 2 — means. , .
Step 3 — . Only the cell gives : .
Step 4 — covariance via [7]: .
Step 5 — variances. (since for 0/1). Likewise .
Step 6 — correlation via [9]: .
A weak negative linear relationship.
Given. on the unit square (zero elsewhere). Verify it's valid, then find .
Step 1 — validity. . ✓
Step 2 — marginal of . .
Step 3 — . . By symmetry .
Step 4 — . . So . Same for .
Step 5 — via [8]: . Inner over : . Outer over : .
Step 6 — covariance [7]: .
Step 7 — correlation [9]: .
Common Misconceptions
Correlation ≠ causation. tells you two variables move together; it says nothing about why. A lurking confounder, reverse causation, or pure coincidence (spurious correlation) can all produce strong .
Zero correlation ≠ independence. Correlation captures only the linear component of dependence. A perfectly predictable nonlinear relationship can have .
Independence ⟹ zero covariance, but NOT the reverse. The implication is one-directional.
Correlation is not robust. A single outlier can drag Pearson's dramatically; it also assumes the relationship is linear and the second moments exist (correlation is undefined for, e.g., a Cauchy distribution with infinite variance).
Let be uniform on (each probability ) and define . Then is completely determined by — maximal dependence. Compute: . . Therefore , so .
Yet and are not independent: e.g. . The covariance is blind to the parabolic relationship because the symmetric positive and negative deviations cancel.
Connections
Joint distributions, covariance, and correlation sit at the hub of probability and statistics:
- They generalize Variance and Standard Deviation — variance is .
- For many variables, covariances assemble into the covariance matrix, central to Principal Component Analysis and the Multivariate Normal Distribution.
- They underpin Linear Regression, where the slope equals and is the coefficient of determination.
- The conditional density [4] connects to Conditional Expectation and Bayes' Theorem.
- Independence (eq. [5]) relates to Independence of Random Variables and the Law of Large Numbers.
Real-World Applications
Historical Development
Subtleties & Limits
Beyond linear correlation. Pearson's is fundamentally a linear and second-moment measure. Capturing general dependence rigorously remains active:
- Existence. Correlation requires finite variances; heavy-tailed distributions (Cauchy, some financial returns) break it entirely.
- Nonlinear dependence measures. Distance correlation (Székely, 2007) equals zero iff variables are independent — a genuine improvement over Pearson's. Mutual information and maximal information coefficient (MIC) attempt to capture arbitrary relationships, but each has estimation and interpretability trade-offs.
- Copulas. Sklar's theorem separates marginals from the dependence structure; the "right" scalar summary of a copula is non-unique (Kendall's , Spearman's , tail-dependence coefficients all coexist).
- High dimensions. Estimating large covariance matrices from limited samples is ill-conditioned; shrinkage and sparse estimation (graphical lasso) are ongoing research areas.
- Causal inference. Recovering causal structure from observational correlations (the do-calculus of Pearl) is a deep, still-evolving program.
See Also
Variance and Standard Deviation · Multivariate Normal Distribution · Linear Regression · Conditional Expectation · Independence of Random Variables · Principal Component Analysis · Bayes' Theorem · Law of Large Numbers