Skip to contents

beta = (X'X + lambda P)^-1 X'y where P is the identity with zeros for constant columns (ESL eqs 3.44, 3.50); effective_df = trace of the hat matrix. Columns are not standardised here.

Usage

morie_esl_ridge(X, y, lambda)

Arguments

X

Design matrix (a constant column is the unpenalised intercept).

y

Response.

lambda

Penalty, >= 0.

Value

Named list: estimate, beta, effective_df, rss, lambda, intercept_penalised, columns_standardised, n, p.

References

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

Examples

morie_esl_ridge(cbind(1, 0:3), c(1, 3, 5, 7), 1)$beta
#> [1] 1.500000 1.666667