PLR.CV {LorenzRegression} | R Documentation |
Cross-validation for penalized Lorenz regression
Description
PLR.CV
performs k-fold cross-validation to select the grid and penalization parameters of the penalized Lorenz regression.
Usage
PLR.CV(object, k, seed.CV = NULL, parallel = FALSE, ...)
Arguments
object |
An object of class |
k |
An integer specifying the number of folds in the k-fold cross-validation. |
seed.CV |
An optional integer specifying a seed for reproducibility in the creation of the folds. Default is |
parallel |
A logical or numeric value controlling parallel computation. If |
... |
Additional arguments passed to either the cross-validation function |
Details
The parameter seed.CV
allows for local seed setting to control randomness in the generation of the folds.
The specified seed is applied to the respective part of the computation, and the seed is reverted to its previous state after the operation.
This ensures that the seed settings do not interfere with the global random state or other parts of the code.
Value
An object of class c("PLR_cv", "PLR")
.
The returned list contains the following components:
path
See
Lorenz.Reg
for the original path. The cross-validation score is added.lambda.idx
A vector indicating the index of the optimal lambda obtained by each selection method.
grid.idx
A vector indicating the index of the optimal grid parameter obtained by each selection method.
splits
A list storing the data splits used for cross-validation, as generated by
vfold_cv
.
Note: The returned object may have additional classes such as "PLR_boot"
if bootstrap was performed.
References
Jacquemain, A., C. Heuchenne, and E. Pircalabelu (2024). A penalised bootstrap estimation procedure for the explained Gini coefficient. Electronic Journal of Statistics 18(1) 247-300.
See Also
Lorenz.Reg
, Lorenz.SCADFABS
, Lorenz.FABS
, Lorenz.boot
Examples
# Continuing the Lorenz.Reg(.) example:
PLR_CV <- PLR.CV(PLR, k = 5, seed.CV = 123)
# The object now inherits from the class "PLR_cv".
# Hence the methods (also) display the results obtained by cross-validation.
print(PLR_CV)
summary(PLR_CV)
coef(PLR_CV, pars.idx = "CV")
predict(PLR_CV, pars.idx = "CV")
plot(PLR_CV)
plot(PLR_CV, type = "diagnostic") # Plot of the scores depending on the grid and penalty parameters