latrendBoot {latrend} | R Documentation |
Cluster longitudinal data using bootstrapping
Description
Performs bootstrapping, generating samples from the given data at the id level, fitting a lcModel to each sample.
Usage
latrendBoot(
method,
data,
samples = 50,
seed = NULL,
parallel = FALSE,
errorHandling = "stop",
envir = NULL,
verbose = getOption("latrend.verbose")
)
Arguments
method |
An lcMethod object specifying the longitudinal cluster method to apply, or the name (as |
data |
A |
samples |
The number of bootstrap samples to evaluate. |
seed |
The seed to use. Optional. |
parallel |
Whether to enable parallel evaluation. See latrend-parallel. Method evaluation and dataset transformation is done on the calling thread. |
errorHandling |
Whether to |
envir |
The |
verbose |
The level of verbosity. Either an object of class |
Value
A lcModels
object of length samples
.
See Also
Other longitudinal cluster fit functions:
latrend()
,
latrendBatch()
,
latrendCV()
,
latrendRep()
Other validation methods:
createTestDataFold()
,
createTestDataFolds()
,
createTrainDataFolds()
,
latrendCV()
,
lcModel-data-filters
Examples
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
bootModels <- latrendBoot(method, latrendData, samples = 10)
bootMAE <- metric(bootModels, name = "MAE")
mean(bootMAE)
sd(bootMAE)