Unit 2, lesson 10

Expectation conditional expectation and variance

Why expectation needs integrability, how conditional expectation on an information partition is a random variable, and how the tower property and the law of total variance split variance into within-group and between-group parts.

  • Video 10
  • Distributions, expectation and dependence

A claim pays 00, 22, 44 or 1010 currency units in four equally likely states, so its expected payoff is 44. Suppose a signal will reveal, before the payoff, whether the state lies in the first pair or in the second pair. Which forecast should replace 44 once the signal arrives, and how much of the uncertainty does the signal remove? This lesson states when an expectation exists, builds the conditional expectation on an information partition, proves the tower property, and splits the variance 1414 of the claim into a part 55 left within the groups and a part 99 explained by the signal.

Key terms

Expectation

Definition Fix a probability space (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) and write E\mathbb{E} for expectation under P\mathbb{P}. On a finite sample space Ω={ω1,…,ωn}\Omega = \{\omega_1, \dots, \omega_n\} with pj=P({ωj})p_j = \mathbb{P}(\{\omega_j\}),

E[X]=∑j=1npj X(ωj).\mathbb{E}[X] = \sum_{j=1}^{n} p_j\,X(\omega_j).

In general E[X]=∫ΩX dP\mathbb{E}[X] = \int_\Omega X\,d\mathbb{P} for an integrable XX (next card), which equals ∫x fX(x) dx\int x\,f_X(x)\,dx when XX has a density fXf_X. For integrable XX and YY and real numbers aa and bb,

E[aX+bY]=a E[X]+b E[Y],\begin{aligned} &\mathbb{E}[aX + bY] \\[0.4em] &= a\,\mathbb{E}[X] + b\,\mathbb{E}[Y], \end{aligned}

with no assumption on the dependence between XX and YY. When E[X2]<∞\mathbb{E}[X^2] < \infty the variance is

Var⁡(X)=E[(X−E[X])2]=E[X2]−(E[X])2,\begin{aligned} \operatorname{Var}(X) &= \mathbb{E}\bigl[(X - \mathbb{E}[X])^2\bigr] \\[0.4em] &= \mathbb{E}[X^2] - \bigl(\mathbb{E}[X]\bigr)^2 , \end{aligned}

and for XX and YY with finite second moments, with Cov⁡(X,Y)=E[(X−E[X])(Y−E[Y])]\operatorname{Cov}(X, Y) = \mathbb{E}[(X - \mathbb{E}[X])(Y - \mathbb{E}[Y])],

Var⁡(aX+bY)=a2Var⁡(X)+b2Var⁡(Y)+2ab Cov⁡(X,Y).\begin{aligned} &\operatorname{Var}(aX + bY) \\[0.4em] &= a^2 \operatorname{Var}(X) + b^2 \operatorname{Var}(Y) \\[0.4em] &\quad + 2ab\,\operatorname{Cov}(X, Y). \end{aligned}

The cross term vanishes when the covariance is zero, for example for independent XX and YY, and adding variances without it is wrong in general. The same formulas hold under any other probability measure, such as a pricing measure Q\mathbb{Q}, with that measure’s weights, so an expectation always belongs to a measure.

In plain words An expectation is a probability-weighted average of the possible values. It is linear whatever the dependence between the variables. Variance is quadratic, so dependence enters it through the cross term, and adding variances is right only when that term is zero.

Example For the four-state claim, E[X]=14(0+2+4+10)=4\mathbb{E}[X] = \frac14(0 + 2 + 4 + 10) = 4 and E[X2]=14(0+4+16+100)=30\mathbb{E}[X^2] = \frac14(0 + 4 + 16 + 100) = 30, so Var⁡(X)=30−16=14\operatorname{Var}(X) = 30 - 16 = 14 squared currency units. The claim Y=10−XY = 10 - X pays 1010, 88, 66 and 00, with E[Y]=6\mathbb{E}[Y] = 6, Var⁡(Y)=14\operatorname{Var}(Y) = 14 and Cov⁡(X,Y)=−14\operatorname{Cov}(X, Y) = -14. Linearity gives E[X+Y]=10\mathbb{E}[X + Y] = 10 at once, and

