Covariance and Correlation
Measuring Linear Dependence
Independence is an all-or-nothing property. In practice, we often need a quantitative measure of how strongly two random variables are related. The covariance and correlation coefficient provide exactly this — they measure the strength and direction of the linear relationship between and . These quantities are central to estimation theory, principal component analysis, and the definition of wide-sense stationarity for stochastic processes.
Definition: Covariance
Covariance
The covariance of random variables and is
Properties:
- .
- (symmetry).
- .
- .
If and are independent, (but not conversely in general).
Definition: Correlation Coefficient
Correlation Coefficient
The correlation coefficient (Pearson's ) of and , assuming both have positive variance, is
The correlation coefficient satisfies .
if and only if is an affine function of (i.e., with probability 1). The sign of indicates the direction: positive means tends to increase with ; negative means tends to decrease.
Theorem: Cauchy–Schwarz Bound on Correlation
For any random variables with finite second moments:
or equivalently . Equality holds iff a.s. for some constants with .
Apply Cauchy–Schwarz
Define and . The Cauchy–Schwarz inequality for the inner product gives
which is .
Equality condition
Equality holds iff a.s., i.e., , which gives , an affine function.
Theorem: Variance of a Sum
For any random variables :
If are pairwise uncorrelated (in particular, if independent), the cross terms vanish:
Expand
$
Separate diagonal and off-diagonal
The diagonal terms () give . The off-diagonal terms pair as for . If pairwise uncorrelated, all cross terms are zero.
Scatter Plot and Correlation Coefficient
Generate samples from a bivariate Gaussian with correlation and observe the scatter pattern. The empirical correlation coefficient is displayed.
Parameters
Example: Computing Covariance — Dice Example
Roll two fair dice. Let be the result of the first die and where is the result of the second die. Compute and .
Use linearity
,
since and are independent, so .
Compute variances
For a fair die: , , so . Also .
Correlation coefficient
XS$.
Covariance
A measure of the joint variability of two random variables: . Positive covariance means the variables tend to move together.
Related: Independent random variables
Correlation coefficient
The normalized covariance , always in . It measures the strength and direction of the linear relationship between two random variables.
Related: Covariance
Historical Note: Pearson's Correlation Coefficient
1896Karl Pearson introduced the product-moment correlation coefficient in 1896, building on Francis Galton's earlier work on regression. Galton had observed that the heights of children "regress toward the mean" relative to their parents — and the correlation coefficient quantifies precisely how much. Pearson's contribution was to define as a dimensionless quantity, bounded between and , that is invariant under affine scaling of either variable. This simple idea became one of the most widely used statistics in all of science.
Correlation Is Not Causation, and Not Even Full Dependence
The correlation coefficient measures only the linear component of the relationship between and . Two variables can have yet be perfectly dependent (e.g., and ). In modern practice, measures of statistical dependence such as mutual information, distance correlation, or maximal information coefficient capture nonlinear relationships. However, correlation remains the dominant tool in linear signal processing because for Gaussian variables, uncorrelated implies independent.
Key Takeaway
Covariance measures linear co-movement; the correlation coefficient normalizes it to . For independent RVs, and the variance of a sum equals the sum of variances. The converse (uncorrelated implies independent) holds only for jointly Gaussian variables.