Math Atom · M-C11

Combining random variables

10 minMath AtomProbability

By the end you will be able to

  1. 1Find the mean of a combination: E[aX + bY] = aE[X] + bE[Y].
  2. 2Find the variance of a combination, including the covariance term, and its standard deviation.
  3. 3Work out the standard deviation of a two-variable mix, and explain the cases ρ = 1 and ρ = −1.
  4. 4Explain the floor for many equal, equally correlated variables.

Why you need it

Averages add up simply. Risks do not: two things that each swing by 10 can together swing by 20, by 14, or not at all. The covariance decides which.

These Core Path lessons use it:

The idea

Risks don’t simply add up

Two bets each win or lose 10 with equal chances, so each has a standard deviation of 10. What about the total? It depends on how the bets are linked. Try each setting.

Two bets, added together

Each bet: win 10 or lose 10, 50:50

How are the bets linked? (correlation ρ)

Chance of each combination

Y winsY loses
X wins50.0%0.0%
X loses0.0%50.0%
The total, X + Y
50%−200%050%+20
sd of X10
sd of Y10
sd of X + Y20

Together, the bets act like one double bet: the risk is 10 + 10 = 20.

The total's average is 0 in every case. Only its spread changes: 20 when the bets move together, 14.14 when they are unlinked, and 0 when they move opposite. The link between them is measured by the covariance or the correlation from M-C10: Covariance and correlation.

The rules

The mean of a combination. From M-C02: Expectation, expectations pass straight through scaling and adding, so for any combination with weights a and b:

E[aX+bY]=a E[X]+b E[Y]\mathbb{E}[aX + bY] = a\,\mathbb{E}[X] + b\,\mathbb{E}[Y]

The variance of a combination. Variances do not pass straight through. Here is why, and what you get instead.

Three special cases. The correlation can be anything from −1 to 1. At the two ends and in the middle the formula simplifies.

ρ (a = 0.6, sd of X 20%, sd of Y 10%)sd of the mixWhat happens
116.00%the weighted average: no diversification
0.313.74%less than the weighted average
012.65%less again
−18.00%the swings partly cancel

Many alike variables. What if you combine not two but n variables? The covariance terms decide how far the total's spread can fall.

Adding more alike variables

equal weights 1/n
0%10%20%30%40%50%120406080100floor σ√ρ = 13.4%number of variables, n →
sd with n = 1015.87%
Floor σ√ρ13.42%
Share of variance from pairs64%

The rules, for reference

E[aX+bY]=a E[X]+b E[Y]Var⁡(aX+bY)=a2Var⁡(X)+b2Var⁡(Y)+2abCov⁡(X,Y)\mathbb{E}[aX+bY] = a\,\mathbb{E}[X] + b\,\mathbb{E}[Y] \qquad \operatorname{Var}(aX+bY) = a^2\operatorname{Var}(X) + b^2\operatorname{Var}(Y) + 2ab\operatorname{Cov}(X,Y)
σP=a2σX2+b2σY2+2ab ρ σXσYρ=1:σP=aσX+bσYρ=−1:σP=∣aσX−bσY∣\sigma_P = \sqrt{a^2\sigma_X^2 + b^2\sigma_Y^2 + 2ab\,\rho\,\sigma_X\sigma_Y} \qquad \rho = 1: \sigma_P = a\sigma_X + b\sigma_Y \qquad \rho = -1: \sigma_P = \lvert a\sigma_X - b\sigma_Y\rvert
n alike, weights 1n:σP2=σ2n+(1−1n)ρ σ2  →  ρ σ2n \text{ alike, weights } \tfrac1n: \quad \sigma_P^2 = \frac{\sigma^2}{n} + \Big(1 - \frac1n\Big)\rho\,\sigma^2 \;\to\; \rho\,\sigma^2

Try it

Set the weights, the two standard deviations and the correlation. Watch the solid curve bend below the dashed straight line as ρ falls, and touch zero at ρ = −1. Which weight gives the smallest spread?

Try itMix two variables

Covariance matrix tool →
Standard deviation of the mix for every weight in X. Solid: your ρ. Dashed: ρ = 1. Dotted: ρ = −1.
0%10%20%30%0%25%50%75%100%weight in X →

The three pieces of the variance

a²σX²0.0144
b²σY²0.0016
2abρσXσY0.00288
Variance σP²0.01888
sd of the mix, σP13.74%
Weighted average aσX + bσY16.00%
Reduction from mixing2.26%
Mean: a × 8% + b × 4%6.40%

The mean is always the weighted average. The standard deviation is the weighted average only when ρ = 1; the green line is what mixing saves.

Worked examples

1. A 60/40 mix

Step 1 of 5
  1. 1

    The set-up

    60% of a sum goes into X (mean 8%, standard deviation 20%) and 40% into Y (mean 4%, standard deviation 10%). Their correlation is 0.3. Find the mean and standard deviation of the mix (illustrative figures).

2. Perfectly opposite: a zero-variance mix

Step 1 of 4
  1. 1

    The set-up

    Same standard deviations (20% and 10%), but now ρ = −1. Which weight in X makes the mix not vary at all?

3. Twenty-five alike variables

Step 1 of 5
  1. 1

    The set-up

    25 variables, each with standard deviation 30%, every pair with correlation 0.2, equal weights of 1/25.

Common mistakes

Each line below is a tempting slip. Spot what is wrong, then check.

Reaction

Check what stuck

Question 1 · objective 1

E[X] = 6 and E[Y] = 2. What is E[0.5X + 0.5Y]?

Question 2 · objective 2

Var(X) = 4, Var(Y) = 9 and Cov(X, Y) = 1. What is Var(X + Y)?

Question 3 · objective 3

Half in X and half in Y. Both have a standard deviation of 20% and their correlation is 0. What is the standard deviation of the mix, in %?

%

Question 4 · objective 3

When is the standard deviation of aX + bY (a, b positive) equal to the weighted average of the two standard deviations, a × sd(X) + b × sd(Y)?

Question 5 · objective 4

Many alike variables, each with standard deviation 25%, every pair with correlation 0.36, equal weights. What standard deviation can the mix never go below, in %?

%

Glossary

Combination (aX + bY)
A total made of several random variables, each multiplied by a number (its weight), such as aX + bY.
Weight
The share given to each variable in a combination. In a 60/40 mix, a = 0.6 and b = 0.4.
Variance of a combination
a²Var(X) + b²Var(Y) + 2ab Cov(X, Y): the two variances, weighted by the squared weights, plus the covariance term.
Diversification
The fall in the standard deviation of a total compared with the weighted average of the parts.
Floor (σ√ρ)
The level σ√ρ that the standard deviation of many alike, equally correlated variables cannot go below.