This R package provides tools for estimating a quantile regression model with a penalized objective function. Implements a variety of penalties, including group penalties.
For most up to date versions use the following code. However, be warned the github package is often in a state of testing and debugging.
::install_github("bssherwood/rqpen") devtools
The following code will install the more stable CRAN version.
install.packages("rqPen")
library(rqPen)
<- 200
n<- 30
p<- matrix(rnorm(n*p),n,p)
x0<- cbind(x0, x0^2, x0^3)[,order(rep(1:p,3))]
x<- -2+x[,1]+0.5*x[,2]-x[,3]-0.5*x[,7]+x[,8]-0.2*x[,9]+rt(n,2)
y<- rep(1:p, each=3)
group
# lasso estimation
# one tau
<- rq.pen(x,y)
fit1 # several values of tau
<- rq.pen(x,y,tau=c(.2,.5,.8))
fit2
# Group SCAD estimation
<- rq.group.pen(x,y,groups=group,penalty="gSCAD")
fit3
# cross validation
<- rq.pen.cv(x,y)
cv1 plot(cv1)
<- rq.pen.cv(x,y,tau=c(.2,.5,.8))
cv2 plot(cv2)
<- rq.group.pen(x,y,groups=group,penalty="gSCAD")
cv3 plot(cv3)
# BIC selection of tuning parameters
<- qic.select(fit1)
qs1 <- qic.select(fit2)
qs2 <- qic.select(fit3) qs3
See, https://github.com/bssherwood/rqpen/blob/master/ignore/rqPenArticle.pdf, for a vignette. The Huber approach for rq.pen relies on the R package hqreg and work presented in “Semismooth Newton Coordinate Descent Algorithm for Elastic-Net Penalized Huber Loss Regression and Quantile Regression”. The Huber approach in rq.group.pen relies on R package hrqglas and work presented in An Efficient Approach to Feature Selection and Estimation for Quantile Regression with Grouped Variables
Sherwood, B. and Li, S. (2022) An Efficient Approach to Feature Selection and Estimation for Quantile Regression with Grouped Variables, Statistics and computing, 75.
Yi, C. and Huang, J. (2015) Semismooth Newton Coordinate Descent Algorithm for Elastic-Net Penalized Huber Loss Regression and Quantile Regression, Journal of Computational and Graphical Statistics, 26:3, 547-557.