Conditional Expectation

Author

John Robin Inston

Published

September 25, 2026

Throughout, \((\Omega,\mathcal{F},\mathbb{P})\) is a probability space, \(X,Y\) are random variables and \(\mathbb{E}\) denotes Expectation. We build conditional expectation in three steps: given an event, given a σ-algebra, and finally as an orthogonal projection, which makes precise the idea of the best prediction of \(Y\) from partial information.

1 Conditioning on an event

Let \(F\in\mathcal{F}\) with \(\mathbb{P}(F)>0\).

The conditional probability given \(F\) is, for every \(E\in\mathcal{F}\), \[ \mathbb{P}_{F}(E)=\mathbb{P}(E\mid F):=\frac{\mathbb{P}(E\cap F)}{\mathbb{P}(F)}. \] It is a probability measure, so \((\Omega,\mathcal{F},\mathbb{P}_{F})\) is a new probability space. Random variables are unchanged but have a new distribution. For \(X\) with \(\mathbb{E}|X|<\infty\) the conditional expectation given \(F\) is the expectation under \(\mathbb{P}_F\): \[ \mathbb{E}[X\mid F]:=\int_{\Omega}X\,d\mathbb{P}_{F} =\frac{1}{\mathbb{P}(F)}\int_{F}X\,d\mathbb{P} =\frac{\mathbb{E}[X\mathbb{1}_{F}]}{\mathbb{P}(F)}. \]

If \(\mathbb{P}(F)=0\) we may set \(\mathbb{P}_F\equiv0\) and extend the notions trivially. The conditional distribution function of \(X\) given \(F\) is \[ F_{X|F}(x)=\mathbb{P}(X\leq x\mid F)=\frac{\mathbb{P}(\{X\leq x\}\cap F)}{\mathbb{P}(F)}, \] and when it is differentiable its derivative \(f_{X|F}\) is the conditional density, so that \(\mathbb{E}[X\mid F]=\int x f_{X|F}(x)\,dx\).

2 Conditioning on a σ-algebra

Conditioning on a single event only uses one yes/no piece of information. We now condition on a whole σ-algebra of observable events.

2.1 Countable partitions

Let \(\{F_{n};n\geq1\}\) be a countable partition of \(\Omega\) (disjoint sets with union \(\Omega\), each of positive probability) and let \(\mathcal{G}\) be the σ-algebra generated by it. By countable additivity, \[ \mathbb{P}(E)=\sum_{n}\mathbb{P}(F_{n})\mathbb{P}_{F_{n}}(E),\qquad \mathbb{E}[X]=\sum_{n}\mathbb{P}(F_{n})\mathbb{E}[X\mid F_{n}]. \] Define the simple random variable \[ \mathbb{E}[X\mid\mathcal{G}](\omega):=\sum_{n}\mathbb{E}[X\mid F_{n}]\, \mathbb{1}_{F_{n}}(\omega),\qquad\omega\in\Omega. \] It is \(\mathcal{G}\)-measurable and for every \(\Lambda\in\mathcal{G}\) (a union of partition elements) \[ \mathbb{E}\big[\mathbb{E}[X\mid\mathcal{G}]\mathbb{1}_{\Lambda}\big] =\mathbb{E}[X\mathbb{1}_{\Lambda}], \] and in particular \(\mathbb{E}[\mathbb{E}[X\mid\mathcal{G}]]=\mathbb{E}[X]\). This identity is what generalises.

2.2 General definition

Let \(\mathcal{G}\subseteq\mathcal{F}\) be a sub-σ-algebra and \(X\) an integrable random variable. The conditional expectation of \(X\) given \(\mathcal{G}\) is the (a.s. unique) \(\mathcal{G}\)-measurable integrable random variable \(\mathbb{E}[X\mid\mathcal{G}]\) such that \[ \mathbb{E}\big[X\mathbb{1}_{\Lambda}\big] =\mathbb{E}\big[\mathbb{E}[X\mid\mathcal{G}]\mathbb{1}_{\Lambda}\big], \qquad\text{for all }\Lambda\in\mathcal{G}. \] For \(E\in\mathcal{F}\) the conditional probability of \(E\) given \(\mathcal{G}\) is \(\mathbb{P}(E\mid\mathcal{G}):=\mathbb{E}[\mathbb{1}_E\mid\mathcal{G}]\), the \(\mathcal{G}\)-measurable random variable with values in \([0,1]\) such that \[ \mathbb{P}(E\cap\Lambda)=\mathbb{E}\big[\mathbb{P}(E\mid\mathcal{G})\mathbb{1}_{\Lambda}\big], \qquad\Lambda\in\mathcal{G}. \]

