Bundles the MCMC sampler arguments of hbm (and the
hbm_* family wrappers) into a single named list. Use this when
you want a reusable sampler profile or to reduce the size of long
hbm() calls.
Usage
hbm_control(
chains = 4L,
iter = 4000L,
warmup = NULL,
thin = 1L,
cores = 1L,
seed = NULL,
refresh = NULL,
adapt_delta = NULL,
max_treedepth = NULL,
control = NULL
)Arguments
- chains
Integer. Number of Markov chains (default
4L).- iter
Integer. Total iterations per chain (default
4000L).- warmup
Integer. Warm-up iterations per chain. Default
floor(iter / 2).- thin
Integer. Thinning interval (default
1L).- cores
Integer. Number of cores for parallel chains (default
1L).- seed
Optional integer seed for reproducibility.
- refresh
Integer. Stan progress refresh frequency (default
NULL: brms default).- adapt_delta
Numeric in \((0, 1)\). When supplied, included in the
controllist ascontrol = list(adapt_delta = ...).- max_treedepth
Integer. Max tree depth, included in
controlwhen supplied.- control
Optional
listof additional NUTS control options. Merged with anyadapt_delta/max_treedepthabove.
Value
A named list whose elements are valid arguments of
hbm.
Details
This is entirely opt-in: the flat signatures of hbm(),
hbm_lnln(), etc.\ continue to work exactly as before. Pass the
result directly to hbm() – it is auto-spliced via
....
Examples
# Build a reusable "high-quality" profile
hq <- hbm_control(chains = 4, iter = 8000, cores = 4,
adapt_delta = 0.99, seed = 1)
str(hq)
#> List of 7
#> $ chains : int 4
#> $ iter : int 8000
#> $ warmup : int 4000
#> $ thin : int 1
#> $ cores : int 4
#> $ seed : num 1
#> $ control:List of 1
#> ..$ adapt_delta: num 0.99
#> - attr(*, "class")= chr [1:3] "hbm_config_control" "hbm_config" "list"
# Quick draft profile
draft <- hbm_control(chains = 2, iter = 1000)