Settings for the No-U-Turn Sampler used by fit().

nuts(
  draws = 1000,
  warmup = 1000,
  chains = 4,
  target_acceptance = 0.8,
  max_depth = 10,
  ad = c("forwarddiff", "mooncake")
)

Arguments

draws

Integer. Number of post-warmup draws per chain.

warmup

Integer. Number of warmup (adaptation) iterations per chain, which are discarded.

chains

Integer. Number of chains.

target_acceptance

Numeric. Target acceptance rate during adaptation. Increase towards one if there are divergent transitions.

max_depth

Integer. Maximum tree depth.

ad

Character string. Automatic differentiation backend: "forwarddiff" works for every model and is fast for models with few parameters; "mooncake" scales better to long time series but compiles slowly on first use.

Value

An object of class cidm_nuts.

Details

Chains run in parallel only if Julia was started with more than one thread; set the environment variable JULIA_NUM_THREADS (e.g. to "4") before Julia starts.

Examples

nuts(draws = 500, warmup = 500, chains = 2)
#> <composableIDModelR NUTS sampler>
#>   Chains: 2 
#>   Warmup: 500 per chain
#>   Draws: 500 per chain
#>   Target acceptance: 0.8 
#>   Maximum tree depth: 10 
#>   AD backend: forwarddiff