Skip to contents

Bootstrap both dose-response models

Usage

bootstrap_dose_response_models(
  object,
  times = 10000L,
  resample = c("observed", "fitted"),
  seed = NULL,
  backend = c("auto", "sequential", "mirai"),
  compute = NULL,
  workers = NULL,
  replicate_time_limit = 30
)

Arguments

object

A qdr_model_set or list of qdr_fit objects.

times

Number of bootstrap replicates.

resample

Either "observed" or "fitted".

seed

Optional integer random seed.

backend

Execution backend. "auto" uses mirai above 1,000 replicates when it is installed and otherwise runs sequentially. "sequential" runs refits in the current R process. "mirai" distributes refits to existing daemons or a temporary local pool. When loaded with pkgload::load_all(), the same checkout is loaded on each worker.

compute

Optional mirai compute profile name. Ignored by the sequential backend.

workers

Number of temporary local mirai daemons. NULL uses 75% of detected physical cores, with a minimum of one. Ignored when using existing daemons or the sequential backend.

replicate_time_limit

Seconds one replicate's refit may run before it is abandoned and recorded as not converged, with the reason in its error column. The default is 30; use Inf for no limit. Some resamples, such as one where every dose above a point responds and every dose below does not, can send the exact beta-Poisson optimiser searching for minutes; the limit keeps one such replicate from holding up the whole run. The limit is wall time, so on a heavily loaded machine a slow replicate can time out that would finish elsewhere. A finite limit also replaces any setTimeLimit() already set in the process that runs the refit.

Value

A named list of qdr_bootstrap objects.