Probability Theory Fundamentals › Covariance and Correlation

Michael BrenndoerferOctober 19, 20255 min read
Quantitative FinanceAll chapters
Part 1 of 15Mathematical Foundations
Chapter 2Probability Theory Fundamentals › Covariance and Correlation
Reading section 7 of 15 · Covariance and Correlation · 5 minSection 7 of 15 · 5 min

Book contents

Section 7 of 15 · 5 min read

Probability Theory Fundamentals › Covariance and CorrelationOne section · Sections in this chapter7 / 15 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

When analyzing multiple assets, we need to understand how they move together. Covariance and correlation quantify this relationship and provide the mathematical foundation for portfolio construction and risk management. A portfolio's risk depends on each component's volatility and on how those components interact.

Covariance

For random variables XX and YY with finite second moments, covariance measures their joint variability:

Cov(X,Y)=E[(X−μX)(Y−μY)]=E[XY]−E[X]E[Y]\text{Cov}(X, Y) = E[(X - \mu_X)(Y - \mu_Y)] = E[XY] - E[X]E[Y]

where:

  • Cov(X,Y)\text{Cov}(X, Y): covariance between XX and YY
  • μX=E[X]\mu_X = E[X]: mean of XX
  • μY=E[Y]\mu_Y = E[Y]: mean of YY
  • (X−μX)(Y−μY)(X - \mu_X)(Y - \mu_Y): product of deviations from respective means
  • E[XY]E[XY]: expected value of the product XYXY
  • The units of covariance are the product of the units of XX and YY

The covariance definition captures co-movement through products of deviations. When both variables are above their means, or both are below, the product is positive; opposite-direction deviations produce a negative product.

Positive covariance means that same-sign deviations make a positive net contribution on average, while negative covariance means opposite-sign deviations dominate on average. Zero covariance means no linear association; it does not rule out nonlinear dependence, so observing XX can still provide information about YY.

The equivalence of the two covariance formulas follows from expanding the definition:

E[(X−μX)(Y−μY)]=E[XY−μYX−μXY+μXμY]=E[XY]−μYE[X]−μXE[Y]+μXμY=E[XY]−E[X]E[Y]E[(X - \mu_X)(Y - \mu_Y)] = E[XY - \mu_Y X - \mu_X Y + \mu_X \mu_Y] = E[XY] - \mu_Y E[X] - \mu_X E[Y] + \mu_X \mu_Y = E[XY] - E[X]E[Y]

The second formula, E[XY]−E[X]E[Y]E[XY] - E[X]E[Y], often simplifies calculations: it says covariance equals the expected product minus the product of expectations. If XX and YY are independent with finite second moments, E[XY]=E[X]E[Y]E[XY] = E[X]E[Y], so the covariance is zero. Under these moment conditions, independence implies zero covariance, though the converse is not generally true.

Correlation

For finite, nonzero standard deviations, the correlation coefficient normalizes covariance to lie between -1 and 1:

ρXY=Cov(X,Y)σXσY\rho_{XY} = \frac{\text{Cov}(X, Y)}{\sigma_X \sigma_Y}

where:

  • ρXY\rho_{XY}: correlation coefficient between XX and YY (bounded between -1 and 1)
  • Cov(X,Y)\text{Cov}(X, Y): covariance between XX and YY
  • σX\sigma_X: standard deviation of XX
  • σY\sigma_Y: standard deviation of YY
  • σXσY\sigma_X \sigma_Y: product of standard deviations, which has the same units as covariance, making ρXY\rho_{XY} dimensionless

Dividing by the product of standard deviations converts covariance to a standardized scale. A correlation of ρ=1\rho = 1 means that Y=a+bXY=a+bX almost surely for some constants aa and b>0b>0. A correlation of ρ=−1\rho = -1 gives the same affine relationship with b<0b<0, while ρ=0\rho = 0 means no linear association. The qualifier "almost surely" permits exceptions confined to probability-zero outcomes.

Correlation is easier to interpret than covariance because it's unitless and bounded. A correlation of 1 indicates a perfect positive linear relationship, -1 indicates a perfect negative linear relationship, and 0 indicates no linear relationship. The normalization by standard deviations removes the scale dependence that makes covariance hard to interpret. Measuring the same returns in percentages rather than decimals is a fixed positive rescaling and leaves correlation unchanged. Currency translation is different: exchange rates generally vary over time, so converting asset values or returns between currencies introduces FX variation and can change correlations unless the conversion is a constant scaling.

The bounds of -1 and 1 follow from the Cauchy-Schwarz inequality, a fundamental result in mathematics. This bound provides a universal scale for comparison: a correlation of 0.8 between stocks A and B means they move together more strongly than if the correlation were 0.5, regardless of what A and B are or how volatile they are individually.

Out[14]:
Visualization
Scatter plot of paired returns forming an upward-sloping cloud, indicating strong positive correlation.
Simulated scatter plot with population correlation ρ = 0.9; the seeded sample correlation is about 0.899.
Scatter plot of paired returns with no visible slope, indicating near-zero correlation.
Simulated scatter plot with population correlation ρ = 0.0; the seeded sample correlation is about 0.106.
Scatter plot of paired returns forming a downward-sloping cloud, indicating strong negative correlation.
Simulated scatter plot with population correlation ρ = -0.8; the seeded sample correlation is about -0.750.

Low or negative correlation can reduce portfolio volatility relative to concentrated exposure, but correlation alone does not guarantee risk below every constituent. The two-asset variance also depends on both volatilities, the portfolio weights, and constraints.