md_replicate | R Documentation |
Runs the specified movement study design multiple times and aggregates
outputs and summary statistics across independent replicates. This
enables sensitivity analyses and quantifies variability arising from
random sampling, especially when individual-level variation is enabled
(i.e., add_individual_variation = TRUE
in md_prepare()
).
Replication helps assess how stochasticity and design choices impact
simulation inference.
md_replicate(
obj,
n_replicates,
verbose = FALSE,
trace = TRUE,
parallel = FALSE,
ncores = parallel::detectCores()
)
obj |
An object of class |
n_replicates |
Integer specifying how many independent simulation replicates to run. |
verbose |
Logical; if |
trace |
Logical; if |
parallel |
Logical; if |
ncores |
Integer; number of CPU cores to use for parallel
processing. Defaults to all available cores detected by
|
Each replicate runs independently using the same study design object
but with a unique random seed to ensure independence. Results from all
replicates are merged using md_merge()
, and summary statistics
combine into a single data.table
for convenient downstream analyses
and evaluation. Parallel processing can significantly reduce runtime
when running many replicates; use ncores
to specify the number of CPU
cores used. If function is interrupted (e.g., Ctrl+C), it returns
results from all completed replicates up to that point.
A list of class movedesign_output
with two elements:
data
: A list containing
merged simulation outputs from all replicates.
summary
: A data.table
summarizing key
statistics for each replicate.
md_prepare()
, md_run()
, md_merge()
if (interactive()) {
input <- md_prepare(
data = buffalo,
models = models,
species = "buffalo",
n_individuals = 5,
dur = list(value = 1, unit = "month"),
dti = list(value = 1, unit = "day"),
add_individual_variation = TRUE,
grouped = FALSE,
set_target = "hr",
which_meta = "mean"
)
output <- md_replicate(input, n_replicates = 5)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.