Learn R Programming

boostrq (version 1.0.0)

predict.boostrq: Model predictions for boosting regression quantiles

Description

Model predictions for boosting regression quantiles

Usage

# S3 method for boostrq
predict(object, newdata = NULL, which = NULL, aggregate = "sum", ...)

Value

predictions for the new data

Arguments

object

a boostrq object

newdata

a data.frame (or data.table) including all covariates contained in the baselearners

which

a subset of base-learners

aggregate

a character specifying how to aggregate coefficients of single base learners. The default returns the coefficient for the final number of boosting iterations. "cumsum" returns a list with matrices (one per base-learner) with the cumulative coefficients for all iterations. "none" returns a list of matrices where the jth columns of the respective matrix contains coefficients of the base-learner of the jth boosting iteration.

...

additional arguments passed to callies

Examples

Run this code
boosted.rq <-
boostrq(
 formula = mpg ~ brq(cyl * hp) + brq(am + wt),
 data = mtcars,
 mstop = 200,
 nu = 0.1,
 tau = 0.5
)

predict.data <- data.frame(hp = 165, cyl = 6, am = 1, wt = 3.125)

predict(boosted.rq, newdata = predict.data)

Run the code above in your browser using DataLab