R/epsilonhat.R
dot-My.RdCalculates residuals using $$ \boldsymbol{\hat{\varepsilon}} = \mathbf{My} . $$ where $$ \mathbf{M} = \mathbf{I} - \mathbf{P} \\ = \mathbf{I} - \mathbf{X} \left( \mathbf{X}^{T} \mathbf{X} \right)^{-1} \mathbf{X}^{T} . $$
.My(y, M = NULL, X = NULL, P = NULL)
| y | Numeric vector of length |
|---|---|
| M |
|
| X |
|
| P |
|
Returns an \(n \times 1\) matrix of residuals \(\left( \boldsymbol{\hat{\varepsilon}} \right)\), that is, the difference between the observed \(\left( \mathbf{y} \right)\) and predicted \(\left( \mathbf{\hat{y}} \right)\) values of the regressand variable \(\left( \boldsymbol{\hat{\varepsilon}} = \mathbf{y} - \mathbf{\hat{y}} \right)\).
If M = NULL, the M matrix is computed using M()
with X as a required argument and P as an optional argument.
If M is provided, X and P are not needed.
Wikipedia: Errors and Residuals
Other residuals functions:
.tepsilonhat(),
.yminusyhat(),
My(),
epsilonhat(),
tepsilonhat(),
yminusyhat()
Ivan Jacob Agaloos Pesigan