Performs repeated cross-validation (CV) to evaluate the result of Ridge regression where the optimal Ridge parameter lambda was chosen on a fast evaluation scheme.
ridgeCV(formula, data, lambdaopt, repl = 5, segments = 10,
segment.type = c("random", "consecutive", "interleaved"), length.seg,
trace = FALSE, plot.opt = TRUE, ...)
matrix of size length(y) x repl with residuals
matrix of size length(y) x repl with predicted values
Standard Error of Prediction computed for each column of "residuals"
mean SEP value
MAD of Prediction computed for each column of "residuals"
mean of MAD values
Root MSEP value computed for each column of "residuals"
mean RMSEP value
formula, like y~X, i.e., dependent~response variables
data frame to be analyzed
optimal Ridge parameter lambda
number of replications for the CV
the number of segments to use for CV,
or a list with segments (see mvrCv
)
the type of segments to use. Ignored if 'segments' is a list
Positive integer. The length of the segments to use. If specified, it overrides 'segments' unless 'segments' is a list
logical; if 'TRUE', the segment number is printed for each segment
if TRUE a plot will be generated that shows the predicted versus the observed y-values
additional plot arguments
Peter Filzmoser <P.Filzmoser@tuwien.ac.at>
Generalized Cross Validation (GCV) is used by the function
lm.ridge
to get a quick answer for the optimal Ridge parameter.
This function should make a careful evaluation once the optimal parameter lambda has
been selected. Measures for the prediction quality are computed and optionally plots
are shown.
K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.
lm.ridge
, plotRidge
data(PAC)
res=ridgeCV(y~X,data=PAC,lambdaopt=4.3,repl=5,segments=5)
Run the code above in your browser using DataLab