PLR.CV {LorenzRegression}R Documentation

Cross-validation for penalized Lorenz regression

Description

PLR.CV selects the grid and penalization parameters of the penalized Lorenz regression by cross-validation.

Usage

PLR.CV(object, k, data.orig, seed.CV = NULL, parallel = FALSE, ...)

Arguments

object

An object with S3 class "PLR", i.e. the return of a call to the Lorenz.Reg function where penalty=="SCAD" or penalty=="LASSO".

k

An integer indicating the number of folds in the k-fold cross-validation

data.orig

A data frame corresponding to the original dataset, used in the Lorenz.Reg call.

seed.CV

An optional seed that is used internally for the creation of the folds. Default is NULL, in which case no seed is imposed.

parallel

Whether parallel computing should be used to distribute the cross-validation computations. Either a logical value determining whether parallel computing is used (TRUE) or not (FALSE, the default value). Or a numerical value determining the number of cores to use.

...

Additional parameters corresponding to arguments passed to the function vfold_cv from the rsample library.

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 object is a list containing the following components:

path

See the Lorenz.Reg function for the documentation of the original path. To this path is added the CV-score.

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.

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, data.orig = data, 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


[Package LorenzRegression version 2.0.0 Index]