R/yhat.R
dot-Xbetahat.Rd
Calculates y-hat \(\left( \mathbf{\hat{y}} \right)\), that is, the predicted value of \(\mathbf{y}\) given \(\mathbf{X}\) using $$ \mathbf{\hat{y}} = \mathbf{X} \boldsymbol{\hat{\beta}} $$ where $$ \boldsymbol{\hat{\beta}} = \left( \mathbf{X}^{T} \mathbf{X} \right)^{-1} \left( \mathbf{X}^{T} \mathbf{y} \right) . $$
.Xbetahat(X, betahat = NULL, y = NULL)
X |
|
---|---|
betahat | Numeric vector of length |
y | Numeric vector of length |
Returns y-hat \(\left( \mathbf{\hat{y}} \right)\).
If betahat = NULL
, the betahat
vector is computed
using betahat()
with X
and y
as arguments.
If betahat
is provided, y
is not needed.
Wikipedia: Ordinary Least Squares
Ivan Jacob Agaloos Pesigan