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
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
Sherwood, B. and Li, S. (2021) An Efficient Approach to Feature Selection and Estimation for Quantile Regression with Grouped Variables, Working paper.