Tutorials › Measure Theory › Diagnosing Errors in Conditional Expectation Calculations

Expectation, Conditional Expectation and Independence · Tutorial 766 of 798

Diagnosing Errors in Conditional Expectation Calculations

Use the defining integral criterion to locate common errors in conditional-expectation arguments and verify the corrected calculations.

Advanced 10 min read

What You'll Learn

  • Distinguish equality almost surely from equality at every point.
  • Check which sigma-algebra a conditional expectation is measurable with respect to.
  • Identify the measurability and integrability conditions behind the pull-out rule.
  • Handle zero-probability cells without dividing by zero.
  • Recognize when an expectation is undefined because both positive and negative parts have infinite expectation.

A Diagnostic Starting Point

Many errors in conditional-expectation calculations are not algebra errors. They arise from treating an almost-sure identity as pointwise, silently changing the sigma-algebra one conditions on, pulling out a factor that is not measurable with respect to that sigma-algebra, or applying a theorem when the relevant expectation does not exist. The defining integral criterion provides a reliable way to check each step.

Throughout, \((\Omega,\mathcal{F},\mathbb{P})\) is a probability space, \(\mathcal{G}\subseteq\mathcal{F}\) is a sigma-algebra, and random variables in the definition below are real-valued. A random variable \(X\) is integrable when \(\mathbb{E}[|X|]<\infty\). Conditional expectations in this tutorial are integrable unless explicitly described as nonnegative extended integrals.

Definition: For an integrable real-valued random variable \(X\), a conditional expectation of \(X\) given \(\mathcal{G}\) is an integrable, \(\mathcal{G}\)-measurable real-valued random variable \(Y\) such that \(\mathbb{E}[Y\chi_A]=\mathbb{E}[X\chi_A]\) for every \(A\in\mathcal{G}\). It is denoted \(\mathbb{E}[X\mid\mathcal{G}]\). It is determined only up to equality \(\mathbb{P}\)-almost surely, not necessarily at every point.

Existence follows from the Radon–Nikodym theorem, and the definition is the test to use when checking a proposed answer. In particular, a proposed conditional expectation must be measurable with respect to the specified sigma-algebra, integrable, and have the correct integrals over every event in that sigma-algebra. The notation \(\mathbb{E}[X\mid\mathcal{G}]\) does not name one uniquely specified pointwise function.

Almost-Sure Equality and Uniqueness

Proposition: If \(U\) and \(V\) are integrable and \(\mathcal{G}\)-measurable on \((\Omega,\mathcal{F},\mathbb{P})\), and \(\mathbb{E}[U\chi_A]=\mathbb{E}[V\chi_A]\) for every \(A\in\mathcal{G}\), then \(U=V\) \(\mathbb{P}\)-almost surely. Consequently, any two versions of \(\mathbb{E}[X\mid\mathcal{G}]\) are equal almost surely.

Proof. Set \(D=U-V\). Then \(D\) is integrable and \(\mathcal{G}\)-measurable, and \(\mathbb{E}[D\chi_A]=0\) for every \(A\in\mathcal{G}\). For each positive integer \(n\), the set \(A_n=\{D>1/n\}\) belongs to \(\mathcal{G}\). Since \(D\chi_{A_n}\ge (1/n)\chi_{A_n}\), we have \(0=\mathbb{E}[D\chi_{A_n}]\ge (1/n)\mathbb{P}(A_n)\), so \(\mathbb{P}(A_n)=0\). The same argument applied to \(-D\) shows \(\mathbb{P}(\{D<-1/n\})=0\). Since \(\{D>0\}=\bigcup_{n\ge1}A_n\) and \(\{D<0\}=\bigcup_{n\ge1}\{D<-1/n\}\), both sets are null. Thus \(D=0\) almost surely. \(\square\)

Worked Example: Two Versions That Differ at One Point

Take \(\Omega=[0,1]\), \(\mathcal{F}=\mathcal{G}=\mathcal{B}_{[0,1]}\), and let \(\mathbb{P}\) be Lebesgue probability measure. Let \(X(x)=0\) for every \(x\), and define \(Y(x)=\chi_{\{0\}}(x)\).