Var⁡(X+Y)=14+14−28=0,\begin{aligned} &\operatorname{Var}(X + Y) \\[0.4em] &= 14 + 14 - 28 = 0, \end{aligned}

as it must be, since X+Y=10X + Y = 10 in every state. Adding the two variances to get 2828 would ignore the cross term.

Integrability

Definition A random variable XX is integrable if E[∣X∣]<∞\mathbb{E}[\lvert X \rvert] < \infty. Then E[X]=E[X+]−E[X−]\mathbb{E}[X] = \mathbb{E}[X^{+}] - \mathbb{E}[X^{-}] is a finite number, where X+=max⁡(X,0)X^{+} = \max(X, 0) and X−=max⁡(−X,0)X^{-} = \max(-X, 0). For X≥0X \ge 0 the expectation is always defined, possibly as +∞+\infty, and it can be computed from the tail,

E[X]=∫0∞P(X>x) dx.\mathbb{E}[X] = \int_0^\infty \mathbb{P}(X > x)\,dx .

A random variable is square-integrable if E[X2]<∞\mathbb{E}[X^2] < \infty, which implies integrability because ∣x∣≤1+x2\lvert x \rvert \le 1 + x^2. A variance needs a finite second moment, and a covariance is defined here for two square-integrable variables. On a finite sample space every random variable is square-integrable, but a continuous model with heavy tails can fail either condition.

In plain words Before averaging, check that the sizes of the possible values, weighted by their probabilities, add up to something finite. Writing down an expected return or a covariance matrix assumes that the first or the second moments exist, and that assumption should be stated.

Example A constructed loss model, in currency units, has P(L>x)=x−1.5\mathbb{P}(L > x) = x^{-1.5} for x≥1x \ge 1, a Pareto tail with index 1.51.5. Then

E[L]=1+∫1∞x−1.5 dx=1+2=3,\begin{aligned} \mathbb{E}[L] &= 1 + \int_1^\infty x^{-1.5}\,dx \\[0.4em] &= 1 + 2 = 3, \end{aligned}

so LL is integrable. Its second moment is infinite. The density is 1.5 x−2.51.5\,x^{-2.5} on x≥1x \ge 1, and the truncated second moment E[L21{L≤M}]=3(M−1)\mathbb{E}[L^2 \mathbf{1}_{\{L \le M\}}] = 3(\sqrt{M} - 1) grows without bound, already 2727 at M=100M = 100 and 29972997 at M=106M = 10^6. The loss has a mean and no variance, so a sample variance of simulated losses is finite for each sample but tends to infinity as the sample grows.

Conditional expectation

Definition Let the available information be a partition of Ω\Omega into events A1,…,AkA_1, \dots, A_k with P(Ai)>0\mathbb{P}(A_i) > 0, and let G\mathcal{G} be the σ\sigma-algebra of all unions of these events. For an integrable XX, the conditional expectation E[X∣G]\mathbb{E}[X \mid \mathcal{G}] is the random variable that equals

mi=E[X 1Ai]P(Ai)m_i = \frac{\mathbb{E}[X\,\mathbf{1}_{A_i}]}{\mathbb{P}(A_i)}

on each AiA_i. It is G\mathcal{G}-measurable, because it is constant on every group, and for every A∈GA \in \mathcal{G}

E[1A E[X∣G]]=E[1A X].\begin{aligned} &\mathbb{E}\bigl[\mathbf{1}_{A}\,\mathbb{E}[X \mid \mathcal{G}]\bigr] \\[0.4em] &= \mathbb{E}[\mathbf{1}_{A}\,X]. \end{aligned}

