my_lm_ridge: Ridge Regression

Description Usage Arguments Examples

View source: R/my-lm-ridge.R

Description

Perform ridge regression, which is able to deal with collinearity among the columns of the design

Usage

1
my_lm_ridge(form, data, lambda)

Arguments

form

a formula object, e.g. y ~ x1 + x2

data

a data frame

lambda

a scalar (tuning parameter) from 0 to infinity, also called the penalty parameter

Examples

1
2
3
data(iris)
ridge_fit <- my_lm_ridge(form = Sepal.Length ~ ., data = iris, lambda = 0.5)
ridge_fit$coefficients

tqchen07/bis557 documentation built on Dec. 21, 2020, 3:06 a.m.