Options & output

Install and build the sampler

install.packages("pak")
pak::install_github("hobbs-dev/hobbs")

library(hobbs)
hobbs_check_toolchain()
hobbs_build_sampler()
hobbs_check_sampler()

HOBBS requires Rust with Cargo and a C compiler. Windows also needs Rtools; macOS needs the Xcode Command Line Tools.

Run a model

fit <- hobbs(
  model = model_src,
  data = data,
  samples = 5000,
  burnin = 1500,
  out = "chain.bin",
  seed = 123
)

For tests and reproducible workflows, a dedicated workdir can also be supplied.

Read output

draws <- read_hobbs(fit)

or read a chain file directly:

draws <- read_hobbs("chain.bin")

If a parameter is declared with save=mean, its posterior means are stored separately rather than in the full chain.

Numerical distribution cache

Exact distribution calculations are the default. The optional lookup cache is controlled at run time:

fit <- hobbs(
  model = model_src,
  data = data,
  samples = 5000,
  burnin = 1500,
  out = "chain.bin",
  log_cache = TRUE,
  log_cache_bits = 12
)

log_cache is a speed/accuracy option, not an exact deterministic cache. Increasing log_cache_bits increases lookup resolution and table size. The paper treats this as a sensitivity-analysis setting rather than a default modeling choice.

Parameter-level options

param beta(p) sampler=rwmh;
param u(m,2) sampler=slice save=mean;

sampler= controls the continuous transition. save=mean controls storage. They are independent.