Skip to contents

RSS(beta) = sum (y_i - x_i' beta)^2 at the supplied beta (ESL eq 3.2).

Usage

morie_esl_residual_sum_squares(X, y, beta)

Arguments

X

Design matrix.

y

Response.

beta

Coefficients.

Value

Named list: estimate, residuals, mean_squared_error, n, p.

References

Hastie, Tibshirani & Friedman (2009), sec. 3.2.

Examples

morie_esl_residual_sum_squares(cbind(1, 0:3), c(1, 3, 5, 8), c(1, 2))$estimate
#> [1] 1