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).

A joint distribution specifies the probabilities of all combinations of values that a collection of random variables can take simultaneously, encoding not just each variable's behavior but their interdependence. Covariance extracts the first-order (linear) part of that dependence — the average product of the two variables' deviations from their means — while correlation rescales covariance so it no longer depends on units and lies between and . These tools matter because almost no real system has independent components: stock returns move together, heights and weights correlate, sensor noises share sources. The surprising fact every student must internalize: zero correlation does NOT imply independence — two variables can be perfectly deterministically related (e.g. ) yet have zero covariance.

The Core Insight

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

Joint Distribution

For two random variables :

Discrete case — the joint PMF is
1
⟳probabilities of a complete, mutually exclusive set of outcomes sum to 1.
Continuous case — the joint PDF satisfies
2
⟳probability is the volume under the joint density surface over region .

The marginal distributions recover each variable alone by summing/integrating out the other:

3
⟳collapse the joint over all values of the variable being eliminated (law of total probability).

The conditional density is

4
⟳restrict to the slice and renormalize so the slice integrates to 1.

Here are realized values, are realized values, a region in the plane.

Independence

and are independent iff the joint factors into marginals for all :
5
⟳substitute the product form into the conditional definition [4]; the marginal cancels.

Covariance

The covariance of and with means is

6
⟳average the product of deviations from the mean — positive when they deviate together, negative when oppositely.

An equivalent, computation-friendly form:

7
⟳expand the product in [6], use linearity of expectation, and cancel terms.

The expectation of a product for the continuous case is

8
⟳law of the unconscious statistician applied to the function .

Correlation Coefficient

The (Pearson) correlation coefficient is the normalized covariance:

9
⟳divide covariance by the product of standard deviations to cancel all units and bound the result.

Symbols: are standard deviations, .

Properties of Covariance and Correlation

For random variables and constants :

10
⟳additive shifts leave deviations unchanged; scale factors pull out of expectation.

11
⟳expand and collect the cross term.
12
⟳apply Cauchy–Schwarz to the centered variables (see proof below).
13
⟳equality in Cauchy–Schwarz holds iff the centered variables are linearly dependent.

Why It Holds / Derivation

Correlation is bounded: $|\rho_{XY}|\le 1$

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:
14
⟳square the binomial inside, apply linearity of expectation.
Step 3. This is a quadratic in that is always , so its discriminant must be :
15
⟳a non-negative parabola opening upward has at most one real root; .
Step 4. Substitute back:
16
⟳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].

Independence ⟹ Zero Covariance

Step 1. If independent, by [5]. Step 2. Then
17
⟳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.

Karl Pearson | 1857–1936

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 ).

Sign of covariance by quadrant: products of mean-deviations

X=μ_X Y=μ_Y (+)(+)=+ (−)(+)=− (−)(−)=+ (+)(−)=− Positive covariance (tilt up-right)

Worked Examples

Discrete joint PMF — full computation

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.

Continuous joint density — covariance via integration

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).

Uncorrelated but dependent

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:

Real-World Applications

  1. Finance — portfolio theory. Markowitz's mean-variance optimization uses the covariance matrix of asset returns; diversification works precisely because low/negative correlations reduce overall portfolio variance (via eq. [11]).
  2. Genetics & heredity. Galton's original motivation: correlation between parents' and offspring's heights (), giving "regression toward the mean."
  3. Signal processing. The autocorrelation function measures how a signal correlates with a time-shifted copy of itself, foundational to filtering and the Wiener–Khinchin theorem.
  4. Machine learning. Feature correlation analysis detects redundant predictors; PCA decorrelates features via eigendecomposition of the covariance matrix.
  5. Climate science. Correlations between sea-surface temperatures and rainfall (e.g. the El Niño–Southern Oscillation index) drive seasonal forecasting.
  6. Medical research. Correlation between risk factors (cholesterol, blood pressure) and disease outcomes guides epidemiological hypotheses (always with the causation caveat).
  7. Quality control / metrology. Covariance propagation quantifies how correlated measurement errors combine in derived quantities.

Historical Development

  • 1846 — Auguste Bravais studies the bivariate normal and "correlated errors," anticipating the correlation formula in an astronomical context.
  • 1877 — Francis Galton introduces "reversion" (later "regression") while studying sweet-pea seed sizes.
  • 1888 — Galton publishes Co-relations and their Measurement, defining the correlation index geometrically from scatter diagrams.
  • 1892 — Edgeworth develops the mathematics of the multivariate normal correlation.
  • 1896 — Karl Pearson gives the rigorous "product-moment" definition of (eq. [9]), establishing the modern formula.
  • 1904 — Charles Spearman introduces rank correlation, a nonparametric alternative.
  • 1920 — Pearson's "Notes on the History of Correlation" surveys the field's origins.
  • 1936 — Hotelling generalizes to canonical correlation between two sets of variables.
  • 1950s — Markowitz embeds the covariance matrix at the core of modern portfolio theory, winning a 1990 Nobel Prize.

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

Before this

Where this leads