Learn R Programming

boostrq (version 1.0.0)

cvrisk.boostrq: Crossvalidation for boostrq

Description

Crossvalidation for boostrq

Usage

# S3 method for boostrq
cvrisk(
  object,
  folds = mboost::cv(object$weights, type = "kfold"),
  grid = 0:mstop(object),
  papply = parallel::mclapply,
  mc.preschedule = FALSE,
  fun = NULL,
  ...
)

Value

Cross-validated Boosting regression quantiles

Arguments

object

a boostrq object

folds

a matrix indicating the weights for the k resampling iterations

grid

a vetor of stopping parameters the empirical quantile risk is to be evaluated for.

papply

(parallel) apply function, defaults to mclapply. To run sequentially (i.e. not in parallel), one can use lapply.

mc.preschedule

preschedule tasks if are parallelized using mclapply (default: FALSE)? For details see mclapply.

fun

if fun is NULL, the out-of-sample risk is returned. fun, as a function of object, may extract any other characteristic of the cross-validated models. These are returned as is.

...

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
)

set.seed(101)

cvk.out <-
cvrisk(
 boosted.rq,
 grid = 0:mstop(boosted.rq),
 folds = mboost::cv(boosted.rq$weights, type = "kfold", B = 5)
)

cvk.out

plot(cvk.out)

mstop(cvk.out)

boosted.rq[mstop(cvk.out)]

Run the code above in your browser using DataLab