Projection matrix

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Short description Script error: No such module "For". In statistics, the projection matrix (𝐏),[1] sometimes also called the influence matrix[2] or hat matrix (𝐇), maps the vector of response values (dependent variable values) to the vector of fitted values (or predicted values). It describes the influence each response value has on each fitted value.[3][4] The diagonal elements of the projection matrix are the leverages, which describe the influence each response value has on the fitted value for that same observation.

Definition

If the vector of response values is denoted by 𝐲 and the vector of fitted values by y^,

y^=𝐏𝐲.

As y^ is usually pronounced "y-hat", the projection matrix 𝐏 is also named hat matrix as it "puts a hat on 𝐲".

Application for residuals

The formula for the vector of residuals 𝐫 can also be expressed compactly using the projection matrix:

𝐫=𝐲y^=𝐲𝐏𝐲=(𝐈𝐏)𝐲.

where 𝐈 is the identity matrix. The matrix 𝐌:=𝐈𝐏 is sometimes referred to as the residual maker matrix or the annihilator matrix.

The covariance matrix of the residuals 𝐫, by error propagation, equals

Σ𝐫=(𝐈𝐏)TΣ(𝐈𝐏),

where Σ is the covariance matrix of the error vector (and by extension, the response vector as well). For the case of linear models with independent and identically distributed errors in which Σ=σ2𝐈, this reduces to:[3]

Σ𝐫=(𝐈𝐏)σ2.

Intuition

File:Projection of a vector onto the column space of a matrix.svg
A matrix, 𝐀 has its column space depicted as the green line. The projection of some vector 𝐛 onto the column space of 𝐀 is the vector 𝐱

From the figure, it is clear that the closest point from the vector 𝐛 onto the column space of 𝐀, is 𝐀𝐱, and is one where we can draw a line orthogonal to the column space of 𝐀. A vector that is orthogonal to the column space of a matrix is in the nullspace of the matrix transpose, so

𝐀T(𝐛𝐀𝐱)=0.

From there, one rearranges, so

𝐀T𝐛𝐀T𝐀𝐱=0𝐀T𝐛=𝐀T𝐀𝐱𝐱=(𝐀T𝐀)1𝐀T𝐛.

Therefore, since 𝐀𝐱 is on the column space of 𝐀, the projection matrix, which maps 𝐛 onto 𝐱, is 𝐀(𝐀T𝐀)1𝐀T.

Linear model

Suppose that we wish to estimate a linear model using linear least squares. The model can be written as

𝐲=𝐗β+ε,

where 𝐗 is a matrix of explanatory variables (the design matrix), β is a vector of unknown parameters to be estimated, and ε is the error vector.

Many types of models and techniques are subject to this formulation. A few examples are linear least squares, smoothing splines, regression splines, local regression, kernel regression, and linear filtering.

Ordinary least squares

Script error: No such module "labelled list hatnote". When the weights for each observation are identical and the errors are uncorrelated, the estimated parameters are

β^=(𝐗T𝐗)1𝐗T𝐲,

so the fitted values are

𝐲^=𝐗β^=𝐗(𝐗T𝐗)1𝐗T𝐲.

Therefore, the projection matrix (and hat matrix) is given by

𝐏:=𝐗(𝐗T𝐗)1𝐗T.

Weighted and generalized least squares

Script error: No such module "labelled list hatnote". The above may be generalized to the cases where the weights are not identical and/or the errors are correlated. Suppose that the covariance matrix of the errors is Σ. Then since

β^GLS=(𝐗TΣ1𝐗)1𝐗TΣ1𝐲.

the hat matrix is thus

𝐇=𝐗(𝐗TΣ1𝐗)1𝐗TΣ1

and again it may be seen that H2=HH=H, though now it is no longer symmetric.

Properties

The projection matrix has a number of useful algebraic properties.[5][6] In the language of linear algebra, the projection matrix is the orthogonal projection onto the column space of the design matrix 𝐗.[4] (Note that (𝐗T𝐗)1𝐗T is the pseudoinverse of X.) Some facts of the projection matrix in this setting are summarized as follows:[4]

  • 𝐮=(𝐈𝐏)𝐲, and 𝐮=𝐲𝐏𝐲𝐗.
  • 𝐏 is symmetric, and so is 𝐌:=𝐈𝐏.
  • 𝐏 is idempotent: 𝐏2=𝐏, and so is 𝐌.
  • If 𝐗 is an n × r matrix with rank(𝐗)=r, then rank(𝐏)=r
  • The eigenvalues of 𝐏 consist of r ones and nr zeros, while the eigenvalues of 𝐌 consist of nr ones and r zeros.[7]
  • 𝐗 is invariant under 𝐏 : 𝐏𝐗=𝐗, hence (𝐈𝐏)𝐗=𝟎.
  • (𝐈𝐏)𝐏=𝐏(𝐈𝐏)=𝟎.
  • 𝐏 is unique for certain subspaces.

The projection matrix corresponding to a linear model is symmetric and idempotent, that is, 𝐏2=𝐏. However, this is not always the case; in locally weighted scatterplot smoothing (LOESS), for example, the hat matrix is in general neither symmetric nor idempotent.

For linear models, the trace of the projection matrix is equal to the rank of 𝐗, which is the number of independent parameters of the linear model.[8] For other models such as LOESS that are still linear in the observations 𝐲, the projection matrix can be used to define the effective degrees of freedom of the model.

Practical applications of the projection matrix in regression analysis include leverage and Cook's distance, which are concerned with identifying influential observations, i.e. observations which have a large effect on the results of a regression.

Blockwise formula

Suppose the design matrix 𝐗 can be decomposed by columns as 𝐗=[𝐀𝐁]. Define the hat or projection operator as 𝐏[𝐗]:=𝐗(𝐗T𝐗)1𝐗T. Similarly, define the residual operator as 𝐌[𝐗]:=𝐈𝐏[𝐗]. Then the projection matrix can be decomposed as follows:[9]

𝐏[𝐗]=𝐏[𝐀]+𝐏[𝐌[𝐀]𝐁],

where, e.g., 𝐏[𝐀]=𝐀(𝐀T𝐀)1𝐀T and 𝐌[𝐀]=𝐈𝐏[𝐀]. There are a number of applications of such a decomposition. In the classical application 𝐀 is a column of all ones, which allows one to analyze the effects of adding an intercept term to a regression. Another use is in the fixed effects model, where 𝐀 is a large sparse matrix of the dummy variables for the fixed effect terms. One can use this partition to compute the hat matrix of 𝐗 without explicitly forming the matrix 𝐗, which might be too large to fit into computer memory.

History

The hat matrix was introduced by John Wilder in 1972. An article by Hoaglin, D.C. and Welsch, R.E. (1978) gives the properties of the matrix and also many examples of its application.

See also

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. a b Script error: No such module "Citation/CS1".
  4. a b c Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. Script error: No such module "citation/CS1".
  8. Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".

Template:Matrix classes