# Hat Matrix Hii

**The hat matrix is also known as the projection matrix because it projects the vector of observations y onto the vector of predictions thus putting the hat on y.**

**Hat matrix hii**.
Leverage considered large if it is bigger than twice the mean leverage value 2pn.
The hat matrix is also known as the projection matrix because it projects the vector of observations y onto the vector of predictions thus putting the hat on y.
The averageleverage is thereforep1.

For the hat matrix you show hat Xdot nplinalginv XTdot Xdot XT the trace is simply rank X so if X has full column rank and less columns than rows then this is Xshape. Sum of leverages over observations equals the number of parameters in the model intercept plus number o. But the first column of X is all ones.

Hii is a measure of the distance betweenXvalues of theith observation andthe means of theXvalues for all nobservations showhii 1n x1i x1TX0cXc 1x1i x1whereXc is the centerreddesign matrixX. This implies that Hu u because a projection matrix is idempotent. 6522 Analysis of Projection Matrix Elements Analysis of elements of the projection hat matrix plays an important role in regression diagnostics because the diagonal elements of this matrix Hii xi XTX 1 xTi indicate the presence of leverage points which are not detected by analysis of residuals.

This quantity is called the leverage because it controls the relative importance of each data point through the following relationships. I prove these results. Denote it by u.

I understand that the trace of the projection matrix also known as the hat matrix XInv XXX in linear regression is equal to the rank of X. We dont expect every point to have exactly the same. H X XTX 1XT and determines the fitted or predicted values since.

B show that hii 1 Hint. Along the way I present the proo. Exercise 34 from Meyer Classical and modern regression with applications Let hii be the ith diagonal of the Hat matrix H.