Sub topic 16
Covariance and Correlation
Assume you know expected value, variance, and standard deviation. You should also be comfortable with weighted averages and decimal returns. This chapter shows how to measure whether two asset returns move together and how that relationship affects portfolio risk.
Covariance: joint movement
Covariance measures whether two variables tend to move in the same direction.
For two asset returns, the probability-weighted covariance is:
Cov(A, B) = Σ p_i (R_A,i − E[R_A])(R_B,i − E[R_B])
Here:
p_iis the probability of scenarioi.R_A,iandR_B,iare the asset returns in scenarioi.E[R_A]andE[R_B]are the expected returns.
A positive covariance means that returns tend to be above their means at the same time, or below their means at the same time. A negative covariance means that one asset tends to be above its mean when the other is below its mean.
Covariance depends on the units of measurement. For example, covariance based on decimal returns differs from covariance based on percentage-point returns. This makes covariance difficult to compare across pairs of assets.
Correlation: standardized covariance
Correlation standardizes covariance by dividing it by both assets' standard deviations:
ρ_A,B = Cov(A, B) / (σ_A σ_B)
Correlation has no units and always falls between −1 and +1.
| Correlation | Interpretation |
|---|---|
| `+1` | Perfect movement in the same direction |
| `0` | No linear relationship |
| `−1` | Perfect movement in opposite directions |
A correlation of zero does not prove that two assets are completely unrelated. It means that their linear relationship is zero. They may still have a nonlinear relationship.
probs = [0.2, 0.5, 0.3]
asset_a = [0.00, 0.08, 0.15]
asset_b = [0.10, 0.06, -0.02]
mean_a = sum(p * r for p, r in zip(probs, asset_a))
mean_b = sum(p * r for p, r in zip(probs, asset_b))
variance_a = sum(p * (r - mean_a) ** 2 for p, r in zip(probs, asset_a))
variance_b = sum(p * (r - mean_b) ** 2 for p, r in zip(probs, asset_b))
covariance = sum(
p * (ra - mean_a) * (rb - mean_b)
for p, ra, rb in zip(probs, asset_a, asset_b)
)
correlation = covariance / (variance_a * variance_b) ** 0.5
print(round(mean_a, 4)) # 0.085
print(round(mean_b, 4)) # 0.036
print(round(covariance, 6)) # -0.00327
print(round(correlation, 4)) # -0.8242The negative correlation in this example indicates a useful diversification relationship. It does not mean that asset B always rises when asset A falls.
Why the relationship matters for portfolios
For a two-asset portfolio, variance is:
σ_p² = w_A²σ_A² + w_B²σ_B² + 2w_Aw_B Cov(A, B)
Using correlation instead of covariance:
σ_p² = w_A²σ_A² + w_B²σ_B² + 2w_Aw_Bρ_A,Bσ_Aσ_B
The covariance term can reduce portfolio variance when correlation is below +1. The lower the correlation, the greater the potential diversification benefit, assuming the other inputs remain unchanged.
Common errors
- Forgetting scenario probabilities in a discrete distribution.
- Using covariance where correlation is required.
- Treating a negative covariance as a negative expected return.
- Assuming correlation below one guarantees a lower portfolio risk than either individual asset.
- Mixing percentage values such as
8with decimal values such as0.08.
Exercise
Asset A has a standard deviation of 20%, asset B has a standard deviation of 10%, and their correlation is 0.30. What is their covariance?
Show answer
Cov(A, B) = 0.30 × 0.20 × 0.10 = 0.0060.