cv.hrq_glasso {hrqglas} | R Documentation |
Cross-validation for quantile regression with group lasso
Description
K fold cross-validation is conducted. Four types of loss (squared error (se
), absolute error (ae
)
quantile check loss (check
) and huber loss (he
))
can be specified as the CV criterion.
Usage
cv.hrq_glasso(
x,
y,
group.index,
tau = 0.5,
k = 5,
loss = "check",
method = "quantile",
folds = NULL,
...
)
Arguments
x |
Design matrix |
y |
Response variable |
group.index |
A vector of group index, e.g., (1,1,1,2,2,2,3,3) |
tau |
Percentage |
k |
Number of folders. |
loss |
The loss function used for computing the cross-validation error. Supported losses include squared error ( |
method |
Choice for mean or quantile regression. Default is |
folds |
A vector of folder index for all observations. The procedure random splits if this argument is not specified. |
... |
Other inputs of function |
Value
The full solution path is returned. It also returns the vector of CV score as well as the optimal values in terms of min and 1se. Corresponding lambda values are also returned.
beta |
The estimated coefficients for all lambdas, stored in sparse matrix format, where each column corresponds to a lambda. |
lambda |
The sequence of lambdas. |
lambda.min |
The optimal lambda that minimizes the CV error |
lambda.1se |
The largest lambda such that CV error is within 1 standard error of the minimum CV error. |
cv.all |
The vector of all values of CV error for all lambdas. |
cv.min |
The value of CV error corresponding to |
cv.1se |
The value of CV error corresponding to |
folds |
The vector of indices for k folds split. |
cvup |
CV error + 1 standard error |
cvlo |
CV error + 1 standard error |
n.grp |
The number of selected groups for each lambda. |
Examples
n<- 100
p<- 10
x0<- matrix(rnorm(n*p),n,p)
X<- cbind(x0, x0^2, x0^3)[,order(rep(1:p,3))]
y<- -2+X[,1]+0.5*X[,2]-X[,3]-0.5*X[,7]+X[,8]-0.2*X[,9]+rt(n,2)
group<- rep(1:p, each=3)
fitcv<- cv.hrq_glasso(x=X, y=y, group.index=group, method="quantile")
plot(fitcv)