For A=AiA = A_i both sides equal E[X 1Ai]\mathbb{E}[X\,\mathbf{1}_{A_i}], since multiplying mim_i by P(Ai)\mathbb{P}(A_i) undoes the division, and a union of groups adds these equalities. In general, for a σ\sigma-algebra G⊆F\mathcal{G} \subseteq \mathcal{F} and an integrable XX, there is a random variable YY that is G\mathcal{G}-measurable and integrable and satisfies E[1AY]=E[1AX]\mathbb{E}[\mathbf{1}_{A} Y] = \mathbb{E}[\mathbf{1}_{A} X] for every A∈GA \in \mathcal{G}, and any two such variables are equal almost surely. This YY is E[X∣G]\mathbb{E}[X \mid \mathcal{G}]. The existence of such a YY follows from the Radon-Nikodym theorem, a result stated here without proof. If a group had probability zero, the division would be impossible, and any value on that group would give another version of the same conditional expectation, which is why uniqueness holds only almost surely.

In plain words The conditional expectation is the forecast you would announce after learning which group the state is in. Before the information arrives you do not know which group will be revealed, so the forecast is itself a random variable. It is constant on each group because the information cannot tell the states of one group apart.

Example For the four-state claim, let A1={ω1,ω2}A_1 = \{\omega_1, \omega_2\} and A2={ω3,ω4}A_2 = \{\omega_3, \omega_4\}, each with probability 12\frac12. Then m1=14(0+2)/12=1m_1 = \frac14(0 + 2)/\frac12 = 1 and m2=14(4+10)/12=7m_2 = \frac14(4 + 10)/\frac12 = 7, so E[X∣G]\mathbb{E}[X \mid \mathcal{G}] takes the values 11, 11, 77 and 77 in the four states. On A2A_2 the defining property reads 7⋅12=3.5=14(4+10)7 \cdot \frac12 = 3.5 = \frac14(4 + 10). Under a different measure with state weights 0.10.1, 0.40.4, 0.40.4 and 0.10.1, the same information gives the conditional expectations 1.61.6 and 5.25.2, so the forecast depends on the measure as well as on the information.

Tower property

Definition Let H⊆G⊆F\mathcal{H} \subseteq \mathcal{G} \subseteq \mathcal{F} be σ\sigma-algebras and let XX be integrable. Then, almost surely,

E[E[X∣G]∣H]=E[X∣H].\begin{aligned} &\mathbb{E}\bigl[\mathbb{E}[X \mid \mathcal{G}] \bigm| \mathcal{H}\bigr] \\[0.4em] &= \mathbb{E}[X \mid \mathcal{H}]. \end{aligned}

To prove it, call the left side YY. It is H\mathcal{H}-measurable and integrable. Every A∈HA \in \mathcal{H} also lies in G\mathcal{G}, so applying the defining property twice gives E[1AY]=E[1A E[X∣G]]=E[1AX]\mathbb{E}[\mathbf{1}_{A} Y] = \mathbb{E}[\mathbf{1}_{A}\,\mathbb{E}[X \mid \mathcal{G}]] = \mathbb{E}[\mathbf{1}_{A} X]. Thus YY satisfies the definition of E[X∣H]\mathbb{E}[X \mid \mathcal{H}], and uniqueness gives the identity. With the trivial σ\sigma-algebra H={∅,Ω}\mathcal{H} = \{\varnothing, \Omega\} it becomes E[E[X∣G]]=E[X]\mathbb{E}\bigl[\mathbb{E}[X \mid \mathcal{G}]\bigr] = \mathbb{E}[X]. The inclusion H⊆G\mathcal{H} \subseteq \mathcal{G} is a real hypothesis. For two unrelated information sets the identity fails in general.

In plain words If you will know more later, your best forecast today of your later forecast is your forecast today. On partitions, averaging within the fine groups and then averaging those averages over the coarse groups gives the same result as averaging over the coarse groups at once, provided each coarse group is a union of fine groups.