Existence and uniqueness follow from the Radon-Nikodym Derivative: the signed measure \(\Lambda\mapsto\mathbb{E}[X\mathbb{1}_\Lambda]\) is absolutely continuous with respect to \(\mathbb{P}\) on \(\mathcal{G}\), and \(\mathbb{E}[X\mid\mathcal{G}]\) is its density. Section 4 gives a second construction by projection.

2.3 Conditioning on a random variable

For a random variable \(Z\) we write \(\mathbb{E}[X\mid Z]:=\mathbb{E}[X\mid\sigma(Z)]\), where \(\sigma(Z)\) is the [[generated-sigma-algebra|σ-algebra generated by \(Z\)]]. By the Doob-Dynkin lemma, \(\mathbb{E}[X\mid Z]=h(Z)\) for some Borel function \(h\).

If \((X,Z)\) has joint density \(f_{X,Z}\) and \(f_Z(z)>0\), the conditional density and conditional distribution function of \(X\) given \(Z=z\) are \[ f_{X|Z}(x\mid z)=\frac{f_{X,Z}(x,z)}{f_{Z}(z)},\qquad F_{X|Z}(x\mid z)=\int_{-\infty}^{x}f_{X|Z}(u\mid z)\,du, \] and then \(h(z)=\int x f_{X|Z}(x\mid z)\,dx\).

3 Conditional expectation as a projection

Conditional expectation is the best prediction of \(Y\) given partial information, in the mean-square sense. This uses the Hilbert space structure of square-integrable random variables.

An inner product space is a real vector space \(\mathcal{V}\) with a symmetric, bilinear, positive-definite map \(\langle\cdot,\cdot\rangle:\mathcal{V}\times\mathcal{V}\to\mathbb{R}\); it induces the norm \(\lVert v\rVert=\sqrt{\langle v,v\rangle}\). A Hilbert space is an inner product space that is complete in this norm: every Cauchy sequence converges to an element of \(\mathcal{V}\). See Hilbert Spaces.

For a closed subspace \(\mathcal{V}_1\subseteq\mathcal{V}\) and \(v\in\mathcal{V}\), the distance from \(v\) to \(\mathcal{V}_1\) is \(d=\inf_{v_1\in\mathcal{V}_1}\lVert v-v_1\rVert\), and the minimiser \(v_1^*\) is the orthogonal projection of \(v\) onto \(\mathcal{V}_1\).

If \(\mathcal{V}_1\) is a closed subspace of a Hilbert space \(\mathcal{V}\), then for every \(v\in\mathcal{V}\) there is a unique \(v_1^*\in\mathcal{V}_1\) with \(\lVert v-v_1^*\rVert\leq\lVert v-v_1\rVert\) for all \(v_1\in\mathcal{V}_1\), and this is equivalent to the orthogonality condition \[ \langle v-v_1^*,v_1\rangle=0\qquad\text{for all }v_1\in\mathcal{V}_1. \]

Now take \(\mathcal{V}=L^2(\Omega,\mathcal{F},\mathbb{P})\), the space of random variables with \(\mathbb{E}[X^2]<\infty\), with inner product \(\langle X,Y\rangle=\mathbb{E}[XY]\) (see Lp Spaces). For a sub-σ-algebra \(\mathcal{G}\), the set of \(\mathcal{G}\)-measurable square integrable random variables is a closed subspace. For \(\mathcal{G}=\sigma(X)\) it equals \(A_X=\{h(X):h\text{ Borel},~\mathbb{E}[h(X)^2]<\infty\}\).

