Performs bootstrapping, generating samples from the given data at the id level, fitting a lcModel to each sample.
latrendBoot(
method,
data,
samples = 50,
seed = NULL,
parallel = FALSE,
errorHandling = "stop",
envir = NULL,
verbose = getOption("latrend.verbose")
)An lcMethod object specifying the longitudinal cluster method to apply, or the name (as character) of the lcMethod subclass to instantiate.
A data.frame.
The number of bootstrap samples to evaluate.
The seed to use. Optional.
Whether to enable parallel evaluation. See latrend-parallel. Method evaluation and dataset transformation is done on the calling thread.
Whether to "stop" on an error, or to "remove' evaluations that raised an error.
The environment in which to evaluate the method arguments via compose().
If the data argument is of type call then this environment is also used to evaluate the data argument.
The level of verbosity. Either an object of class Verbose (see R.utils::Verbose for details),
a logical indicating whether to show basic computation information,
a numeric indicating the verbosity level (see R.utils::Verbose),
or one of c('info', 'fine', 'finest').
A lcModels object of length samples.
Other longitudinal cluster fit functions:
latrend(),
latrendBatch(),
latrendCV(),
latrendRep()
Other validation methods:
createTestDataFold(),
createTestDataFolds(),
createTrainDataFolds(),
latrendCV(),
lcModel-data-filters
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
bootModels <- latrendBoot(method, latrendData, samples = 10)
bootMAE <- metric(bootModels, name = "MAE")
mean(bootMAE)
#> [1] 0.2172096
sd(bootMAE)
#> [1] 0.007195816