Need help with derivation of conditional expectation

105 Views Asked by At

The following is taken from the book "Mathematical Statistics for Economics and Business":

\begin{align*} E\left.\left( \left[ Y-h(x) \right]^2\ \right\vert\ x\right) =& E\left.\left( \left[\,Y-E(Y|x)+E(Y|x)-h(x)\,\right]^2\ \right\vert\ x\right)\\ =& E\left( \left.\left[\,Y-E(Y|x)\,\right]^2\ \right\vert\ x\right) + \left(E(Y|x)-h(x)\right)^2\\ &\text{(by substitution theorem)}. \end{align*}

I don't understand this derivation. Please help ...

2

There are 2 best solutions below

3
On BEST ANSWER

Start with $\mathbb{E}[(Y-h(x))^2|x]=\mathbb{E}[(Y-\mathbb{E}[Y|x]+\mathbb{E}[Y|x]-h(x))^2|x]$ (the equality is trivial), and expand the RHS: $$ \begin{align*} RHS &= \mathbb{E}\!\left[(Y-\mathbb{E}[Y|x]+\mathbb{E}[Y|x]-h(x))^2 \ \middle|\ x\right] \\ &= \mathbb{E}\!\left[(Y-\mathbb{E}[Y|x])^2+(\mathbb{E}[Y|x]-h(x))^2 + 2(Y-\mathbb{E}[Y|x])(\mathbb{E}[Y|x]-h(x)) \ \middle|\ x\right] \\ &= \mathbb{E}\!\left[(Y-\mathbb{E}[Y|x])^2 \ \middle|\ x\right]+\mathbb{E}\!\left[(\mathbb{E}[Y|x]-h(x))^2 \ \middle|\ x\right] + 2\mathbb{E}\!\left[(Y-\mathbb{E}[Y|x])(\mathbb{E}[Y|x]-h(x)) \ \middle|\ x\right] \\ &= \mathbb{E}\!\left[(Y-\mathbb{E}[Y|x])^2 \ \middle|\ x\right]+(\mathbb{E}[Y|x]-h(x))^2 + 2\mathbb{E}\!\left[(Y-\mathbb{E}[Y|x])(\mathbb{E}[Y|x]-h(x)) \ \middle|\ x\right] \end{align*} $$ using the linearity of conditional expectations, and for the last equality the fact that $(\mathbb{E}[Y|x]-h(x))^2$ is $x$-measurable.

From there, to get your result, the first two terms being what you want, it only remains to show the third one is $0$. This is the case, since $$ \begin{align*} \mathbb{E}\!\left[(Y-\mathbb{E}[Y|x])(\mathbb{E}[Y|x]-h(x)) \ \middle|\ x\right] &= \mathbb{E}\!\left[Y\mathbb{E}[Y|x] - \mathbb{E}[Y|x]^2-Yh(x) + \mathbb{E}[Y|x]h(x) \ \middle|\ x\right] \\ &= \mathbb{E}\!\left[Y\mathbb{E}[Y|x] \ \middle|\ x\right] - \mathbb{E}[Y|x]^2-\mathbb{E}\!\left[Yh(x) \ \middle|\ x\right] + \mathbb{E}\!\left[\mathbb{E}[Y|x]h(x) \ \middle|\ x\right] \\ &= \mathbb{E}[Y|x]\cdot\mathbb{E}\!\left[Y \middle| x\right] - \mathbb{E}[Y|x]^2-h(x) \cdot\mathbb{E}\!\left[Y \middle| x\right] + \mathbb{E}[Y|x]\cdot h(x) \\ &= 0 \end{align*} $$ using the fact that $h(x)$ and $\mathbb{E}[Y|x]$ are $x$-measurable.

0
On

Assume that the random variables $Z$ and $T$ are such that $Z$ is measurable with respect to $X$ and $E[T\mid X]=0$. Then $E[(T+Z)^2\mid X]=E[T^2\mid X]+Z^2$.

The result in your question follows, choosing $T=Y-E[Y\mid X]$ (since then $E[T\mid X]=0$, can you show it?) and $Z=E[Y\mid X]+h(X)$ (since then $Z$ is measurable with respect to $X$, can you show it?).

To prove the assertion recakked above, one expands $(T+Z)^2=T^2+2TZ+Z^2$ and one uses the identities $E[TZ\mid X]=ZE[T\mid X]=0$ and $E[Z^2\mid X]=Z^2$ (can you show them?).