For \(Y\in L^2\) and \(\mathcal{G}\subseteq\mathcal{F}\), the orthogonal projection of \(Y\) onto the \(\mathcal{G}\)-measurable subspace is \(\mathbb{E}[Y\mid\mathcal{G}]\), so \[ \mathbb{E}\big[(Y-\mathbb{E}[Y\mid\mathcal{G}])Z\big]=0,\qquad \lVert Y-\mathbb{E}[Y\mid\mathcal{G}]\rVert=\min_{Z\in L^2(\mathcal{G})}\lVert Y-Z\rVert. \] In particular \(\mathbb{E}[Y\mid X]\) is the best mean-square predictor of \(Y\) from \(X\).

Proof. By the projection theorem let \(Y^*\) be the projection. Taking \(Z=\mathbb{1}_\Lambda\) with \(\Lambda\in\mathcal{G}\) in the orthogonality condition gives \(\mathbb{E}[Y\mathbb{1}_\Lambda]=\mathbb{E}[Y^*\mathbb{1}_\Lambda]\), and \(Y^*\) is \(\mathcal{G}\)-measurable, so \(Y^*=\mathbb{E}[Y\mid\mathcal{G}]\) a.s. by the uniqueness in the definition.

4 Properties

Let \(\mathcal{G},\mathcal{G}_1,\mathcal{G}_2\) be sub-σ-algebras of \(\mathcal{F}\). Assuming the variables below are integrable (or square integrable where indicated), the following hold almost surely.

  1. Linearity. \(\mathbb{E}[\alpha X+\beta Y\mid\mathcal{G}]=\alpha\mathbb{E}[X\mid\mathcal{G}]+\beta\mathbb{E}[Y\mid\mathcal{G}]\).
  2. Measurable variables. If \(X\) is \(\mathcal{G}\)-measurable then \(\mathbb{E}[X\mid\mathcal{G}]=X\); in particular constants are unchanged.
  3. Independence. If \(X\) is independent of \(\mathcal{G}\) then \(\mathbb{E}[X\mid\mathcal{G}]=\mathbb{E}[X]\).
  4. Monotonicity. If \(X\leq Y\) then \(\mathbb{E}[X\mid\mathcal{G}]\leq\mathbb{E}[Y\mid\mathcal{G}]\).
  5. Expectation. \(\mathbb{E}[\mathbb{E}[X\mid\mathcal{G}]]=\mathbb{E}[X]\).
  6. Taking out what is known. If \(X\) is \(\mathcal{G}\)-measurable and \(XY\) is integrable then \(\mathbb{E}[XY\mid\mathcal{G}]=X\mathbb{E}[Y\mid\mathcal{G}]\).
  7. Monotone convergence. If \(0\leq X_n\uparrow X\) then \(\mathbb{E}[X_n\mid\mathcal{G}]\uparrow\mathbb{E}[X\mid\mathcal{G}]\) (see Monotone Convergence Theorem).
  8. Dominated convergence. If \(X_n\to X\) a.s. and \(\lvert X_n\rvert\leq W\) with \(\mathbb{E}[W]<\infty\) then \(\mathbb{E}[X_n\mid\mathcal{G}]\to\mathbb{E}[X\mid\mathcal{G}]\) (see Dominated Convergence Theorem).
  9. Tower property. If \(\mathcal{G}_2\subseteq\mathcal{G}_1\subseteq\mathcal{F}\) then \[ \mathbb{E}\big[\mathbb{E}[X\mid\mathcal{G}_1]\mid\mathcal{G}_2\big] =\mathbb{E}\big[\mathbb{E}[X\mid\mathcal{G}_2]\mid\mathcal{G}_1\big] =\mathbb{E}[X\mid\mathcal{G}_2] \] (the smaller σ-algebra always wins).
  10. Jensen’s inequality. For convex \(g\) with \(g(X)\) integrable, \(\mathbb{E}[g(X)\mid\mathcal{G}]\geq g(\mathbb{E}[X\mid\mathcal{G}])\) (see Jensen Inequality).

5 References

  • D. Williams, Probability with Martingales, Cambridge University Press, 1991, Chapter 9.
  • P. Billingsley, Probability and Measure, 3rd ed., Wiley, 1995, Section 34.
Back to top