Example For the four-state claim, take no information F0={∅,Ω}\mathcal{F}_0 = \{\varnothing, \Omega\}, then the pairs G\mathcal{G}, then full information. With full information the forecast is XX itself, averaging it over the pairs gives 11 and 77, and averaging those with weights 12\frac12 gives 12⋅1+12⋅7=4=E[X]\frac12 \cdot 1 + \frac12 \cdot 7 = 4 = \mathbb{E}[X]. Now let H\mathcal{H} come from the unrelated partition {ω1,ω3}\{\omega_1, \omega_3\}, {ω2,ω4}\{\omega_2, \omega_4\}. Then E[X∣H]\mathbb{E}[X \mid \mathcal{H}] is 22 on the first group and 66 on the second, while E[E[X∣G]∣H]=4\mathbb{E}\bigl[\mathbb{E}[X \mid \mathcal{G}] \bigm| \mathcal{H}\bigr] = 4 in every state, because each group of H\mathcal{H} holds one state from each pair. The two-stage calculation fails when the information sets are not nested.

Law of total variance

Definition Let E[X2]<∞\mathbb{E}[X^2] < \infty, let G⊆F\mathcal{G} \subseteq \mathcal{F} be a σ\sigma-algebra, and write m=E[X∣G]m = \mathbb{E}[X \mid \mathcal{G}] and Var⁡(X∣G)=E[(X−m)2∣G]\operatorname{Var}(X \mid \mathcal{G}) = \mathbb{E}[(X - m)^2 \mid \mathcal{G}]. Then

Var⁡(X)=E[Var⁡(X∣G)]+Var⁡(E[X∣G]).\begin{aligned} &\operatorname{Var}(X) \\[0.4em] &= \mathbb{E}\bigl[\operatorname{Var}(X \mid \mathcal{G})\bigr] \\[0.4em] &\quad + \operatorname{Var}\bigl(\mathbb{E}[X \mid \mathcal{G}]\bigr). \end{aligned}

To prove it, write X−E[X]=(X−m)+(m−E[X])X - \mathbb{E}[X] = (X - m) + (m - \mathbb{E}[X]), square, and take expectations. The variable mm has a finite second moment, since E[m2]≤E[X2]\mathbb{E}[m^2] \le \mathbb{E}[X^2] by the conditional form of Jensen’s inequality, stated here. Write c=m−E[X]c = m - \mathbb{E}[X]. The cross term vanishes,

E[(X−m) c]=E[c E[X−m∣G]]=0,\begin{aligned} &\mathbb{E}\bigl[(X - m)\,c\bigr] \\[0.4em] &= \mathbb{E}\bigl[c\,\mathbb{E}[X - m \mid \mathcal{G}]\bigr] = 0, \end{aligned}

because cc is G\mathcal{G}-measurable with a finite second moment, so it can be taken out of the conditional expectation, and E[X−m∣G]=0\mathbb{E}[X - m \mid \mathcal{G}] = 0. On a partition this step is direct, since m−E[X]m - \mathbb{E}[X] is constant on each group and the deviations X−miX - m_i average to zero within the group. The tower property turns E[(X−m)2]\mathbb{E}[(X - m)^2] into E[Var⁡(X∣G)]\mathbb{E}[\operatorname{Var}(X \mid \mathcal{G})], and E[m]=E[X]\mathbb{E}[m] = \mathbb{E}[X] makes E[(m−E[X])2]\mathbb{E}[(m - \mathbb{E}[X])^2] equal to Var⁡(m)\operatorname{Var}(m).

In plain words Total uncertainty splits into two pieces. One is the uncertainty that remains after the information is known, averaged over what the information turns out to be. The other is the uncertainty of the forecast itself. No cross term appears because the leftover error has conditional mean zero, not because the two pieces are independent.

Example In the four-state claim with the pair information, the leftover errors X−mX - m are −1-1, 11, −3-3 and 33, and the forecast deviations m−E[X]m - \mathbb{E}[X] are −3-3, −3-3, 33 and 33. Their product averages to 14(3−3−9+9)=0\frac14(3 - 3 - 9 + 9) = 0. The squared errors average to 14(1+1+9+9)=5\frac14(1 + 1 + 9 + 9) = 5, the squared forecast deviations average to 99, and

Var⁡(X)=5+9=14,\operatorname{Var}(X) = 5 + 9 = 14,

which agrees with the direct average 14(16+4+0+36)=14\frac14(16 + 4 + 0 + 36) = 14 of the squared deviations from the mean 44.

