Run paired replicates for one scenario, with checkpointing
run_paired_scenario.RdRuns single_paired_rep for i = 1, ..., n_sims, in
chunks of chunk_size replicates (in parallel via
parallel::mclapply when n_cores > 1). After each chunk, all
rows so far are written to checkpoint_file; if that file exists at
the start, the run resumes from the replicates already completed.
Usage
run_paired_scenario(
n_sims,
seed,
...,
compute_PP = TRUE,
n_cores = 1,
checkpoint_file = NULL,
chunk_size = 100
)Arguments
- n_sims
Number of replicates.
- seed
Base seed (see
single_paired_rep).- ...
Further arguments passed to
single_paired_rep.- compute_PP
Passed to
single_paired_rep: ifFALSE, the PP columns areNAandupdate_priors_simsandPP_simsare not needed. A checkpoint is only resumed with the samecompute_PP. DefaultTRUE.- n_cores
Number of cores (default 1).
- checkpoint_file
Optional path of an RDS checkpoint file.
- chunk_size
Number of replicates per chunk (default 100).
Value
A list with raw (one row per replicate, ordered by
rep_id) and settings (all arguments, the package, R,
rjags and JAGS versions, the git commit of the working directory, the
hostname, a timestamp and n_failed). The
number of failed replicates is reported with a message, and a warning
is given if more than 1\