These functions perform K-fold cross-validation and calculates cross-validated predictive measures or Bayesian hierarchical additive models and additive Cox PH models.

tune.bgam(
  object,
  nfolds = 10,
  foldid = NULL,
  ncv = 1,
  s0 = NULL,
  verbose = TRUE
)

cv.bgam(object, nfolds = 10, foldid = NULL, ncv = 1, s0 = NULL, verbose = TRUE)

Arguments

object

A model fitted using bgam, banlasso or bacoxph to be cross-validated.

nfolds

Number of folds for cross-validation (default is 10).

foldid

Optional vector specifying fold assignments. If provided, nfolds will be ignored.

ncv

Number of cross-validation runs (default is 1).

s0

Smoothing parameter (NULL by default).

verbose

If TRUE, progress information is displayed (default is TRUE).

Value

An object containing the cross-validated results.