FitRidge: Perform ridge regression

Description Usage Arguments Examples

Description

Wrapper for the ridge regression function in MASS package to use with predict and residuals function. Prediction are obtained using the best regularization values.

Usage

1
2
3
4
5
6
7
FitRidge(form, x, lambda = seq(0, 0.1, 0.001))

## S3 method for class 'ridgelm'
predict(obj, xnew = NULL, optim = "gcv")

## S3 method for class 'ridgelm'
residuals(obj, ...)

Arguments

form

Formula of the model

x, xnew

Data frame of the data

lambda

List of regularization value

optim

Criteria to choose the best lambda

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 # Example from MASS package
longley # not the same as the S-PLUS dataset
names(longley)[1] <- "y"

fit <- FitRidge(y ~ ., longley, lambda = seq(0,0.1,0.001))

plot(fit)
select(fit)
plot(predict(fit), residuals(fit))
abline( h = 0)

martindurocher/floodRFA documentation built on June 5, 2019, 8:44 p.m.