I am trying to figure out why the following holds:
Given $y_{i}=E[y_{i}|X_{i}]+\epsilon_{i}$ that
$E[\epsilon^{2}_{i}] =E[E[\epsilon^{2}_{i}|X_{i}]] = E[V[y_{i}|X_{i}]]$
Specifically I am trying to understand why $E[\epsilon^{2}_{i}|X_{i}] = V[y_{i}|X_{i}]$?
Clearly, I need a refresher on conditional variance and the rules for expected values....