ML0071 Covariance vs Correlation

What is the difference between covariance and correlation?

Answer

Both measure how two variables move together. Covariance is the raw co-movement, expressed in the product of the two variables’ units: positive when the variables tend to sit above their means together, negative when one runs high while the other runs low. Correlation (Pearson’s \rho) is covariance divided by both standard deviations, which strips the units and bounds the result to [-1, 1], so strengths become comparable across datasets. Neither proves causation, and both capture only linear association: a perfect parabola scores zero correlation despite being fully determined.

(1) Units: covariance keeps the product of the units (dollars times kilograms); correlation is unitless and bounded, so rescaling a variable changes the covariance but leaves the correlation untouched.
(2) Sign vs Strength: covariance tells you the direction of co-movement; only correlation tells you a comparable strength, since 0.9 vs 0.2 means the same thing for any pair of variables.
(3) Linear Only: both are second-moment statistics of linear association. Zero correlation does not imply independence: Y = X^2 on symmetric data has \rho = 0 while X fully determines Y.

Four scatter panels: positive correlation, negative correlation, zero correlation with independent points, and a parabola with zero correlation but full dependence

Figure 1: Correlation reads linear co-movement: positive (top left), negative (top right), zero with independence (bottom left), and the trap case, zero correlation with complete dependence on a parabola (bottom right). The first three have matching covariance signs; the fourth shows why a second-moment statistic can miss structure.

Mathematical Formulation:
\mathrm{Cov}(X, Y) = \mathbb{E}\big[(X - \mu_X)(Y - \mu_Y)\big]
\rho_{XY} = \frac{\mathrm{Cov}(X, Y)}{\sigma_X \, \sigma_Y}

Where:

  • X, Y are random variables with means \mu_X, \mu_Y and standard deviations \sigma_X, \sigma_Y.
  • \mathbb{E}[\cdot] is expectation over the joint distribution; in practice both quantities are estimated by sample averages.
  • \rho_{XY} lies in [-1, 1] by the Cauchy-Schwarz inequality, with \pm 1 meaning an exact linear relationship.
FeatureCovarianceCorrelation
DefinitionMean product of centered valuesCovariance divided by both \sigma
UnitsProduct of the variables’ unitsUnitless
RangeUnbounded[-1, 1]
Scale InvarianceNo: rescaling a variable rescales itYes: unchanged by a positive affine rescaling (a negative scale flips the sign)
Typical UsePortfolio variance, covariance matrices, PCAComparing association strength, feature screening

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *