cv.rq.group.pen {rqPen} | R Documentation |
Old cross validation function for group penalty
Description
This function is no longer exported. Recommend using rq.group.pen.cv() instead.
Usage
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 = "huber",
penGroups = NULL,
...
)
Arguments
x |
Matrix of predictors. |
y |
Vector of responses. |
groups |
Vector of groups. |
tau |
Quantile being modeled. |
lambda |
Vector of lambdas. Default is for lambdas to be automatically generated. |
penalty |
Type of penalty: "LASSO", "SCAD" or "MCP". |
intercept |
Whether model should include an intercept. Constant does not need to be included in "x". |
criteria |
How models will be evaluated. Either cross-validation "CV", BIC "BIC" or large P BIC "PBIC". |
cvFunc |
If cross-validation is used how errors are evaluated. Check function "check", "SqErr" (Squared Error) or "AE" (Absolute Value). |
nfolds |
K for K-folds cross-validation. |
foldid |
Group id for cross-validation. Function will randomly generate groups if not specified. |
nlambda |
Number of lambdas for which models are fit. |
eps |
Multiple of lambda max for Smallest lambda used. |
init.lambda |
Initial lambda used to find the maximum lambda. Not needed if lambda values are set. |
alg |
Algorithm used for fit. Only "LP", "QICD" is no longer available. |
penGroups |
Specify which groups will be penalized. Default is to penalize all groups. |
... |
Additional arguments to be sent to rq.group.fit |
Value
Returns the following:
- beta
Matrix of coefficients for different values of lambda
- residuals
Matrix of residuals for different values of lambda.
- rho
Vector of rho, unpenalized portion of the objective function, for different values of lambda.
- cv
Data frame with "lambda" and second column is the evaluation based on the criteria selected.
- lambda.min
Lambda which provides the smallest statistic for the selected criteria.
- penalty
Penalty selected.
- intercept
Whether intercept was included in model.
- groups
Group structure for penalty function.
References
Yuan, M. and Lin, Y. (2006). Model selection and estimation in regression with grouped variables. J. R. Statist. Soc. B, 68, 49-67.
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.
Examples
## Not run:
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)),criteria="BIC")
## End(Not run)