Within-group and between-group variance

Definition For an information partition A1,…,AkA_1, \dots, A_k with P(Ai)>0\mathbb{P}(A_i) > 0, group means mim_i and group variances

vi=E[(X−mi)2 1Ai]P(Ai),v_i = \frac{\mathbb{E}\bigl[(X - m_i)^2\,\mathbf{1}_{A_i}\bigr]}{\mathbb{P}(A_i)},

the within-group variance is ∑iP(Ai) vi=E[Var⁡(X∣G)]\sum_i \mathbb{P}(A_i)\,v_i = \mathbb{E}[\operatorname{Var}(X \mid \mathcal{G})] and the between-group variance is ∑iP(Ai) (mi−E[X])2=Var⁡(E[X∣G])\sum_i \mathbb{P}(A_i)\,(m_i - \mathbb{E}[X])^2 = \operatorname{Var}(\mathbb{E}[X \mid \mathcal{G}]). Both are nonnegative and they add up to Var⁡(X)\operatorname{Var}(X). The within-group variance is the smallest mean squared error of any forecast that uses the information. For square-integrable XX and every square-integrable G\mathcal{G}-measurable ZZ, the cross term argument of the previous card gives

E[(X−Z)2]=E[(X−m)2]+E[(m−Z)2],\begin{aligned} &\mathbb{E}\bigl[(X - Z)^2\bigr] \\[0.4em] &= \mathbb{E}\bigl[(X - m)^2\bigr] \\[0.4em] &\quad + \mathbb{E}\bigl[(m - Z)^2\bigr], \end{aligned}

with m=E[X∣G]m = \mathbb{E}[X \mid \mathcal{G}], so Z=mZ = m is the best forecast in this sense. Since a larger σ\sigma-algebra allows more forecasts, more information can only lower the within-group variance or leave it unchanged, and the between-group variance moves the opposite way. With no information the within-group variance is Var⁡(X)\operatorname{Var}(X), and when every state of a finite space is its own group of positive probability it is 00.

In plain words The within-group variance is the uncertainty that is left, on average, after the information is revealed. The between-group variance measures how much the forecast moves with the information. Revealing more shifts variance from the first part to the second and leaves the total alone, because the payoff itself has not changed.

Example In the four-state claim, the first pair 00 and 22 lies one unit on either side of its mean 11, so v1=1v_1 = 1, and the second pair 44 and 1010 lies three units on either side of 77, so v2=9v_2 = 9. The within-group variance is 12⋅1+12⋅9=5\frac12 \cdot 1 + \frac12 \cdot 9 = 5, and the between-group variance is

12(1−4)2+12(7−4)2=9.\tfrac12 (1 - 4)^2 + \tfrac12 (7 - 4)^2 = 9 .

Revealing the exact state gives 00 within and 1414 between. A forecast that uses the pair information but announces 22 on the first pair and 66 on the second has mean squared error 14(4+0+4+16)=6\frac14(4 + 0 + 4 + 16) = 6, which is the minimum 55 plus the squared distance 11 between this forecast and E[X∣G]\mathbb{E}[X \mid \mathcal{G}].

Check yourself

  1. For the four-state claim paying 00, 22, 44 and 1010 with equal probabilities, suppose the signal instead reveals whether the payoff is extreme, in {ω1,ω4}\{\omega_1, \omega_4\}, or middle, in {ω2,ω3}\{\omega_2, \omega_3\}. Find the conditional expectation, check the tower property, and split the variance into its within-group and between-group parts.
Show the answer

