Wald's equation

In probability theory, Wald's equation, Wald's identity or Wald's lemma is an important identity that simplifies the calculation of the expected value of the sum of a random number of random quantities. In its simplest form, it relates the expectation of a sum of randomly many finite-mean, independent and identically distributed random variables to the expected number of terms in the sum and the random variables' common expectation under the condition that the number of terms in the sum is independent of the summands.

The equation is named after the mathematician Abraham Wald. An identity for the second moment is given by the Blackwell–Girshick equation.

Basic version
Let $(X_{n})_{n∈$\mathbb{N}$}$ be a sequence of real-valued, independent and identically distributed random variables and let $N ≥ 0$ be an integer-valued random variable that is independent of the sequence $(X_{n})_{n∈$\mathbb{N}$}$. Suppose that $N$ and the $X_{n}$ have finite expectations. Then


 * $$\operatorname{E}[X_1+\dots+X_N]=\operatorname{E}[N] \operatorname{E}[X_1]\,.$$

Example
Roll a six-sided dice. Take the number on the die (call it $N$) and roll that number of six-sided dice to get the numbers $X_{1},. . ., X_{N}$, and add up their values. By Wald's equation, the resulting value on average is


 * $$\operatorname{E}[N] \operatorname{E}[X] = \frac{1+2+3+4+5+6}6\cdot\frac{1+2+3+4+5+6}6 = \frac{441}{36} = \frac{49}{4} = 12.25\,.$$

General version
Let $(X_{n})_{n∈$\mathbb{N}$}$ be an infinite sequence of real-valued random variables and let $N$ be a nonnegative integer-valued random variable.

Assume that:


 * $$. $(X_{n})_{n∈$\mathbb{N}$}$ are all integrable (finite-mean) random variables,
 * $$. $E [ X_{n}1_ ] = E [ X_{n} ] P(N ≥ n)$ for every natural number $n$, and
 * $$. the infinite series satisfies


 * $$\sum_{n=1}^\infty\operatorname{E}\!\bigl[|X_n| 1_{\{N\ge n\}}\bigr]<\infty.$$

Then the random sums
 * $$S_N:=\sum_{n=1}^NX_n,\qquad T_N:=\sum_{n=1}^N\operatorname{E}[X_n]$$

are integrable and
 * $$\operatorname{E}[S_N]=\operatorname{E}[T_N].$$

If, in addition,
 * $$. $(X_{n})_{n∈$\mathbb{N}$}$ all have the same expectation, and
 * $$. $N$ has finite expectation,

then


 * $$\operatorname{E}[S_N]=\operatorname{E}[N]\, \operatorname{E}[X_1].$$

Remark: Usually, the name Wald's equation refers to this last equality.

Discussion of assumptions
Clearly, assumption ($$) is needed to formulate assumption ($$) and Wald's equation. Assumption ($$) controls the amount of dependence allowed between the sequence $(X_{n})_{n∈$\mathbb{N}$}$ and the number $N$ of terms; see the counterexample below for the necessity. Note that assumption ($$)  is satisfied when  $N$  is a stopping time for a sequence of independent random variables $(X_{n})_{n∈$\mathbb{N}$}$. Assumption ($$) is of more technical nature, implying absolute convergence and therefore allowing arbitrary rearrangement of an infinite series in the proof.

