Skip to content
All simulations

Correlation and covariance

Dial a correlation from −1 to +1 and watch two assets move together, apart, or not at all.

+0.70
1×

Same pattern, measured in bigger units.

Measured correlation+0.66always between −1 and +1
Covariance10.5changes with scale

120 monthly returns, one dot per month

The same two assets as prices over ten years

These two assets move strongly in the same direction, with a measured correlation of 0.66. Now drag the scale dial and watch which number changes.

Try this

  • Set correlation to +1: the two friends always walk in the same direction.
  • Set it to −1 and watch the dots line up like a seesaw.
  • Set it to 0. Knowing asset A's month tells you nothing about asset B's.
  • Scale asset B by 100×. The covariance explodes, the correlation stays put.

The math

ρA,B=Cov⁡(A,B)σA σB\rho_{A,B} = \frac{\operatorname{Cov}(A,B)}{\sigma_A\,\sigma_B}
ρA,B\rho_{A,B}
correlation, from −1 to +1
Cov⁡(A,B)\operatorname{Cov}(A,B)
covariance, in the data's own units
σA,σB\sigma_A, \sigma_B
each asset's standard deviation