ab_cvGAM: Select optimal degrees of freedom for SL.gam() using...

Description Usage Arguments Details Value Examples

Description

ab_cvGAM is an internal tuning function called by agecurveAb and tmleAb that selects degrees of freedom for natural splines in a GAM model using cross-validation

Usage

1
2
ab_cvGAM(Y, X, id = NULL, family = gaussian(), SL.library,
  cvControl = list(), print = FALSE, df = 2:10)

Arguments

Y

The outcome. Must be a numeric vector.

X

A matrix of features that predict Y, usually a data.frame.

id

An optional cluster or repeated measures id variable. For cross-validation splits, id forces observations in the same cluster or for the same individual to be in the same validation fold.

family

Model family (gaussian for continuous outcomes, binomial for binary outcomes)

SL.library

SuperLearner library

cvControl

Optional list to control cross-valiation (see SuperLearner for details).

print

logical. print messages? Defaults to FALSE

df

a sequence of degrees of freedom to control the smoothness of natural splines in the GAM model. Defaults to 2:6

Details

ab_cvGAM is an internal function called by agecurveAb or tmleAb if SL.gam() is included in the algorithm library. It performs an addition pre-screen step of selecting the optimal spline degress of freedom using cross validation. The default is to search over degrees 2,3,...10, which is usually pretty good. This additional selection step enables you to tune the smoothing parameter. Cross-validated risks are estimated using SuperLearner.

Value

returns a list with updated SuperLearner library, the optimal node size, and cvRisks

Examples

1
# TBD

ben-arnold/tmleAb documentation built on May 12, 2019, 10:55 a.m.