# Law of iterated expectation for the square of a conditional expectation

We know from the law of iterated expectations that $$E[E[X|Y]] = E[X]$$ However, does the same hold true for the square of a conditional expectation? I.e. is the following expression true, $$E[E[X|Y]^2] = E[X]^2$$

No the proposed relation does not hold which is clear from the special case when $$X$$ and $$Y$$ are identical, the l.h.s. being then $$E(X^2)$$.
With $$\text{Var}[X \vert Y] := E[X^2 \vert Y ] - E[X \vert Y ]^2$$ one can use the following relation $$\text{Var}(X) = E\{ \text{Var}[X \vert Y] \} + \text{Var}\{E[X \vert Y]\}$$
$$E\{E[X \vert Y]^2\} = E(X)^2 + \text{Var}\{E[X \vert Y]\}.$$
• I'm having a little trouble deriving the formula for $Var[X|Y] = E[X^2|Y] - E[X|Y]^2$. Particularly, when expanding the squared expression $E[(Y-E(Y|X))^2|X]$, it is required to simplify the term $E[E[Y|X]^2|X]$ to $E[Y|X]^2$. What is the justification for $E[Y|X]^2$ being constant in $X$? – shem Mar 21 at 12:41
• Well $E[Y \vert X]^2$ is a function of $X$ so conditioning on $X$ does not change it. It is often useful to regard the conditional expectation as a projection. – Yves Mar 21 at 18:41