Computes IDR predictions with bootstrap aggregating (bagging) or subsample aggregation (subagging).
idrbag(y, X, y_observed = NULL, weights = NULL, decreasing = FALSE,
groups = setNames(rep(1, ncol(X)), colnames(X)), orders = c("comp" = 1),
stoch = "sd", pars = list(verbose = FALSE, eps_abs = 1e-5,
eps_rel = 1e-5, max_iter = 10000L), n_jobs = 1, progress = TRUE, newdata,
digits = NULL, interpolation = "linear", b, p, replace = FALSE,
grid = NULL, seed = NULL)A list of predictions, see predict.idrfit.
numeric vector (the response variable).
data frame of numeric or ordered factor variables (the regression covariates).
vector of indicators (TRUE or 1 for observed, FALSE or 0
for right-censored). At least one observation must be uncensored. Default
is all observed (rep(TRUE, length(y))).
vector of finite, non-negative weights (same length as y), at least one of which must be positive; observations with zero weight are dropped from the fit. Default is all weights equal to one. Weights are processed in single precision; it is up to the caller to avoid extreme imbalance (as a rule of thumb, no weight below ~1e-7 of the total weight).
boolean indicating whether y decreases with X
(by default, it increases with X).
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.
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.
stochastic order constraint used for estimation. Default is
"sd" for first order stochastic dominance. Use "hazard" for
hazard rate order (experimental).
parameters for quadratic programming optimization (only relevant
if X has more than one column), a list with options "verbose" T / F
(verbosity of solver), "eps_abs" positive float, "eps_rel" positive float,
"max_iter" positive integer.
number of worker threads used to fit the individual subsamples
in parallel. Only relevant when (su)bagging is active. Default is 1
(serial execution).
display a progress bar while fitting (TRUE,
FALSE or 1, 0). Default is TRUE; the bar is
written to stderr and is best viewed in an interactive R session.
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.
removed functionality, parameter kept for backwards compatibility but ignored with warning: number of decimal places for the predictive CDF, useful to keep the solution small across covariates.
interpolation method for univariate data, ignored at
this time (a warning is issued once per session if a value other than
"linear" is supplied). Only linear is supported for single variate,
multivariate uses midpoint.
number of (su)bagging samples.
size of (su)bagging samples relative to training data.
draw samples with (TRUE, 1) or without
(FALSE, 0) replacement?
grid on which the predictive CDFs are evaluated. Default are
the unique values of y.
integer seed for the random number generator. Only relevant when (su)bagging is active.
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.