Per-region Bayesian linear regression fitted with brms. The Stan
program is compiled once on the first region and reused across the
remaining regions via update(..., recompile = FALSE), which makes
fitting N regions roughly "one Stan compile + N cheap sampling runs".
Usage
fit_bread_brms(
region_mat,
coldata,
design,
contrast,
iter = 2000L,
chains = 4L,
cores = 4L,
seed = 1L,
silent = 2L,
refresh = 0L
)Value
A list with the same shape as fit_bread_summary, but each
per-region fit carries $draws (a numeric vector of posterior
draws for the contrast coefficient) instead of mu_n / Lambda_n_inv
/ a_n / b_n. posterior_summary and posterior_draws detect
the shape automatically.
Priors
v1 uses brms's default priors (weakly informative). The BREAD
bread_prior() object is ignored by this backend — it only drives
the conjugate backend. Custom brms priors via the brms_prior
argument are planned for a future release.