Both \(0\) and \(Y\) are integrable and \(\mathcal{G}\)-measurable. For every \(A\in\mathcal{G}\), \(\mathbb{E}[0\cdot\chi_A]=0\), while \(\mathbb{E}[Y\chi_A]=\mathbb{P}(A\cap\{0\})=0\), because \(\mathbb{P}(\{0\})=0\). Thus both are versions of \(\mathbb{E}[X\mid\mathcal{G}]\). At \(x=0\), however, \(Y(0)=1\) and \(0=0\), so they are not equal everywhere. Check: \(\mathbb{E}[Y]=\mathbb{P}(\{0\})=0=\mathbb{E}[X]\), consistent with the defining criterion for \(A=\Omega\).

A pointwise comparison between versions is therefore not justified unless a particular version has been fixed and the claim is about that version. Any algebraic identity between conditional expectations should ordinarily be read as holding almost surely. Also, changing a function on an arbitrary null set does not automatically preserve \(\mathcal{G}\)-measurability; the changed function must still be measurable with respect to the conditioning sigma-algebra.

Check the Conditioning Sigma-Algebra

Conditional expectation depends on the information represented by \(\mathcal{G}\). If \(\mathcal{G}\) is enlarged, the conditional expectation can change. The tower property, established in the earlier material on conditional expectation, applies when the sigma-algebras are nested: if \(\mathcal{G}\subseteq\mathcal{H}\), then \(\mathbb{E}[\mathbb{E}[X\mid\mathcal{H}]\mid\mathcal{G}]=\mathbb{E}[X\mid\mathcal{G}]\) almost surely for integrable \(X\). It does not say that conditioning on different sigma-algebras gives the same answer.

Worked Example: Conditioning on a Partition Versus Full Information

Let \(\Omega=\{1,2,3,4\}\), give each point probability \(1/4\), let \(\mathcal{H}\) be the power set, and let \(\mathcal{G}=\{\varnothing,\{1,2\},\{3,4\},\Omega\}\). Set \(X(1)=0\), \(X(2)=2\), \(X(3)=4\), and \(X(4)=6\). All variables are integrable.

Conditioning on \(\mathcal{H}\), which contains every event, gives \(\mathbb{E}[X\mid\mathcal{H}]=X\). A \(\mathcal{G}\)-measurable conditional expectation must be constant on each of the two partition cells. The average of \(X\) on the positive-probability cell \(\{1,2\}\) is \((0+2)/2=1\), and on \(\{3,4\}\) it is \((4+6)/2=5\). Therefore a version of \(\mathbb{E}[X\mid\mathcal{G}]\) takes values \(1,1,5,5\).

For verification, the integral on \(\{1,2\}\) is \((1+1)/4=1/2\), equal to \(\mathbb{E}[X\chi_{\{1,2\}}]=(0+2)/4=1/2\). On \(\{3,4\}\), it is \((5+5)/4=5/2\), equal to \((4+6)/4=5/2\). The total expectation is \(3\) in both cases: \((1+1+5+5)/4=3\) and \((0+2+4+6)/4=3\). But \(\mathbb{E}[X\mid\mathcal{H}]\) and \(\mathbb{E}[X\mid\mathcal{G}]\) are not equal almost surely: for example, at point \(1\) their values are \(0\) and \(1\), and that point has probability \(1/4\). Applying the tower property to \(X\) conditioned on \(\mathcal{H}\), then on \(\mathcal{G}\), gives the values \(1,1,5,5\), as required.

Pulling Out a Factor: Two Checks

The usual integrable version of the pull-out rule has specific hypotheses. If \(X\) is integrable and \(Z\) is bounded and \(\mathcal{G}\)-measurable, then \(ZX\) is integrable and \(\mathbb{E}[ZX\mid\mathcal{G}]=Z\mathbb{E}[X\mid\mathcal{G}]\) almost surely. The boundedness assumption is a convenient sufficient condition; for an unbounded factor, integrability and the precise form of the rule need separate checking.

Proposition: On \((\Omega,\mathcal{F},\mathbb{P})\), let \(X\) be integrable and \(Z\) be bounded, real-valued and \(\mathcal{G}\)-measurable. Then \(Z\mathbb{E}[X\mid\mathcal{G}]\) is a version of \(\mathbb{E}[ZX\mid\mathcal{G}]\).

