High-level control.

spim_control(
  short_run,
  n_chains,
  deterministic = FALSE,
  multiregion = FALSE,
  rt = TRUE,
  severity = FALSE,
  simulate = FALSE,
  demography = FALSE,
  date_restart = NULL,
  n_particles = 192,
  n_mcmc = 1500,
  burnin = 500,
  workers = TRUE,
  n_sample = 1000,
  n_threads = NULL,
  compiled_compare = FALSE,
  adaptive_proposal = NULL,
  mcmc_path = NULL,
  verbose = TRUE
)

Arguments

short_run

Logical, indicating if this is a debug run. This will use freer particles, mcmc steps and a small sample

n_chains

The number of chains to run

deterministic

Logical, indicating if the model to fit to data is run deterministically or stochastically

multiregion

Logical, indicating if we are fitting multiple regions at once (in which case even the deterministic model may benefit from multithreading).

rt

Logical, indicating if we are calculating Rt trajectories or not. Default is TRUE

severity

Logical, indicating if we are outputting severity trajectories (e.g. IFR, IHR, HFR). Default to FALSE.

simulate

Logical, indicating if we are outputting a simulate object for onward simulation

demography

Logical, indicating if we are outputting model demography - admissions and deaths by age

date_restart

Optionally, dates save restart data in the pmcmc (see mcstate::pmcmc

n_particles

number of particles to be used in particle filter if short_run = FALSE

n_mcmc

number of steps to be used in PMCMC if short_run = FALSE

burnin

number of steps out of n_mcmc to be used as a burn-in in PMCMC if short_run = FALSE

workers

Logical, indicating if we should enable workers. If TRUE, then a number of workers between 1 and 4 will be used depending on n_chains and the detected number of cores.

n_sample

number of steps to retain (across all chains) if short_run = FALSE

n_threads

Explicit number of threads, overriding detection by spim_control_cores

compiled_compare

Use a compiled compare function (rather than the R version). This can speed things up with the deterministic models in particular.

adaptive_proposal

Control the adaptive proposal. By default this is disabled (value of NULL or FALSE). This can only be enabled for determinsitic models. Pass either TRUE here or the results from mcstate::adaptive_proposal_control()

mcmc_path

Path to store the mcmc results in

verbose

Logical, indicating if we should print information about the parallel configuration

Value

A list of options

Details

TODO: document parallel detection