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

Description Usage Arguments Value Author(s) Examples

View source: R/workHorse.R

Description

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

Usage

1
2
## S3 method for class 'cv.rq.pen'
predict(object, newx, 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.

Value

Returns predicted values from the model for the selected lambda.

Author(s)

Ben Sherwood

Examples

1
2
3
4
5
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)

rqPen documentation built on May 30, 2017, 2:02 a.m.

Search within the rqPen package
Search all R packages, documentation and source code