(Here, I borrow heavily from Christensen, Plane Answers to Complex Questions.) Consider again the linear model

Now, regard each column of as a vector in , and consider – the column space of – i.e. the subspace of spanned by the columns of .

Define the perpendicular projection operator onto as follows: if is in , then . And if is in the space perpendicular to then .

We need three lemmas.

Lemma 1: is the perpendicular projection operator onto .

Proof: Let be in . Then for some vector . Hence

Now, let be in the space perpendicular to . Then if is any column of . Hence , and therefore

Lemma 2: If is the p.p.o. onto , then – the trace of is the rank of .

Proof: Recall two things:

  1. If , where is a square matrix, then is an eigenvector of , and is the associated eigenvalue. The multiplicity of the eigenvalue is the number of linearly independent vectors such that and the total number of eigenvalues of an matrix is .

  2. Any symmetric matrix admits of a singular value decomposition: , where is an orthogonal matrix (), and is a diagonal matrix, with diagonal entries the eigenvalues of .

Now, by definition, if is in , then . Hence is an eigenvalue of , and because every column of is in , the multiplicity of is the number of ’s columns that are linearly independent. In other words, the multiplicity of is the rank of .

Further, if is in the space perpendicular to , then So is another eigenvalue of , and its multiplicity is, similarly to the above, the dimension of the space perpendicular to . And that characterizes all of the eigenvalues of .

Note finally that is symmetric, so

Lemma 3: if is a square matrix, and is a random vector, then

Proof: First, recognize that where is any square matrix, is a scalar. Hence . Second, note

And hence

That, finally, supplies all the resources we need to find an unbiased estimator of . Recall our quadratic-loss-minimizing line , and suppose that , and .

Now, consider

and notice

So, using Lemma 3 twice,

But by Lemma 1, is the perpendicular projection operator onto . Hence, by Lemma 2, . If is non-singular, and of dimension , then .

Hence

Or in other words, is an unbiased estimator of , where is the rank of .