Proof. Write \(Y=\mathbb{E}[X\mid\mathcal{G}]\) and choose \(C<\infty\) such that \(|Z|\le C\) everywhere. Then \(\mathbb{E}[|ZX|]\le C\mathbb{E}[|X|]<\infty\), and \(\mathbb{E}[|ZY|]\le C\mathbb{E}[|Y|]<\infty\). The product \(ZY\) is \(\mathcal{G}\)-measurable. For any \(A\in\mathcal{G}\), the defining criterion implies \(\mathbb{E}[W X]=\mathbb{E}[W Y]\) for every bounded \(\mathcal{G}\)-measurable real-valued \(W\): first verify this for simple \(W\) by linearity and the criterion on its level sets, then approximate a bounded \(W\) uniformly by simple \(\mathcal{G}\)-measurable functions and use dominated convergence, with the integrable bounds given by a constant times \(|X|\) and \(|Y|\). Apply this identity to \(W=Z\chi_A\). It gives \(\mathbb{E}[ZX\chi_A]=\mathbb{E}[ZY\chi_A]\) for every \(A\in\mathcal{G}\). Thus \(ZY\) satisfies the defining criterion for \(\mathbb{E}[ZX\mid\mathcal{G}]\). \(\square\)

Worked Example: A Factor That Is Not Measurable for the Conditioning Sigma-Algebra

Let \(\Omega=\{1,2\}\) with probability \(1/2\) at each point, and let \(\mathcal{G}=\{\varnothing,\Omega\}\). Set \(X(1)=0\), \(X(2)=2\), and \(Z=X\). Since \(\mathcal{G}\) is trivial, \(\mathbb{E}[X\mid\mathcal{G}]\) is the constant \(\mathbb{E}[X]=(0+2)/2=1\). But \(Z\) is not \(\mathcal{G}\)-measurable: it is not constant.

The product \(ZX=X^2\) has values \(0,4\), so \(\mathbb{E}[ZX\mid\mathcal{G}]\) is the constant \((0+4)/2=2\). In contrast, the expression \(Z\mathbb{E}[X\mid\mathcal{G}]=X\) has values \(0,2\); it is not \(\mathcal{G}\)-measurable and is not equal almost surely to the constant \(2\). Check: its expectation is \((0+2)/2=1\), whereas the expectation of \(ZX\) is \((0+4)/2=2\). The pull-out rule cannot be applied because the factor is not measurable with respect to \(\mathcal{G}\).

Worked Example: An Unbounded Factor Can Destroy Integrability

Let \(\Omega=\mathbb{N}=\{1,2,\ldots\}\), \(\mathcal{F}=\mathcal{G}\) the power set, and \(\mathbb{P}(\{n\})=2^{-n}\). These probabilities sum to \(1\). Set \(X(n)=1\) and \(Z(n)=2^n\). Then \(\mathbb{E}[|X|]=\sum_{n\ge1}2^{-n}=1\), so \(X\) is integrable, and \(Z\) is \(\mathcal{G}\)-measurable. But \(ZX=Z\) and \(\mathbb{E}[|ZX|]=\sum_{n\ge1}2^n2^{-n}=\sum_{n\ge1}1=+\infty\).

Thus \(ZX\) is not integrable, and the integrable conditional-expectation rule cannot be invoked for it. In this example the nonnegative extended integral of \(ZX\) is \(+\infty\); that fact does not make \(ZX\) an integrable random variable. Check: the \(N\)-term partial expectation is \(\sum_{n=1}^N 1=N\), which tends to \(+\infty\). The missing condition is not measurability but integrability of the product.

Do the Expectations Exist?

The definition used here requires \(X\) to be integrable. For a real-valued \(X\), write \(X^+=\max(X,0)\) and \(X^-=\max(-X,0)\). The expectation is a finite real number if both \(\mathbb{E}[X^+]\) and \(\mathbb{E}[X^-]\) are finite. If just one is infinite, the extended expectation may be \(+\infty\) or \(-\infty\), respectively. If both are infinite, the expression \(\mathbb{E}[X]=\mathbb{E}[X^+]-\mathbb{E}[X^-]\) is undefined; it is not a number that can be used in a conditional-expectation calculation.

Worked Example: A Symmetric Random Variable with Undefined Expectation

On \(\Omega=\mathbb{Z}\setminus\{0\}\) with its power-set sigma-algebra, define \(\mathbb{P}(\{n\})=\mathbb{P}(\{-n\})=1/[2n(n+1)]\) for \(n\ge1\), and set \(X(k)=k\). The probabilities sum to \(1\), since the total probability at \(n\) and \(-n\) is \(1/[n(n+1)]=1/n-1/(n+1)\), whose partial sums tend to \(1\).

