bootstrap_runner: Runs the bootstrapping of the models.

Description Usage Arguments Value

View source: R/bootstrap_model.R

Description

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.

Usage

1
2
3
4
5
6
7
bootstrap_runner(
  bootstrap_function,
  resamples,
  parallelism = c("none", "future", "parallel"),
  num_cores = NULL,
  future_packages = NULL
)

Arguments

bootstrap_function

Function that we wish to run resamples times.

resamples

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.

parallelism

Type of parallelism (if any) to use to run the resamples. Options are:

"none"

The default, sequential

"future"

To use future.apply (futures)

"parallel"

To use parallel::mclapply

num_cores

How many cores to use. Defaults to parallel::detectCores() - 1L if parallelism = "parallel"

future_packages

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.

Value

Returns the list that contains the results of running bootstrap_function.


glmmboot documentation built on June 28, 2021, 1:05 a.m.