Is there a mathematical proove that conditional expection of residual is 0?
i.e. E(Residual | X) = 0
Is there a mathematical proove that conditional expection of residual is 0?
i.e. E(Residual | X) = 0
What is residual $\mathbf e? $
Specifically $$\mathbf e = \mathbf y -\mathbf P\mathbf y, \tag 1$$
where $\mathbf P:= \mathbf X\left(\mathbf X^\mathsf T\mathbf X\right) ^{-1}\mathbf X^\mathsf T. $
For fixed $\mathbf X, $
\begin{align}\mathbb E[\mathbf e|\mathbf X] &= (\mathbf I-\mathbf P) \mathbb E[\mathbf y|\mathbf X]\\&= (\mathbf I-\mathbf P)\mathbf X\boldsymbol \beta\\ &= \left[\mathbf X-\mathbf X\left(\mathbf X^\mathsf T\mathbf X\right) ^{-1}\mathbf X^\mathsf T\mathbf X\right]\boldsymbol\beta\\ &=\mathbf 0.\tag 2\end{align}
What happens when $\bf X$ is random? Can the result be valid? Does it make any difference in the treatment above? Can any comment be made on unconditional expectation $\mathbb E[\mathbf e]? $
E(Residual | X) = 0? – pqrz Oct 09 '22 at 13:24