# Law of total expectation

The proposition in probability theory known as the law of total expectation,[1] the law of iterated expectations, the tower rule, the smoothing theorem, among other names, states that if X is an integrable random variable (i.e., a random variable satisfying E( | X | ) < ∞) and Y is any random variable, not necessarily integrable, on the same probability space, then

$\operatorname{E} (X) = \operatorname{E}_Y ( \operatorname{E}_{X \mid Y} ( X \mid Y)),$

i.e., the expected value of the conditional expected value of X given Y is the same as the expected value of X.

The nomenclature used here parallels the phrase law of total probability. See also law of total variance.

(The conditional expected value E( X | Y ) is a random variable in its own right, whose value depends on the value of Y. Notice that the conditional expected value of X given the event Y = y is a function of y (this is where adherence to the conventional, rigidly case-sensitive notation of probability theory becomes important!). If we write E( X | Y = y) = g(y) then the random variable E( X | Y ) is just g(Y).

One special case states that if $A_1, A_2, \ldots, A_n$ is a partition of the whole outcome space, i.e. these events are mutually exclusive and exhaustive, then

$\operatorname{E} (X) = \sum_{i=1}^{n}{\operatorname{E}(X \mid A_i) \operatorname{P}(A_i)}.$

## Proof in the discrete case

\begin{align} \operatorname{E}_Y \left( \operatorname{E}_{X\mid Y} (X \mid Y) \right) &{} = \operatorname{E}_Y \Bigg[ \sum_x x \cdot \operatorname{P}(X=x \mid Y) \Bigg] \\[6pt] &{}=\sum_y \Bigg[ \sum_x x \cdot \operatorname{P}(X=x \mid Y=y) \Bigg] \cdot \operatorname{P}(Y=y) \\[6pt] &{}=\sum_y \sum_x x \cdot \operatorname{P}(X=x \mid Y=y) \cdot \operatorname{P}(Y=y) \\[6pt] &{}=\sum_x x \sum_y \operatorname{P}(X=x \mid Y=y) \cdot \operatorname{P}(Y=y) \\[6pt] &{}=\sum_x x \sum_y \operatorname{P}(X=x, Y=y) \\[6pt] &{}=\sum_x x \cdot \operatorname{P}(X=x) \\[6pt] &{}=\operatorname{E}(X). \end{align}

## Proof in the general case

The general statement of the result makes reference to a probability space $(\Omega,\mathcal{F},P)$ on which two sub $\sigma$-algebras $\mathcal{G}_1 \subseteq \mathcal{G}_2 \subseteq \mathcal{F}$ are defined. For a random variable $X$ on such a space, the smoothing law states that

$\operatorname{E}[ \operatorname{E}[X \mid \mathcal{G}_2] \mid \mathcal{G}_1] = \operatorname{E}[X \mid \mathcal{G}_1].$

Since a conditional expectation is a Radon-Nikodym derivative, verifying the following two properties establishes the smoothing law:

• $\operatorname{E}[ \operatorname{E}[X \mid \mathcal{G}_2] \mid \mathcal{G}_1] \mbox{ is } \mathcal{G}_1$-measurable
• $\int_{G_1} \operatorname{E}[ \operatorname{E}[X \mid \mathcal{G}_2] \mid \mathcal{G}_1] dP = \int_{G_1} X dP \mbox{ holds for all } G_1 \in \mathcal{G}_1$

The first of these properties holds by the definition of the conditional expectation, and the second holds since $G_1 \in \mathcal{G}_1 \subseteq \mathcal{G}_2$ implies

$\int_{G_1} \operatorname{E}[ \operatorname{E}[X \mid \mathcal{G}_2] \mid \mathcal{G}_1] dP = \int_{G_1} \operatorname{E}[X \mid \mathcal{G}_2] dP = \int_{G_1} X dP.$

In the special case that $\mathcal{G}_1 = \{\empty,\Omega \}$ and $\mathcal{G}_2 = \sigma(Y)$, the smoothing law reduces to the statement

$\operatorname{E}[ \operatorname{E}[X \mid Y]] = \operatorname{E}[X].$

## Notational shortcut

When using the expectation operator $\operatorname{E}$ , precision would require to always specify the variable the expectation of which is taken. In the case of discrete variables for instance,

$\operatorname{E}_X (X\cdot Y) = \sum_x x\cdot P(X=x) \cdot Y,$

is most of the time very different from

$\operatorname{E}_Y (X\cdot Y) = \sum_y X \cdot y \cdot P(Y=y),$

so that simply writing $\operatorname{E}(X\cdot Y)$ may be confusing. However, adding indices to the expectation operator may lead to cumbersome notations and it is often the case that these indices are omitted. One must then determine from the context or from some convention which variable to take the expectation of.

Such notational shortcut is very common in the case of iterated expectations where $\operatorname{E} \left( \operatorname{E} (X \mid Y) \right)$ usually stands for $\operatorname{E}_Y \left( \operatorname{E}_{X\mid Y} (X \mid Y) \right)$. By convention, in the notation without indices, the innermost expectation is the conditional expectation of $X$ given $Y$, and that the outermost expectation is taken with respect to the conditioning variable $Y$. This convention is notably used in the rest of this article.

## Iterated expectations with nested conditioning sets

The following formulation of the law of iterated expectations plays an important role in many economic and finance models:

$\operatorname{E} (X \mid I_1) = \operatorname{E} ( \operatorname{E} ( X \mid I_2) \mid I_1),$

where the value of I1 is determined by that of I2. To build intuition, imagine an investor who forecasts a random stock price X based on the limited information set I1. The law of iterated expectations says that the investor can never gain a more precise forecast of X by conditioning on more specific information (I2), if the more specific forecast must itself be forecast with the original information (I1).

This formulation is often applied in a time series context, where Et denotes expectations conditional on only the information observed up to and including time period t. In typical models the information set t + 1 contains all information available through time t, plus additional information revealed at time t + 1. One can then write:[2]

$\operatorname{E}_t(X) = \operatorname{E}_t ( \operatorname{E}_{t+1} ( X )).$