← Back to all sparks
B

BAS

INFRA · APIS
Velocity0.0

Bayesian Variable Selection and Model Averaging using Bayesian Adaptive Sampling

A Bayesian model-averaging package spending its 2.0 on memory, not methods.

bayesian-statisticsmodel-averagingmcmcr-packagememory-optimizationc-api
Current state
BAS performs Bayesian variable selection and model averaging for linear and generalized linear models, sampling from a model space too large to enumerate. The visible history splits cleanly: 2023-2024 added sampling machinery — an adaptive independent MCMC sampler with Horvitz-Thompson estimation, hereditary-constraint counting — while 2.0.0 in late 2025 reworked how sampler output is allocated in C. The 2.0.2 patch is a PROTECT fix for rchk warnings.
Where it's heading
Memory is the binding constraint and the releases say so directly. The hereditary-constraint counter, the GROW option, and the replacement of over-allocation with resizing all attack the same problem: n.models is a guess, and guessing high wastes memory on problems where few unique models are actually visited. The 2.0.0 work was additionally forced by R tightening its C API against non-API calls like SETLENGTH, a constraint every C-heavy CRAN package has been absorbing. Method development has been quiet since 1.7.x.
Prediction
The 1.7.5 notes call the hereditary-constraint counting a first step and say future updates will cover other constraint types, including polynomials, which remain unhandled. That is the one concrete commitment in this history, though nothing since has returned to it.

Recent moves

  1. 8mo ago

    BAS 2.0.2

    A single PROTECT added in model_probabilities.c to silence rchk warnings about unprotected variables. Compliance housekeeping on the C code 2.0.0 had just reworked.

    View source ↗
  2. 8mo ago

    BAS 2.0.0

    The major version goes to memory management rather than methodology. A new resizeVectors C function replaces the non-API SETLENGTH call that R no longer permits, and a GROW option lets MCMC output vectors expand as needed instead of being over-allocated from n.models and truncated. Both target the case where the sampler visits far fewer unique models than the user budgeted for.

    View source ↗
  3. 1y ago

    BAS 1.7.5

    Adds internal counting of models satisfying hereditary constraints so force.heredity can shrink the sampled model space rather than filtering after the fact. The notes are explicit that this covers only factors in the formula and is a first step toward reducing allocation during sampling.

    View source ↗
  4. 1y ago

    BAS 1.7.3

    Documents the adaptive independent MCMC sampler introduced the previous day as method = "AMCMC", and spells out the estimators it enables — importance sampling, Horvitz-Thompson, and Bayesian finite-population analogues. Effectively 1.7.2's release notes written properly.

    View source ↗
  5. 1y ago

    BAS 1.7.2

    Introduces the adaptive independent MCMC sampler, using proposals drawn with replacement and Horvitz-Thompson estimation to get better posterior model probabilities than plain MCMC visit frequencies. Restated with more detail in 1.7.3 a day later, so the two tags describe one piece of work.

    View source ↗
  6. 2y ago

    BAS 1.7.1

    Uninitialised-variable fixes in the C sources, argument type checking in bayesglm.fit, and the removal of zero-prior-probability models from the samplers. Correctness maintenance with no change in capability.

    View source ↗