PLR.CV {LorenzRegression} | R Documentation |
Determines the regularization parameter (lambda) in a PLR via cross-validation
Description
PLR.CV
undertakes k-fold cross-validation for a Penalized Lorenz Regression. It returns the CV-score associated to each value of the regularization parameter and the index of the optimum.
Usage
PLR.CV(
formula,
data,
penalty = "SCAD",
h,
PLR.est = NULL,
standardize = TRUE,
weights = NULL,
eps,
nfolds = 10,
foldID = NULL,
seed.CV = NULL,
parallel = FALSE,
...
)
Arguments
formula |
A formula object of the form response ~ other_variables. |
data |
A data frame containing the variables displayed in the formula. |
penalty |
penalty used in the Penalized Lorenz Regression. Possible values are "SCAD" (default) or "LASSO". |
h |
bandwidth of the kernel, determining the smoothness of the approximation of the indicator function. |
PLR.est |
Output of a call to |
standardize |
Should the variables be standardized before the estimation process? Default value is TRUE. |
weights |
vector of sample weights. By default, each observation is given the same weight. |
eps |
Step size in the FABS or SCADFABS algorithm. Default value is 0.005. |
nfolds |
Number of folds. Default value is 10. |
foldID |
vector taking value from 1 to nfolds specifying the fold index of each observation. Default value is NULL in which case the folds are defined internally. |
seed.CV |
Should a specific seed be used in the definition of the folds. Default value is NULL in which case no seed is imposed. |
parallel |
Whether parallel computing should be used to distribute the |
... |
Additional parameters corresponding to arguments passed in |
Value
A list with two components
val
vector indicating the CV-score for each value of lambda.
best
index where the optimum is attained.
References
Jacquemain, A., C. Heuchenne, and E. Pircalabelu (2022). A penalised bootstrap estimation procedure for the explained Gini coefficient.
See Also
Lorenz.Reg
, PLR.wrap
, Lorenz.FABS
, Lorenz.SCADFABS
Examples
YX_mat <- Data.Incomes[,-2]
PLR <- PLR.wrap(YX_mat, h = nrow(YX_mat)^(-1/5.5), eps=0.01)
PLR.CV(Income ~ ., Data.Incomes, PLR.est = PLR,
h = nrow(Data.Incomes)^(-1/5.5), eps = 0.01, nfolds = 5)