Reduced formula conditional variance

93 Views Asked by At

Does the following equality hold true?

$$Var[Z|X]=E[Z^2|X]-(E[Z|X])^2$$?

I need to compute $Var[Z|Y]$ where $Z=X+Y$ and $X,Y$ are independent uniform $U([0,1])$. I get a negative value using that formula, which is not possible. Why? Thank you

We get that $E[Z|X]=1/2+X$ but then i get a negative value for the variance which is obviously impossible. What is wrong with the formula above??

2

There are 2 best solutions below

1
On BEST ANSWER

Note that

$$E[Z^2 \mid X] = E[X^2 + Y^2 + 2XY \mid X] = X^2 + E[Y^2] + 2XE[Y] = \frac13 + X^2 + X$$

while

$$E[Z \mid X] = E[X+Y \mid X] = E[X \mid X] + E[Y \mid X] = X + \frac12$$

so $E[Z \mid X]^2 = \frac14 + X^2 + X$. It follows that

\begin{align} V[Z \mid X] &= E[Z^2 \mid X] - E[Z \mid X]^2 \\&= \frac13+X^2+X - \left(\frac14 + X^2 + X\right) \\&= \frac13-\frac14 \\&= \frac{1}{12} \end{align}

Alternatively, we may simply calculate

$$V[Z \mid X] = V[X + Y \mid X] = V[X \mid X] + V[Y \mid X] = 0+V[Y] = \frac1{12}$$

In all of these, we use the independence of $X$ and $Y$.

2
On

$$Var[Z|X]=E[Z^2|X]-(E[Z|X])^2$$

$$E[Z^2|X]=E[(X+Y)^2|X]=E[X^2+Y^2+2XY|X]$$ We have that $E[Y^2|X]=E[Y^2]$ because $X$ and $Y$ are independent, I let you calculate $E[Y^2]$ you know the distribution of $Y$.

Trivially , we have $E[X^2|X]=X^2$

Finally, $$E[2XY|X]=2XE[Y|X]=2XE[Y]$$