Each group has probability 12\frac12. The conditional expectation is (0+10)/2=5(0 + 10)/2 = 5 on the extreme group and (2+4)/2=3(2 + 4)/2 = 3 on the middle group, and 12⋅5+12⋅3=4=E[X]\frac12 \cdot 5 + \frac12 \cdot 3 = 4 = \mathbb{E}[X], as the tower property requires. The extreme payoffs lie 55 on either side of 55, so their group variance is 2525, and the middle payoffs lie 11 on either side of 33, so theirs is 11. Hence the within-group variance is 12⋅25+12⋅1=13\frac12 \cdot 25 + \frac12 \cdot 1 = 13, the between-group variance is 12(5−4)2+12(3−4)2=1\frac12 (5 - 4)^2 + \frac12 (3 - 4)^2 = 1, and 13+1=1413 + 1 = 14. This signal also has two equally likely groups, yet it explains only 11 of the 1414 units of variance, against 99 for the pair signal. What matters is how the groups line up with the payoff.

  1. In the four-state claim with the pair information, the leftover error U=X−E[X∣G]U = X - \mathbb{E}[X \mid \mathcal{G}] and the forecast deviation V=E[X∣G]−E[X]V = \mathbb{E}[X \mid \mathcal{G}] - \mathbb{E}[X] have E[UV]=0\mathbb{E}[UV] = 0. A classmate concludes that UU and VV are independent. Is that right, and what does the law of total variance actually need?
Show the answer

It is not right. The error UU takes the values −1-1, 11, −3-3 and 33, and VV takes −3-3, −3-3, 33 and 33. The joint probability P(U=1,V=3)\mathbb{P}(U = 1, V = 3) is 00, because U=1U = 1 only in the first pair, where V=−3V = -3, while

P(U=1) P(V=3)=14⋅12=18.\begin{aligned} &\mathbb{P}(U = 1)\,\mathbb{P}(V = 3) \\[0.4em] &= \tfrac14 \cdot \tfrac12 = \tfrac18 . \end{aligned}

The size of the error depends on the group, 11 in the first pair and 33 in the second, so the two are dependent. The law of total variance needs only E[U∣G]=0\mathbb{E}[U \mid \mathcal{G}] = 0, which holds because each group’s errors average to zero. Since VV is constant on each group, this makes E[UV]=0\mathbb{E}[UV] = 0 without any independence.

  1. Under a constructed physical model, a bond pays 100100 currency units at maturity if its issuer survives and 4040 if it defaults. Its rating at issue is good with probability 0.80.8 and bad with probability 0.20.2, and the default probability is 0.010.01 given a good rating and 0.10.1 given a bad one. Find the expected payoff given each rating and overall, and split the variance of the payoff into the parts within and between ratings.
Show the answer

Given a rating with default probability dd, the payoff is 100−60D100 - 60D with DD a default indicator, so its conditional mean is 100−60d100 - 60d and its conditional variance is 3600 d(1−d)3600\,d(1 - d). The conditional means are 99.499.4 for a good rating and 9494 for a bad one, and the tower property gives

E[X]=0.8⋅99.4+0.2⋅94=98.32.\begin{aligned} &\mathbb{E}[X] \\[0.4em] &= 0.8 \cdot 99.4 + 0.2 \cdot 94 \\[0.4em] &= 98.32 . \end{aligned}

As a check, the overall default probability is 0.8⋅0.01+0.2⋅0.1=0.0280.8 \cdot 0.01 + 0.2 \cdot 0.1 = 0.028, and 100−60⋅0.028=98.32100 - 60 \cdot 0.028 = 98.32. The conditional variances are 35.6435.64 and 324324, so the within-group variance is

0.8⋅35.64+0.2⋅324=93.312,\begin{aligned} &0.8 \cdot 35.64 + 0.2 \cdot 324 \\[0.4em] &= 93.312, \end{aligned}

and since the conditional means lie 1.081.08 above and 4.324.32 below the overall mean, the between-group variance is

0.8⋅1.082+0.2⋅4.322=4.6656.\begin{aligned} &0.8 \cdot 1.08^2 + 0.2 \cdot 4.32^2 \\[0.4em] &= 4.6656 . \end{aligned}

They add to 97.977697.9776, which equals the direct value 3600⋅0.028⋅0.9723600 \cdot 0.028 \cdot 0.972. The rating explains 4.6656/97.9776=1214.6656/97.9776 = \frac{1}{21}, under 55 percent of the variance. Most of the uncertainty is whether default happens within each rating class.

How this lesson connects