← Back to all sparks
M

mcmcensemble

ANALYTICS
Velocity0.0

Ensemble Sampler for Affine-Invariant MCMC

An ensemble sampler just admitted its walkers were barely talking to each other.

mcmcbayesian-inferenceensemble-samplingreproducibilityr-package
Current state
mcmcensemble provides affine-invariant ensemble MCMC samplers — differential evolution and stretch move — behind a single MCMCEnsemble() entry point. The API consolidated in 3.0.0 around a flexible inits argument and a hidden internal surface, with parallelism delegated to the future framework. The 2025 release fixed a defect in the sampling behaviour itself, and results now differ from every earlier version.
Where it's heading
Development has moved from packaging to statistics. The early releases were about shape: a rename, argument alignment, moving coda to Suggests, adding tests, then parallel execution and named-vector support. The 3.0.0 release closed the API down to one wrapper and generalised initialisation. What is left, as 3.2.0 shows, is the correctness of the sampler itself — walker correlation, ergodicity checks, and grid artefacts in the differential evolution step were all addressed in a single release, all reported by one contributor. The package is being audited rather than extended.
Prediction
Further sampler-behaviour fixes are the most likely next move, since three separate correctness issues surfaced together in the last release and the package's API has been stable since 3.0.0.

Recent moves

  1. 1y ago

    Walker correlation bug fixed, changing results at any seed

    ⚡ SPARK

    The release that changes what the package's output means: a bug producing weak correlation across walkers is fixed, so runs differ from previous versions even at a fixed seed. Two guards land with it — a walker-count check for ergodicity and added noise to stop the differential evolution steps walking on a grid.

    View source ↗
  2. 2y ago

    Clearer error when only one walker is supplied

    A clearer error when a single walker is supplied, since ensemble sampling requires several. Published two minutes after 3.0.0 as part of the same batch, it is a small usability response to a user report — and a precursor to the harder ergodicity check added in 3.2.0.

    View source ↗
  3. 2y ago

    API narrows to one entry point with flexible initialisation

    The API consolidation: lower.inits and upper.inits give way to a single inits argument accepting a data.frame or matrix, and the two sampler functions are unexported in favour of the MCMCEnsemble() wrapper. A new vignette points users to coda and bayesplot for diagnostics rather than building them in.

    View source ↗
  4. 5y ago

    Named parameter vectors and recorded sampler metadata

    Target functions can now take a named vector, which makes multi-parameter models readable at the point they are written. The sampler used is also recorded as an attribute on the result, a small step toward making runs self-describing.

    View source ↗
  5. 5y ago

    Parallel ensemble sampling via the future framework

    Ensemble sampling becomes parallelisable through the future framework, the most practical addition in the package's history given that ensemble methods run many walkers by construction. A fix for chains sticking on very large log.p differences lands alongside it.

    View source ↗
  6. 5y ago

    Package renamed to mcmcensemble with aligned arguments and tests

    The release where the package took its current identity and name, aligned argument names and order across the sampler functions, and demoted coda from a hard dependency to a suggestion. Unit and regression tests arrive here too, which is what made the later behavioural audit possible.

    View source ↗