This function gets passed a function that runs a single bootstrap resample and a number of resamples, and decides how to run them e.g. in parallel etc.
bootstrap_runner(
bootstrap_function,
resamples,
parallelism = c("none", "future", "parallel"),
num_cores = NULL,
future_packages = NULL
)
Function that we wish to run
resamples
times.
How many resamples of your data do you want to do? 9,999 is a reasonable default (see Hesterberg 2015), but start very small to make sure it works on your data properly, and to get a rough timing estimate etc.
Type of parallelism (if any) to use to run the resamples. Options are:
"none"
The default, sequential
"future"
To use future.apply
(future
s)
"parallel"
To use parallel::mclapply
How many cores to use.
Defaults to parallel::detectCores() - 1L
if
parallelism = "parallel"
Packages to pass to created futures when
using parallelism = "future"
. This must be supplied if
the package used to model the data isn't in base and you're
using a plan that doesn't have shared memory, because the
model is updated with the S3 generic update
.
Returns the list that contains the results of running
bootstrap_function
.