Show $E[(Y-E(Y|X))(E(Y|X)-g(X))]=0$

105 Views Asked by At

I need to show that $$E[(Y-E(Y|X))(E(Y|X)-g(X))]=0$$ and all I am given is that $X$ and $Y$ are random variables. I tried multiplying everything together but that didn't seem to lead anywhere. $$E[(Y-E(Y|X))(E(Y|X)-g(X))]=E(Y|X)E(Y)-E(Yg(X))-(E(Y|X))^2+E(Y|X)E(g(X))$$. I don't see what else there is to try. Any suggestions?

1

There are 1 best solutions below

0
On

Note that $\mathbb{E}[g(X)\mathbb{E}(Y\vert X)] = \mathbb{E}[g(X)Y]$ so expanding gives us

$$\mathbb{E}[Y\mathbb{E}(Y\vert X)] - \mathbb{E}[Yg(X)] - \mathbb{E}[\mathbb{E}(Y\vert X)^2] + \mathbb{E}[\mathbb{E}(Y\vert X)g(X)] $$

The second and fourth terms cancel, based the note above, which means you only have to prove that $$\mathbb{E}[Y\mathbb{E}(Y\vert X)] - \mathbb{E}[\mathbb{E}(Y\vert X)^2] = 0$$