If assumption ($$) is satisfied, then assumption ($$) can be strengthened to the simpler condition


 * $$. there exists a real constant $C$ such that $E [$ for all natural numbers $n$.

Indeed, using assumption ($$),


 * $$\sum_{n=1}^\infty\operatorname{E}\!\bigl[|X_n|1_{\{N\ge n\}}\bigr]\le

C\sum_{n=1}^\infty\operatorname{P}(N\ge n),$$

and the last series equals the expectation of $N$ [ Proof ], which is finite by assumption ($$). Therefore, ($$) and ($$) imply assumption ($$).

Assume in addition to ($$) and ($$) that
 * $$. $N$ is independent of the sequence $(X_{n})_{n∈$\mathbb{N}$}$ and
 * $$. there exists a constant $C$ such that $E [$ for all natural numbers $n$.

Then all the assumptions ($$), ($$), ($$) and ($$), hence also ($$) are satisfied. In particular, the conditions ($$) and ($$) are satisfied if
 * $$. the random variables $(X_{n})_{n∈$\mathbb{N}$}$ all have the same distribution.

Note that the random variables of the sequence $(X_{n})_{n∈$\mathbb{N}$}$ don't need to be independent.

The interesting point is to admit some dependence between the random number $N$ of terms and the sequence $(X_{n})_{n∈$\mathbb{N}$}$. A standard version is to assume ($$), ($$), ($$) and the existence of a filtration $(\mathcal{F}_{n})_{n∈$\mathbb{N}$_{0}}|undefined$ such that
 * $$. $N$ is a stopping time with respect to the filtration, and
 * $$. $X_{n}$ and $\mathcal{F}_{n–1}$ are independent for every $n ∈ $\mathbb{N}$$.

Then ($$) implies that the event ${N ≥ n} = {N ≤ n – 1}^{c}$ is in $\mathcal{F}_{n–1}$, hence by ($$) independent of $X_{n}$. This implies ($$), and together with ($$) it implies ($$).

For convenience (see the proof below using the optional stopping theorem) and to specify the relation of the sequence $(X_{n})_{n∈$\mathbb{N}$}$ and the filtration $(\mathcal{F}_{n})_{n∈$\mathbb{N}$_{0}}|undefined$, the following additional assumption is often imposed:
 * $$. the sequence $(X_{n})_{n∈$\mathbb{N}$}$ is adapted to the filtration $(\mathcal{F}_{n})_{n∈$\mathbb{N}$}$, meaning the $X_{n}$ is $\mathcal{F}_{n}$-measurable for every $n ∈ $\mathbb{N}$$.

Note that ($$) and ($$) together imply that the random variables $(X_{n})_{n∈$\mathbb{N}$}$ are independent.

Application
An application is in actuarial science when considering the total claim amount follows a compound Poisson process


 * $$S_N=\sum_{n=1}^NX_n$$

within a certain time period, say one year, arising from a random number $N$ of individual insurance claims, whose sizes are described by the random variables $(X_{n})_{n∈$\mathbb{N}$}$. Under the above assumptions, Wald's equation can be used to calculate the expected total claim amount when information about the average claim number per year and the average claim size is available. Under stronger assumptions and with more information about the underlying distributions, Panjer's recursion can be used to calculate the distribution of $S_{N}$.

Example with dependent terms
Let $N$ be an integrable, $$\mathbb{N}$_{0}$-valued random variable, which is independent of the integrable, real-valued random variable $Z$ with $E [ Z ] = 0$. Define $X_{n} = (–1)^{n} Z$ for all $n ∈ $\mathbb{N}$$. Then assumptions ($$), ($$), ($$), and ($$) with $Z$ are satisfied, hence also ($$) and ($$), and Wald's equation applies. If the distribution of $Z$ is not symmetric, then ($$) does not hold. Note that, when $Z$ is not almost surely equal to the zero random variable, then ($$) and ($$) cannot hold simultaneously for any filtration $(\mathcal{F}_{n})_{n∈$\mathbb{N}$}$, because $Z$ cannot be independent of itself as $E [ Z^{2} ] = (E [ Z ] )^{2} = 0$ is impossible.

Example where the number of terms depends on the sequence
Let $(X_{n})_{n∈$\mathbb{N}$}$ be a sequence of independent, symmetric, and ${–1, +1}$-valued random variables. For every $n ∈ $\mathbb{N}$$ let $\mathcal{F}_{n}$ be the σ-algebra generated by $X_{1},. . ., X_{n}$ and define $N = n$ when $X_{n}$ is the first random variable taking the value $+1$. Note that $P(N = n) = 1/2^{n}$, hence $E [ N ] < ∞$ by the ratio test. The assumptions ($$), ($$) and ($$), hence ($$) and ($$) with $C = 1$, ($$), ($$), and ($$) hold, hence also ($$), and ($$) and Wald's equation applies. However, ($$) does not hold, because $N$ is defined in terms of the sequence $(X_{n})_{n∈$\mathbb{N}$}$. Intuitively, one might expect to have $E [ S_{N} ] > 0$ in this example, because the summation stops right after a one, thereby apparently creating a positive bias. However, Wald's equation shows that this intuition is misleading.

A counterexample illustrating the necessity of assumption ($$)
Consider a sequence $(X_{n})_{n∈$\mathbb{N}$}$ of i.i.d. (Independent and identically distributed random variables) random variables, taking each of the two values 0 and 1 with probability $1⁄2$ (actually, only $X_{1}$ is needed in the following). Define $N = 1 – X_{1}$. Then $S_{N}$ is identically equal to zero, hence $E [ S_{N} ] = 0$, but $E [ X_{1} ] = 1⁄2$ and $E [ N ] = 1⁄2$ and therefore Wald's equation does not hold. Indeed, the assumptions ($$), ($$), ($$) and ($$) are satisfied, however, the equation in assumption ($$) holds for all $n ∈ $\mathbb{N}$$ except for $n = 1$.

A counterexample illustrating the necessity of assumption ($$)
Very similar to the second example above, let $(X_{n})_{n∈$\mathbb{N}$}$ be a sequence of independent, symmetric random variables, where $X_{n}$ takes each of the values $2^{n}$ and $–2^{n}$ with probability $$. Let $N$ be the first $n ∈ $\mathbb{N}$$ such that $X_{n} = 2^{n}$. Then, as above, $N$ has finite expectation, hence assumption ($1⁄2$) holds. Since $E [ X_{n} ] = 0$ for all $n ∈ $\mathbb{N}$$, assumptions ($$) and ($$) hold. However, since $S_{N} = 1$ almost surely, Wald's equation cannot hold.

Since $N$ is a stopping time with respect to the filtration generated by $(X_{n})_{n∈$\mathbb{N}$}$, assumption ($$) holds, see above. Therefore, only assumption ($$) can fail, and indeed, since


 * $$\{N\ge n\}=\{X_i=-2^{i} \text{ for } i=1,\ldots,n-1\}$$

and therefore $P(N ≥ n) = 1/2^{n–1}$ for every $n ∈ $\mathbb{N}$$, it follows that


 * $$\sum_{n=1}^\infty\operatorname{E}\!\bigl[|X_n|1_{\{N\ge n\}}\bigr]

=\sum_{n=1}^\infty 2^n\,\operatorname{P}(N\ge n) =\sum_{n=1}^\infty 2=\infty.$$

A proof using the optional stopping theorem
Assume ($$), ($$), ($$), ($$), ($$) and ($$). Using assumption ($$), define the sequence of random variables


 * $$M_n = \sum_{i=1}^n (X_i - \operatorname{E}[X_i]),\quad n\in{\mathbb N}_0.$$

Assumption ($$) implies that the conditional expectation of $X_{n}$ given $\mathcal{F}_{n–1}$ equals $E [ X_{n} ]$ almost surely for every $n ∈ $\mathbb{N}$$, hence $(M_{n})_{n∈$\mathbb{N}$_{0}}|undefined$ is a martingale with respect to the filtration $(\mathcal{F}_{n})_{n∈$\mathbb{N}$_{0}}|undefined$ by assumption ($$). Assumptions ($$), ($$) and ($$) make sure that we can apply the optional stopping theorem, hence $M_{N} = S_{N} – T_{N}$ is integrable and

Due to assumption ($$),


 * $$|T_N|=\biggl|\sum_{i=1}^N\operatorname{E}[X_i]\biggr| \le \sum_{i=1}^N\operatorname{E}[|X_i|]\le CN,$$

and due to assumption ($$) this upper bound is integrable. Hence we can add the expectation of $T_{N}$ to both sides of Equation ($$) and obtain by linearity


 * $$\operatorname{E}[S_N]

=\operatorname{E}[T_N].$$

Remark: Note that this proof does not cover the above example with dependent terms.

General proof
This proof uses only Lebesgue's monotone and dominated convergence theorems. We prove the statement as given above in three steps.

Step 1: Integrability of the random sum $S_{N}$
We first show that the random sum $S_{N}$ is integrable. Define the partial sums

Since $N$ takes its values in $$\mathbb{N}$_{0}$ and since $S_{0} = 0$, it follows that


 * $$|S_N|=\sum_{i=1}^\infty|S_i|\,1_{\{N=i\}}.$$

The Lebesgue monotone convergence theorem implies that


 * $$\operatorname{E}[|S_N|]=\sum_{i=1}^\infty\operatorname{E}[|S_i|\,1_{\{N=i\}}].$$

By the triangle inequality,


 * $$|S_i|\le\sum_{n=1}^i|X_n|,\quad i\in{\mathbb N}.$$

Using this upper estimate and changing the order of summation (which is permitted because all terms are non-negative), we obtain

where the second inequality follows using the monotone convergence theorem. By assumption ($$), the infinite sequence on the right-hand side of ($$) converges, hence $S_{N}$ is integrable.

Step 2: Integrability of the random sum $T_{N}$
We now show that the random sum $T_{N}$ is integrable. Define the partial sums

of real numbers. Since $N$ takes its values in $$\mathbb{N}$_{0}$ and since $T_{0} = 0$, it follows that


 * $$|T_N|=\sum_{i=1}^\infty|T_i|\,1_{\{N=i\}}.$$

As in step 1, the Lebesgue monotone convergence theorem implies that


 * $$\operatorname{E}[|T_N|]=\sum_{i=1}^\infty |T_i|\operatorname{P}(N=i).$$

By the triangle inequality,


 * $$|T_i|\le\sum_{n=1}^i\bigl|\!\operatorname{E}[X_n]\bigr|,\quad i\in{\mathbb N}.$$

Using this upper estimate and changing the order of summation (which is permitted because all terms are non-negative), we obtain

By assumption ($$),


 * $$\bigl|\!\operatorname{E}[X_n]\bigr|\operatorname{P}(N\ge n)

=\bigl|\!\operatorname{E}[X_n1_{\{N\ge n\}}]\bigr| \le\operatorname{E}[|X_n|1_{\{N\ge n\}}],\quad n\in{\mathbb N}.$$

Substituting this into ($$) yields


 * $$\operatorname{E}[|T_N|]\le\sum_{n=1}^\infty\operatorname{E}[|X_n|1_{\{N\ge n\}}],$$

which is finite by assumption ($$), hence $T_{N}$ is integrable.

Step 3: Proof of the identity
To prove Wald's equation, we essentially go through the same steps again without the absolute value, making use of the integrability of the random sums $S_{N}$ and $T_{N}$ in order to show that they have the same expectation.

Using the dominated convergence theorem with dominating random variable $|S_{N}|$ and the definition of the partial sum $S_{i}$ given in ($$), it follows that


 * $$\operatorname{E}[S_N]=\sum_{i=1}^\infty\operatorname{E}[S_i1_{\{N=i\}}]

=\sum_{i=1}^\infty\sum_{n=1}^i\operatorname{E}[X_n1_{\{N=i\}}].$$

Due to the absolute convergence proved in ($$) above using assumption ($$), we may rearrange the summation and obtain that


 * $$\operatorname{E}[S_N]=\sum_{n=1}^\infty\sum_{i=n}^\infty\operatorname{E}[X_n1_{\{N=i\}}]=\sum_{n=1}^\infty\operatorname{E}[X_n1_{\{N\ge n\}}],$$

where we used assumption ($$) and the dominated convergence theorem with dominating random variable $|X_{n}|$ for the second equality. Due to assumption ($$) and the σ-additivity of the probability measure,


 * $$\begin{align}\operatorname{E}[X_n1_{\{N\ge n\}}] &=\operatorname{E}[X_n]\operatorname{P}(N\ge n)\\

&=\operatorname{E}[X_n]\sum_{i=n}^\infty\operatorname{P}(N=i) =\sum_{i=n}^\infty\operatorname{E}\!\bigl[\operatorname{E}[X_n]1_{\{N=i\}}\bigr].\end{align}$$

Substituting this result into the previous equation, rearranging the summation (which is permitted due to absolute convergence, see ($$) above), using linearity of expectation and the definition of the partial sum $T_{i}$ of expectations given in ($$),


 * $$\operatorname{E}[S_N]=\sum_{i=1}^\infty\sum_{n=1}^i\operatorname{E}\!\bigl[\operatorname{E}[X_n]1_{\{N=i\}}\bigr]=\sum_{i=1}^\infty\operatorname{E}[\underbrace{T_i1_{\{N=i\}}}_{=\,T_N1_{\{N=i\}}}].$$

By using dominated convergence again with dominating random variable $|T_{N}|$,


 * $$\operatorname{E}[S_N]=\operatorname{E}\!\biggl[T_N\underbrace{\sum_{i=1}^\infty1_{\{N=i\}}}_{=\,1_{\{N\ge1\}}}\biggr]=\operatorname{E}[T_N].$$

If assumptions ($$) and ($$) are satisfied, then by linearity of expectation,


 * $$\operatorname{E}[T_N]=\operatorname{E}\!\biggl[\sum_{n=1}^N \operatorname{E}[X_n]\biggr]=\operatorname{E}[X_1]\operatorname{E}\!\biggl[\underbrace{\sum_{n=1}^N 1}_{=\,N}\biggr]=\operatorname{E}[N]\operatorname{E}[X_1].$$

This completes the proof.

Further generalizations

 * Wald's equation can be transferred to $R^{d}$-valued random variables $(X_{n})_{n∈$\mathbb{N}$}$ by applying the one-dimensional version to every component.
 * If $(X_{n})_{n∈$\mathbb{N}$}$ are Bochner-integrable random variables taking values in a Banach space, then the general proof above can be adjusted accordingly.