Assume with , and of full column rank . How do you prove that , so that is unbiased?
Supervised learning, Least squares and the hat matrix
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
The trace argument with the hat matrix : residuals are and .
Key idea
The residual vector is , with a symmetric idempotent matrix. So , and its expectation is .
Steps
- The hat matrix is , so and .
- Since , we get . Therefore .
- is symmetric and , so is also symmetric and idempotent. Hence .
- Take the expectation of a quadratic form: for symmetric .
- Compute the trace: , using the cyclic property of the trace.
- So and dividing by removes the bias. No Gaussian assumption is needed.
Common mistakes
- Saying RSS has degrees of freedom. The fit uses up of them.
- Forgetting that , so the signal term vanishes from the residual.
- Assuming normal errors. Unbiasedness needs only zero mean and covariance .
How long your answer should be
Half a page; 5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: For ridge regression, define the effective degrees of freedom and express it with the singular values of . If has singular values and , what are and the shrinkage factor on each direction?
Next in Supervised learning: Write a distribution in exponential-dispersion form . How do you show that the Bernoulli and Poisson distributions fit this form, what is the canonical link in each case, and why does a canonical link make the log-likelihood gradient equal to ?