ridgelm: Ridge Regression

View source: R/Ridge.R

ridgelm,plot.rlmR Documentation

Ridge Regression

Description

Similar to lm.ridge in MASS packaged included with R, but with a different kind of scaling and a little nicer plotting.

Usage

ridgelm(xy,lambda = seq(0.01,1,0.01),mapback=TRUE) 
## S3 method for class 'rlm'
plot(x,y,...)

Arguments

xy

Data, response variable in the last column.

lambda

Vector of desired values for the ridge parameter.

mapback

If TRUE, the scaling that had been applied to the original data will be map back to the original scale, so that the estimated regression coefficients are now on the scale of the original data.

x

Object of type 'rlm', output of ridgelm.

y

Needed for consistency with the generic. Not used.

...

Needed for consistency with the generic. Not used.

Details

Centers and scales the predictors X, and centers the response variable Y. Computes X'X and then solves [(X'X)/n + lambda I]b = X'Y/n for b. The 1/n factors are important, making the diagonal elements of (X'X)/n all 1s and thus facilitating choices for the lambdas in a manner independent of the data.

Calling plot on the output of ridgelm dispatches to plot.rlm, thus diplaying the ridge traces.

Value

The function ridgelm returns an object of class 'rlm', with components bhats, the estimated beta vectors, one column per lambda value, and lambda, a copy of the input.

Author(s)

Norm Matloff


regtools documentation built on March 31, 2022, 1:06 a.m.