Conditional expectation on squared sum of independent random variables

conditional-expectationprobabilitystatistical-inferencestatistics

Given $X$ and $Y$ independent random variables of means $0$ and variance equal to $\sigma^2$, and $Z = X + Y$, find the conditional expectation $E[Z^2|X = x]$ for any value $x$ where the conditional distribution is defined.

My attempt:

$E[Z^2|X=x] = E[X^2+Y^2+2XY|X = x] = E[X^2|X=x] + E[Y^2|X=x] + 2E[XY|X=x]$.

We can see that:

$Var[Y|X=x] = Var[Y]$ by independence and $Var[Y|X=x] = E[Y^2|X=x] + (E[Y|X=x])^2 = E[Y^2|X=x] + (E[Y])^2 = E[Y^2|X=x]$

so

$E[Y^2|X=x] = Var[Y] = \sigma^2$

and

$E[Z^2|X=x] = E[X^2+Y^2+2XY|X = x] = x^2 + \sigma^2 + 2xE[Y|X=x] = x^2 + \sigma^2 + 2xE[Y] = x^2 + \sigma^2$

Is this reasoning correct or is there a wrong step? Thanks!

Best Answer

Your reasoning is correct but a bit cumbersome.

More shortly you can go for:$$\mathbb E\left[Z^2\mid X=x\right]=\mathbb{E}\left[\left(X+Y\right)^{2}\mid X=x\right]=\mathbb{E}\left[\left(x+Y\right)^{2}\mid X=x\right]=\mathbb{E}\left(x+Y\right)^{2}=$$$$x^{2}+2x\mathbb{E}Y+\mathbb{E}Y^{2}=x^{2}+\sigma^{2}$$ where the third equality is based on independence and the last on the data $\mathbb EY=0$ and $\mathsf{Var}Y=\sigma^2$ (hence $\mathbb EY^2=\mathsf{Var}Y=\sigma^2$).

As you can see it is not necessary to involve conditional variance.


A direct consequence of the achieved result is:$$\mathbb E[Z^2\mid X]=X^2+\sigma^2$$