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)
A model fitted using bgam, banlasso or bacoxph to be cross-validated.
Number of folds for cross-validation (default is 10).
Optional vector specifying fold assignments. If provided, nfolds will be ignored.
Number of cross-validation runs (default is 1).
Smoothing parameter (NULL by default).
If TRUE, progress information is displayed (default is TRUE).
An object containing the cross-validated results.