linreg_rss: Linear Regression Residual Sum of Squares.

Description Usage Arguments Value Author(s)

View source: R/linreg.R

Description

Calculates residual sum of squares (RSS)

Σ e_{i}^{2} = Σ_{i = 1}^{n} ≤ft( y_i - \hat{y_i} \right)^2 = ≤ft( \mathbf{y} - \mathbf{X} \boldsymbol{\hat{β}} \right)^{\prime} ≤ft( \mathbf{y} - \mathbf{X} \boldsymbol{\hat{β}} \right) = \mathbf{e^{\prime} e }

, where

\mathbf{e} = \mathbf{y} - \mathbf{X} \boldsymbol{\hat{β}}

or

e = \mathbf{M} \mathbf{y}

.

Usage

1
linreg_rss(beta_hat = NULL, X, y, m = FALSE)

Arguments

beta_hat

Vector of k estimated regression parameters. If NULL, regression coefficients are estimated using ≤ft( \mathbf{X}^{\prime} \mathbf{X} \right)^{-1} ≤ft( \mathbf{X}^{\prime} \mathbf{y} \right) .

X

The data matrix, that is an n \times k matrix of n observations of k regressors, which includes a regressor whose value is 1 for each observation.

y

n \times 1 vector of observations on the regressand variable.

m

Logical. If TRUE, the function uses an alternative formula e = \mathbf{M} \mathbf{y} . See linreg_m for \mathbf{M}.

Value

Returns the residual sum of squares.

Author(s)

Ivan Jacob Agaloos Pesigan


jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.