Learn R Programming

snazzieR (version 0.1.2)

fit.ridge: Fit Ridge Regression with Closed-Form Solution

Description

Computes ridge regression coefficients and standard errors using the closed-form solution: \(\hat{\beta} = (X^T X + \lambda I)^{-1} X^T y\)

Usage

fit.ridge(x, y, lambda)

Value

A list containing:

coefficients

Ridge regression coefficients (length p)

std_errors

Standard errors of the coefficients (length p)

Arguments

x

A standardized design matrix (n × p)

y

A centered response vector (n × 1)

lambda

A non-negative regularization scalar