idrbag: Compute IDR predictions with (su)bagging

Description Usage Arguments Details Value

View source: R/bagging.R

Description

Computes IDR predictions with bootstrap aggregating (bagging) or subsample aggregation (subagging).

Usage

1
2
3
4
idrbag(y, X, groups = setNames(rep(1, ncol(X)), colnames(X)), orders =
  c("comp" = 1), stoch = "sd", pars = osqpSettings(verbose = FALSE, eps_abs =
  1e-5, eps_rel = 1e-5, max_iter = 10000L), progress = TRUE, newdata, 
  digits = 3, interpolation = "linear", b, p, replace = FALSE, grid = NULL)

Arguments

y

numeric vector (the response variable).

X

data frame of numeric or ordered factor variables (the regression covariates).

groups

named vector of length ncol(X) denoting groups of variables that are to be ordered with the same order (see 'Details'). Only relevant if X contains more than one variable. The same names as in X should be used.

orders

named vector giving for each group in groups the order that will be applied to this group. Only relevant if X contains more than one variable. The names of orders give the order, the entries give the group labels. Available options: "comp" for componentwise order, "sd" for stochastic dominance, "icx" for increasing convex order (see 'Details). Default is "comp" for all variables. The "sd" and "icx" orders can only be used with numeric variables, but not with ordered factors.

stoch

stochastic order constraint used for estimation. Default is "sd" for first order stochastic dominance. Use "hazard" for hazard rate order (experimental).

pars

parameters for quadratic programming optimization (only relevant if X has more than one column), set using osqpSettings.

progress

display progressbar (TRUE, FALSE or 1, 0)?

newdata

data.frame containing variables with which to predict. Ordered factor variables are converted to numeric for computation, so ensure that the factor levels are identical in newdata and in X.

digits

number of decimal places for the predictive CDF.

interpolation

interpolation method for univariate data. Default is "linear". Any other argument will select midpoint interpolation (see 'Details' in predict.idrfit). Has no effect for multivariate IDR.

b

number of (su)bagging samples.

p

size of (su)bagging samples relative to training data.

replace

draw samples with (TRUE, 1) or without (FALSE, 0) replacement?

grid

grid on which the predictive CDFs are evaluated. Default are the unique values of y.

Details

This function draws b times a random subsample of size ceiling(nrow(X)*p)) from the training data, fits IDR to each subsample, computes predictions for the new data supplied in newdata, and averages the predictions derived from the b subsamples. There are no default values for b and p.

Value

A list of predictions, see predict.idrfit.


isodistrreg documentation built on March 22, 2021, 5:06 p.m.