ridge_hw2c: OLS with Ridge Regression

Description Usage Arguments Value Examples

View source: R/ridge_hw2c.R

Description

This function fits linear models with the ridge regression regularization (using the l2 norm). This method is used to reduce overfitting.

Usage

1
ridge_hw2c(form, d, lambda_val, contrasts = NULL)

Arguments

form

linear model formula

d

data frame

lambda_val

the lambda value (regularization parameter)

contrasts

optional list of constants for factor variables aka contrast

Value

the best-fit coefficients with ridge regularization

Examples

1
2
data(iris)
ridge_hw2c(Sepal.Length ~ ., iris, lambda_val = 1)

brian-d1018/bis557 documentation built on Dec. 17, 2020, 6:21 p.m.