FallenApple said:
So ##\vec Y##~MVN(X##\vec\beta##, ##\sigma^2##I)
Can one subtract that simply? I mean, ##\vec Y## and ##\hat {\vec Y}## are not independent, so how can I just total up the expectations and the variances like that?
Note that via Linearity of Expectations, you can always add up the expected values. I found the PDF you attached to mostly be straight forward, though I didn't understand your notation.
Note your hat matrix ##\mathbf H## is not going to be full rank, and it only has eigenvalues of 0 and 1. It's real valued and symmetric, so it can be diagonalized in the form of ##\mathbf H = \mathbf {QDQ}^T##. (I found the use of ##\mathbf O## in the PDF to be awkward and look too much like the zero matrix.).
What they want is for you to use 4.1b which says ##Var(\mathbf a + \mathbf{B y}) = Var(\mathbf{B y}) = \mathbf B Var(\mathbf y) \mathbf B^T##. The notation is a touch confusing here, but what they're reminding you of is variance is an application of norm for measuring dispersion about a mean, so translation the mean by a constant has no effect. If we assume ##\mathbf y## has zero mean, I appears that they're just reminding you that the covariance matrix is given by ##\mathbf {y y} ^T## and in turn ##var\big(\mathbf{B y}\big) =\mathbf{B y}\big(\mathbf{B y}\big)^T = \mathbf{B yy}^T \mathbf{B}^T = \mathbf{B} Var \big(\mathbf y\big) \mathbf{B}^T ##. (I think Feller is to blame for this being called both the variance matrix and the covariance matrix...)
From here they are saying let's look at variance of the error term vector ##\mathbf e = \mathbf y - \mathbf{ \hat y} = \mathbf {I y} - \mathbf{ H y}= \big(\mathbf{I} - \mathbf H\big) \mathbf y \neq \mathbf 0## (that is we use least squares when we have over-determined systems of equations -- I've excluded that case of zero error from this analysis, accordingly). Hence ##Var(\mathbf e ) = Var(\big(\mathbf{I} - \mathbf H\big) \mathbf y\big) = \big(\mathbf{I} - \mathbf H\big) Var \big(\mathbf y \big) \big(\mathbf{I} - \mathbf H\big)^T##. What I never saw explicitly, but is tucked into the equation for ## Var(\hat \beta)## is that ##Var\big(\mathbf y\big) = \sigma^2 \mathbf I##. Substituting this into the above we get:
##\big(\mathbf{I} - \mathbf H\big) Var \big(\mathbf y \big) \big(\mathbf{I} - \mathbf H\big)^T = \big(\mathbf{I} - \mathbf H\big) \big(\sigma^2 \mathbf I \big) \big(\mathbf{I} - \mathbf H\big)^T = \sigma^2 \big(\mathbf{I} - \mathbf H\big) \big(\mathbf{I} - \mathbf H\big)^T##. From here notice that ##\mathbf {I - H}## is real valued and symmetric, so ##\mathbf {I - H} = \big(\mathbf {I - H}\big)^T##, simplifying the equation to: ## \sigma^2 \big(\mathbf{I} - \mathbf H\big)^2##
Then, they make use of the fact that ##\big(\mathbf{I} - \mathbf H\big)## is itself a projector, so ##\big(\mathbf I - \mathbf H\big)^2 = (\mathbf I - \mathbf H\big)##, leading the expression for the covariance matrix of the error term to be ##\sigma^2 \big(\mathbf{I} - \mathbf H\big)^2 = \sigma^2 \big(\mathbf{I} - \mathbf H\big)##.
If you know the singular value decomposition, I'd recommend using it on ##\mathbf X## and going slowly through all of the above. It will allow you to see exactly what is going on under the hood. (It also is quite useful in interpreting the modified Hat matrix that makes use of regularization penalties -- this is outside the scope of your current PDF, but no doubt coming at some point in the future.)
It's worth pointing out that 4.5a and 4.5b were a bit troubling to me at first. The rank of ##\mathbf H = trace\big(\mathbf H \big) = p##. The writeup states that ##\mathbf H## is n x n. The rank of ##\mathbf I - \mathbf H## = n - p. (Note: using trace operation considerably simplifies Theorem 4.5, 4.6, and 4.7, and in general since trace is a linear operator it can be interchanged with expectations (with some technical care needed for convergence if not a finite case)).
On their own, each of these is rank deficient-- which is disturbing when you look at the formula for the multivariate Guassian as it has you inverting the covariance matrix inside the exponential function, and the normalizing constant has the determinant of the covariance matrix in the denominator. But what these things are really saying in 4.5a and 4.5b is that you can cleanly partition the Guassian into p items that relate to ##\mathbf {\hat y}## and n-p items that relation to ##\mathbf {\hat e}##.