Derivation of $\operatorname{Var}(Y|X)= E(Y^2|X)-(E(Y|X))^2$ & $\operatorname{Var}(Y) = E(\operatorname{Var}(Y|X))+\operatorname{Var}(E(Y|X))$

80 Views Asked by At

Starting with $\operatorname{Var}(Y|X) = E((Y-E(Y|X))^2|X)$

How were the two below forms of $\operatorname{Var}$ derived from the above?

$$1)\quad \dots \quad \operatorname{Var}(Y|X)= E(Y^2|X)-(E(Y|X))^2$$

$$\quad\quad\,2) \quad \dots \quad \operatorname{Var}(Y) = E(\operatorname{Var}(Y|X))+\operatorname{Var}(E(Y|X))$$

1

There are 1 best solutions below

5
On BEST ANSWER

First of all see that: $$ \textrm{Var}\left(Y|X\right)= \mathbb E\left((Y-\mathbb E(Y|X))^2\big|X\right)=\\ \mathbb E\left(Y^2-2Y\mathbb E(Y|X)+(\mathbb E(Y|X))^2\big|X\right)=\\ \mathbb E\left(Y^2\big|X\right)- (\mathbb E(Y|X))^2 $$ where we used the following: $$ \mathbb E\left(Y\mathbb E(Y|X)\big|X\right)=\mathbb E(Y\big|X)\mathbb E\left(Y\big|X\right). $$ As for the second equality; First see that: $$ \mathbb E(\textrm{Var}\left(Y|X\right))=\mathbb E(\mathbb E\left(Y^2\big|X\right)- (\mathbb E(Y|X))^2)=\\ \mathbb E(Y^2)-E\left((\mathbb E(Y|X))^2\right). $$ For the second term we have: $$ \textrm{Var}\left(\mathbb E(Y|X)\right)=\mathbb E\left((\mathbb E(Y|X))^2\right)-\left(\mathbb E(\mathbb E(Y|X))\right)^2=\mathbb E\left((\mathbb E(Y|X))^2\right) -(\mathbb E(Y))^2. $$ Combining these two will give you the proof of second result.