A numeric vector containing the values of the target variable. If the values are proportions or percentages,
i.e. strictly within 0 and 1 they are mapped into R using the logit transformation.
x
A numeric matrix containing the variables.
nfolds
The number of folds in the cross validation.
lambda
A vector with the a grid of values of \(\lambda\) to be used.
folds
If you have the list with the folds supply it here. You can also leave it NULL and it will create folds.
ncores
The number of cores to use. If it is more than 1 parallel computing is performed.
seed
You can specify your own seed number here or leave it NULL.
graph
If graph is set to TRUE the performances for each fold as a function of the \(\lambda\) values will appear.
Value
A list including:
msp
The performance of the ridge regression for every fold.
mspe
The values of the mean prediction error for each value of \(\lambda\).
lambda
The value of \(\lambda\) which corresponds to the minimum MSPE.
performance
The minimum MSPE.
runtime
The time required by the cross-validation procedure.
Details
A k-fold cross validation is performed. This function is used by alfaridge.tune.
References
Hoerl A.E. and R.W. Kennard (1970). Ridge regression: Biased estimation for nonorthogonal problems.
Technometrics, 12(1):55-67.
Brown P. J. (1994). Measurement, Regression and Calibration. Oxford Science Publications.