Content deleted Content added
No edit summary |
removed unnecessary bolding |
||
Line 1:
In [[statistics]], the '''hat matrix''', '''''H''''', relates the fitted values to the observed values. It describes the influence each observed value has on each fitted value<ref name="Hoaglin1977">
{{Citation| title = The Hat Matrix in Regression and ANOVA
| first1= David C. | last1= Hoaglin |first2= Roy E. | last2=Welsch
Line 8:
If the vector of observed values is denoted by '''y''' and the vector of fitted values by <math>\hat{\mathbf{y}}</math>,
:<math>\hat{\mathbf{y}} = H \mathbf{
As <math>\hat{\mathbf{y}}</math> is usually pronounced "y-hat", the hat matrix is so named as it "puts a hat on '''y'''".
Suppose that we wish to solve a [[linear model]] using [[linear least squares]]. The model can be written as
:<math>\mathbf{y} =
where
The estimated parameters are
:<math>
so the fitted values are
:<math>\hat{\mathbf{y}} =
Therefore the hat matrix is given by
:<math>
In the language of [[linear algebra]], the hat matrix is the [[orthogonal projection]] onto the [[column space]] of the design matrix
The hat matrix corresponding to a [[linear model]] is [[symmetric matrix|symmetric]] and [[idempotent]], that is,
The formula for the vector of residuals '''r''' can be expressed compactly using the hat matrix:
:<math>\mathbf{r} = \mathbf{y} - \mathbf{\hat{y}} = \mathbf{y} - H \mathbf{
The [[variance-covariance matrix]] of the residuals is therefore, by [[error propagation]], equal to <math>
For the case of linear models with [[independent and identically distributed]] errors in which
For [[linear models]], the [[trace (linear algebra)|trace]] of the hat matrix is equal to the [[rank (linear algebra)|rank]] of
For other models such as LOESS that are still linear in the observations '''y''',
the hat matrix can be used to define the [[degrees of freedom (statistics)#Effective degrees of freedom|effective degrees of freedom]] of the model.
Line 37:
==Correlated residuals==
The above may be generalized to the case of correlated residuals. Suppose that the [[covariance matrix]] of the residuals is
:<math> \hat{\
the hat matrix is thus
:<math>
and again it may be seen that
== See also ==
|