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 isThe marginal distributions recover each variable alone by summing/integrating out the other:
The conditional density is
Here are realized values, are realized values, a region in the plane.
Independence
and are independent iff the joint factors into marginals for all :Covariance
The covariance of and with means is
An equivalent, computation-friendly form:
The expectation of a product for the continuous case is
Correlation Coefficient
The (Pearson) correlation coefficient is the normalized covariance:
Symbols: are standard deviations, .
Properties of Covariance and Correlation
For random variables and constants :
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:Independence ⟹ Zero Covariance
Step 1. If independent, by [5]. Step 2. ThenKarl 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
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:
- 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
- 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]).
- Genetics & heredity. Galton's original motivation: correlation between parents' and offspring's heights (), giving "regression toward the mean."
- 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.
- Machine learning. Feature correlation analysis detects redundant predictors; PCA decorrelates features via eigendecomposition of the covariance matrix.
- Climate science. Correlations between sea-surface temperatures and rainfall (e.g. the El Niño–Southern Oscillation index) drive seasonal forecasting.
- Medical research. Correlation between risk factors (cholesterol, blood pressure) and disease outcomes guides epidemiological hypotheses (always with the causation caveat).
- 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.