rq.gq.pen.cv {rqPen} | R Documentation |
Title Cross validation for consistent variable selection across multiple quantiles.
Description
Title Cross validation for consistent variable selection across multiple quantiles.
Usage
rq.gq.pen.cv(
x = NULL,
y = NULL,
tau = NULL,
lambda = NULL,
nfolds = 10,
cvFunc = c("rq", "se"),
tauWeights = NULL,
foldid = NULL,
printProgress = FALSE,
weights = NULL,
...
)
Arguments
x |
covariate matrix. Not needed if |
y |
univariate response. Not needed if |
tau |
a sequence of tau to be modeled, must be at least of length 3. |
lambda |
Values of |
nfolds |
number of folds |
cvFunc |
loss function to be evaluated for cross-validation. Supported loss functions include quantile ("rq") and squared loss("se"). Default is the quantile loss. |
tauWeights |
weights for different quantiles in calculating the cv error. Default is equal weight. |
foldid |
indices of pre-split testing obervations |
printProgress |
If set to TRUE prints which partition is being worked on. |
weights |
Weights for the quantile loss objective function. |
... |
other arguments for |
Details
Let and
index the observations in
fold b. Let
be the estimator for a given quantile and tuning parameters that did not use the bth fold. Let
be the number of observations in fold
b. Then the cross validation error for fold b is
Where, is the weight for the ith observation in fold b and
is a quantile specific weight. Note that
can be replaced squared error loss. Provides results about how the average of the cross-validation error changes with
. Uses a
Huber approximation in the fitting of model, as presented in Sherwood and Li (2022).
Value
An rq.pen.seq.cv object.
- cverr:
Matrix of cvSummary function, default is average, cross-validation error for each model, tau and a combination, and lambda.
- cvse:
Matrix of the standard error of cverr foreach model, tau and a combination, and lambda.
- fit:
The rq.pen.seq object fit to the full data.
- btr:
Let blank, unlike rq.pen.seq.cv() or rq.group.pen.cv(), because optmizes the quantiles individually does not make sense with this penalty.
- gtr:
A data.table for the combination of a and lambda that minimize the cross validation error across all tau.
- gcve:
Group, across all quantiles, cross-validation error results for each value of a and lambda.
- call:
Original call to the function.
Author(s)
Shaobo Li and Ben Sherwood, ben.sherwood@ku.edu
References
Wang M, Kang X, Liang J, Wang K, Wu Y (2024). “Heteroscedasticity identification and variable selection via multiple quantile regression.” Journal of Statistical Computation and Simulation, 94(2), 297-314.
Sherwood B, Li S (2022). “Quantile regression feature selection and estimation with grouped variables using Huber approximation.” Statistics and Computing, 32(5), 75.
Examples
## Not run:
n<- 200
p<- 10
X<- matrix(rnorm(n*p),n,p)
y<- -2+X[,1]+0.5*X[,2]-X[,3]-0.5*X[,7]+X[,8]-0.2*X[,9]+rt(n,2)
taus <- seq(0.1, 0.9, 0.2)
cvfit<- rq.gq.pen.cv(x=X, y=y, tau=taus)
cvCoefs <- coefficients(cvfit)
## End(Not run)