Predictions from rq.pen.seq.cv object
# S3 method for rq.pen.seq.cv
predict(
object,
newx,
tau = NULL,
septau = TRUE,
cvmin = TRUE,
useDefaults = TRUE,
...
)
A matrix of predictions for each tau and a combination
rq.pen.seq.cv object
Matrix of predictors
Quantile of interest. Default is NULL, which will return all quantiles. Should not be specified if modelsIndex is used.
Whether tuning parameter should be optimized separately for each quantile.
If TRUE then minimum error is used, if FALSE then one standard error rule is used.
Whether the default results are used. Set to FALSE if you you want to specify specific models and lambda values.
Additional parameters sent to coef.rq.pen.seq.cv().
Ben Sherwood, ben.sherwood@ku.edu
x <- matrix(runif(1600),ncol=8)
y <- 1 + x[,1] + x[,8] + (1+.5*x[,3])*rnorm(200)
m1 <- rq.pen.cv(x,y,penalty="ENet",a=c(0,.5,1),tau=c(.25,.75),lambda=c(.1,.05,.01))
newx <- matrix(runif(80),ncol=8)
cvpreds <- predict(m1,newx)
Run the code above in your browser using DataLab