Conditional expectation (source code)

= Conditional expectation
{title2=$\mathbb E[X\mid\mathcal G]$}
{wiki}

= Conditional expected value
{synonym}

= Conditional mean
{synonym}

The conditional expectation is the average of a <random variable> that can be predicted using specified information. It is itself a <random variable>: the average appropriate to one observed group may differ from that appropriate to another group. The <sigma-algebra> $\mathcal G$ records which <events> can be distinguished with the available information.

For a real <integrable random variable> $X$ on a <probability space> $(\Omega,\mathcal F,\mathbb P)$ and a sub-<sigma-algebra> $\mathcal G$, the conditional expectation $m=\mathbb E[X\mid\mathcal G]$ is the <almost surely> unique <integrable random variable> that is <measurable> with respect to $\mathcal G$ and satisfies
$$
\int_A m\,d\mathbb P=\int_A X\,d\mathbb P\qquad\text{for every }A\in\mathcal G.
$$
Its average therefore agrees with that of $X$ on every distinguishable <event>. The integral characterization handles discrete observations, continuous observations, and information that is not given by a single numerical value.<18.175 Lecture 16: Conditional expectation, random walks, martingales by Scott Sheffield>[PDF pp. 4–8]{ref}

If the information tells us which member of a finite <measurable partition> $A_1,\ldots,A_k$ contains the outcome, then on every member of positive <probability>,
$$
m=\frac{\mathbb E[X\mathbf1_{A_i}]}{\mathbb P(A_i)}\quad\text{on }A_i.
$$
Here $\mathbf1_{A_i}$ is an <indicator function>. Zero-probability members do not determine a unique value, which is why uniqueness is only <almost surely>. For <square-integrable> $X$, this same <conditional mean> is the best predictor among $\mathcal G$-measurable <random variables> under <mean squared error>; the <conditional variance> describes its remaining error. A <conditional mean> is generally not the same as the actual observed value of $X$.<Probability: Theory and Examples (fifth edition) by Rick Durrett/4.1 Conditional Expectation>[Theorem 4.1.15, p. 213]{ref}