Run chains simultaneously. This differs from monty_runner_parallel, which runs chains individually in parallel by working with models that can evaluate multiple densities at the same time. There are situations where this might be faster than running in parallel, but primarily this exists so that we can see that samplers can work with multiple samples at once.
Arguments
- progress
Optional logical, indicating if we should print a progress bar while running. If
NULL
, we use the value of the optionmonty.progress
if set, otherwise we show the progress bar (as it is typically wanted). Alternatively, you can provide a string indicating the progress bar type. Options arefancy
(equivalent toTRUE
),none
(equivalent toFALSE
) andsimple
(a very simple text-mode progress indicator designed play nicely with logging; it does not use special codes to clear the line).
Value
A runner of class monty_runner
that can be passed to
monty_sample()
Examples
m <- monty_example("banana")
s <- monty_sampler_random_walk(vcv = diag(2) * 0.01)
r <- monty_runner_simultaneous()
samples <- monty_sample(m, s, 200, runner = r)
#> Sampling ■ | 0% ETA: 0s
#> ✔ Sampled 200 steps across 1 chain in 19ms
#>