Conditional expectation: why does $\mathbb{E}[g(X)Y \mid X] = g(X) \mathbb{E}[Y \mid X]$ hold

conditional-expectationprobability

A property of conditional expectation is that

$$
\mathbb{E}[g(X)Y \mid X] = g(X) \mathbb{E}[Y \mid X]
$$

Why is this true? Since we are conditioning on a random variable $X$, it seems non-intuitive that you can pull out $g(X)$ from the calculation of the conditional expectation.

Best Answer

If $Z$ is $\mathcal G-$ measurable, then $$\mathbb E[ZX\mid \mathcal G]=Z\mathbb E[X\mid \mathcal G] \ \ a.s.$$

Proof

Let $G\in \mathcal G$. Then, $$\mathbb E\big[\mathbb E[ZX\mid \mathcal G]\boldsymbol 1_G\big]=\mathbb E[XZ\boldsymbol 1_G]=\mathbb E\big[\mathbb E[X\mid \mathcal G]Z\boldsymbol 1_G\big].\tag{*}$$ The second equality comes from the fact that $Z\boldsymbol 1_G$ is $\mathcal G-$measurable. The claim follow since $(*)$ hold for all $G\in \mathcal G$.