Correlation¶
Definition¶
For random variables and with and , the correlation of and is
Correlation is undefined if either variance is zero.
Interpretation¶
Correlation is the covariance of the two variables after each has been standardized to mean and variance . It is therefore unit-free, lies between and , and measures how closely the pair follows a straight line. Zero correlation rules out linear association but can coexist with dependence.
The left panel shows the exact decreasing relation , with correlation . The middle panel shows a positive but imperfect linear association, with correlation about . In the right panel, and are uncorrelated but dependent, illustrating that correlation measures linear association only.
Change the slope and the noise: the correlation measures how tightly the points follow a line. With it is , although depends on .
Dividing by the standard deviations removes the units: measuring in cents instead of euros multiplies the covariance by but leaves the correlation unchanged. In general when , and the sign flips when . The values occur only for an exact linear relation.
There is a useful picture from linear algebra: covariance behaves like an inner product of the centred variables, variance like a squared length, and correlation like the cosine of the angle between them. The bound is then the Cauchy–Schwarz inequality, which returns for random variables later in this course (Cauchy–Schwarz for random variables).
Correlation is not the slope of the line: and both have correlation .
Key Results¶
- .
- Absolute correlation is exactly when almost surely for constants with ; its sign is the sign of .
Examples¶
- If and has positive finite variance, the correlation is .
- For and , symmetry gives , so correlation is although is determined by .
Prerequisites¶
Related Concepts¶
- Cauchy–Schwarz Inequality for Random Variables
- Independent Random Variables
- Conditional Expectation and Independence
Sources¶
- Nicky van Foreest · Probability Distributions · Week 2
Aliases: correlation coefficient, Pearson correlation, Pearson's correlation coefficient, product-moment correlation coefficient, linear correlation coefficient Symbols: element of, infinity, square root
Last updated: 22 October 2026 19:04
CorrelationCovarianceCauchy–Schwarz Inequality for Random VariablesIndependent Random VariablesConditional Expectation and Independence