twostage: Two stage lmer boost

Description Usage Arguments Details See Also

View source: R/twostage.R

Description

Fits a random intercept model with the grouping variable id to the residuals of gbm fit to the remaining predictors.

Usage

1
twostage(y, X, id, ..., cv.folds = 3, mc.cores = 1, subset = NULL)

Arguments

y

vector of observations of length n

X

matrix or data frame of predictors

id

name or index of grouping variable in x (can have missing values)

...

arguments passed to gbm_grid. Arguments can be passed as vectors as in

cv.folds

number of cross validation folds

mc.cores

number of cores to use in mclapply

subset

subset of observations tuning by cross validation will be carried out over expand.grid(...)

Details

The gbm model is cross-validated over a grid of all meta-parameters, as in gbm_grid. The model is fit to all predictors, except the grouping variable. Subsequently, a simple random intercept model (from lmer) is fit to the residuals, using id as a grouping variable, with the formula r ~ 1 + (1|id). A predict, and influence methods are provided for computing predictions and influence of predictors.

See Also

gbm_grid


patr1ckm/mvtboost documentation built on May 24, 2019, 8:21 p.m.