Similar to cv.rq.pen function, but uses group penalty. Group penalties use the L1 norm instead of L2 for computational convenience. As a result of this the group lasso penalty is the same as the typical lasso penalty and thus you should only use a SCAD or MCP penalty. Only the SCAD and MCP penalties incorporate the group structure into the penalty. The group lasso penalty is implemented because it is needed for the SCAD and MCP algorithm. QICD is a group penalty extension of the algorithm presented by Peng and Wang (2015). LP does a linear programming version of the group penalty.
cv.rq.group.pen(x, y, groups, tau = 0.5, lambda = NULL, penalty = "SCAD",
intercept = TRUE, criteria = "CV", cvFunc = "check", nfolds = 10,
foldid = NULL, nlambda = 100, eps = 1e-04, init.lambda = 1,alg="QICD",
penGroups=NULL, ...)
Returns the following:
Matrix of coefficients for different values of lambda
Matrix of residuals for different values of lambda.
Vector of rho, unpenalized portion of the objective function, for different values of lambda.
Data frame with "lambda" and second column is the evaluation based on the criteria selected.
Lambda which provides the smallest statistic for the selected criteria.
Penalty selected.
Whether intercept was included in model.
Group structure for penalty function.
Matrix of predictors.
Vector of response values.
Vector assigning columns of x to groups.
Conditional quantile being modelled.
Vector of lambdas. Default is for lambdas to be automatically generated.
Type of penalty: "LASSO", "SCAD" or "MCP".
Whether model should include an intercept. Constant does not need to be included in "x".
How models will be evaluated. Either cross-validation "CV", BIC "BIC" or large P BIC "PBIC".
If cross-validation is used how errors are evaluated. Check function "check", "SqErr" (Squared Error) or "AE" (Absolute Value).
K for K-folds cross-validation.
Group id for cross-validation. Function will randomly generate groups if not specified.
Number of lambdas for which models are fit.
Smallest lambda used.
Initial lambda used to find the maximum lambda. Not needed if lambda values are set.
Algorithm used for fit. "QICD" or "LP".
Specify which groups will be penalized. Default is to penalize all groups.
Additional arguments to be sent to rq.group.fit or groupQICDMultLambda.
Ben Sherwood
[1] Yuan, M. and Lin, Y. (2006). Model selection and estimation in regression with grouped variables. J. R. Statist. Soc. B, 68, 49-67.
[2] Peng, B. and Wang, L. (2015). An Iterative Coordinate Descent Algorithm for High-Dimensional Nonconvex Penalized Quantile Regression. Journal of Computational and Graphical Statistics, 24, 676-694.
if (FALSE) {
x <- matrix(rnorm(800),nrow=100)
y <- 1 + x[,1] - 3*x[,5] + rnorm(100)
cv_model <- cv.rq.group.pen(x,y,groups=c(rep(1,4),rep(2,4)))
}
Run the code above in your browser using DataLab