For the positive part, \(\mathbb{E}[X^+]=\sum_{n\ge1}n/[2n(n+1)]=\tfrac12\sum_{n\ge1}1/(n+1)=+\infty\). For the negative part, \(\mathbb{E}[X^-]=\tfrac12\sum_{n\ge1}1/(n+1)=+\infty\) as well. The harmonic series diverges, so both parts have infinite expectation. Therefore \(\mathbb{E}[X]\) is undefined, not zero. The symmetry of the probabilities does not justify subtracting two infinite quantities. Check: the first \(N\) positive terms contribute \(\tfrac12\sum_{n=1}^N1/(n+1)\), and the first \(N\) negative-part terms contribute the same amount; both partial sums diverge. Since \(X\) is not integrable, the integrable conditional expectation \(\mathbb{E}[X\mid\mathcal{G}]\) is not covered by the definition used here.

Zero-Probability Cells in Finite Calculations

On a finite probability space, the conditional expectation given a partition is constant on each cell. The average of \(X\) over a cell \(C\) determines that constant only when \(\mathbb{P}(C)>0\). On a zero-probability cell, the average would require division by zero, and the integral criterion places no constraint on the value there. The version must still be measurable, but its value on that cell can be chosen arbitrarily.

Worked Example: A Partition with a Null Cell

Let \(\Omega=\{a,b,c\}\), \(\mathcal{F}\) the power set, with \(\mathbb{P}(\{a\})=1/2\), \(\mathbb{P}(\{b\})=1/2\), and \(\mathbb{P}(\{c\})=0\). Let \(\mathcal{G}=\mathcal{F}\), and define \(X(a)=2\), \(X(b)=4\), \(X(c)=100\). All these random variables are integrable because the space is finite and the value at \(c\) contributes zero to the integral.

Define \(Y(a)=2\), \(Y(b)=4\), and \(Y(c)=17\). Since \(\mathcal{G}\) is the power set, \(Y\) is \(\mathcal{G}\)-measurable. For each \(A\in\mathcal{G}\), the contribution from \(a\) to \(\mathbb{E}[Y\chi_A]\) equals the contribution from \(a\) to \(\mathbb{E}[X\chi_A]\), and the same holds at \(b\); the contribution from \(c\) is zero on both sides. Hence \(Y\) satisfies the defining criterion. In particular, \(\mathbb{E}[Y]=2(1/2)+4(1/2)+17(0)=3\), and \(\mathbb{E}[X]=2(1/2)+4(1/2)+100(0)=3\).

On the positive-probability cells \(\{a\}\) and \(\{b\}\), the required conditional averages are respectively \(2\) and \(4\). On \(\{c\}\), the value \(17\) is allowed, as would be any other finite value. The formula for the cell average must not be used there: it would divide the zero integral over \(\{c\}\) by \(\mathbb{P}(\{c\})=0\). Check: \(Y(c)\ne X(c)\), but this discrepancy occurs only on a null set, so \(Y=X\) almost surely.

A Practical Audit

When checking a conditional-expectation calculation, identify the sigma-algebra first, and then check measurability with respect to it. Confirm that the random variable being conditioned is integrable, or state explicitly when a nonnegative extended integral is being used instead. For a pull-out step, check that the factor is \(\mathcal{G}\)-measurable and that the products meet the integrability conditions of the rule being applied. Finally, interpret the result as an almost-sure equality and, for a finite partition, do not divide by the probability of a null cell.

Common mistake. A common incorrect line is \(\mathbb{E}[ZX\mid\mathcal{G}]=Z\mathbb{E}[X\mid\mathcal{G}]\) for every \(Z\), followed by a pointwise comparison of the two sides. The correction is to check that \(Z\) is \(\mathcal{G}\)-measurable and that the relevant products are integrable; under the bounded-factor hypotheses proved above, the identity holds almost surely. It need not hold at every point for arbitrarily chosen versions.

Check Your Understanding

For each question, state the conditioning sigma-algebra and check the relevant integrability or positive-probability condition before calculating.

  1. Give two different pointwise versions of the conditional expectation of the zero random variable given the Borel sigma-algebra on \([0,1]\), and verify the defining criterion.
  2. In the four-point partition example, why is the conditional expectation given the two-cell sigma-algebra constant on each cell?
  3. State the measurability and boundedness hypotheses in the pull-out proposition, and explain why they ensure both products are integrable.
  4. For the three-point example with \(\mathbb{P}(\{c\})=0\), why is it invalid to compute the conditional average on \(\{c\}\) by dividing by its probability?
  5. For a real random variable with \(\mathbb{E}[X^+]=\mathbb{E}[X^-]=+\infty\), explain why symmetry alone does not define \(\mathbb{E}[X]\).