Learn R Programming

rqPen (version 2.3)

predict.cv.rq.pen: Prediction from a cv quantile regression penalized model

Description

Returns predicted values from "rqPen" model associated with lambda for "newx" covariates.

Usage

# S3 method for cv.rq.pen
predict(object, newx, lambda,...)

Value

Returns predicted values from the model for the selected lambda.

Arguments

object

"cv.rq.pen" object.

newx

Matrix of covariates used for prediction.

lambda

Lambda associated with the model from which predictions should be made. Default is to use the lambda that provides the minimum criteria (cross-validation or BIC) that was selected by cv.rq.pen.

...

Needed for consistency with generic predict.

Author

Ben Sherwood

Examples

Run this code
x <- matrix(rnorm(800),nrow=100)
y <- 1 + x[,1] - 3*x[,5] + rnorm(100)
cv_model <- cv.rq.pen(x,y)
n2 <- matrix(rnorm(80),nrow=10)
preds <- predict(cv_model,n2)

Run the code above in your browser using DataLab