information:classification
Estimation

where P = X (X X) X is the projection matrix onto the space V spanned by the columns of X. This matrix P is also sometimes called the hat matrix because it "puts a hat" onto the variable y. Another matrix, closely related to P is the annihilator matrix M = I − P; this is a projection matrix onto the space orthogonal to V. Both matrices P and M are symmetric and idempotent (meaning that P = P and M = M), and relate to the data matrix X via identities PX = X and MX = 0. Matrix M creates the residuals from the regression: