plotRidge: Plot results of Ridge regression

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/plotRidge.R

Description

Two plots from Ridge regression are generated: The MSE resulting from Generalized Cross Validation (GCV) versus the Ridge parameter lambda, and the regression coefficients versus lambda. The optimal choice for lambda is indicated.

Usage

1
plotRidge(formula, data, lambda = seq(0.5, 50, by = 0.05), ...)

Arguments

formula

formula, like y~X, i.e., dependent~response variables

data

data frame to be analyzed

lambda

possible values for the Ridge parameter to evaluate

...

additional plot arguments

Details

For all values provided in lambda the results for Ridge regression are computed. The function lm.ridge is used for cross-validation and Ridge regression.

Value

predicted

predicted values for the optimal lambda

lambdaopt

optimal Ridge parameter lambda from GCV

Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

References

K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.

See Also

lm.ridge, plotRidge

Examples

1
2
data(PAC)
res=plotRidge(y~X,data=PAC,lambda=seq(1,20,by=0.5))

Example output

Loading required package: rpart

chemometrics documentation built on May 1, 2019, 7:58 p.m.