Add an affine-invariant ensemble sampler - #573
Open
BJMCox wants to merge 20 commits into
Open
Conversation
Define the affine-invariant proposal and validate its ensemble before sampling. Reject unsupported weighting and proposal combinations instead of applying invalid defaults.
Apply the Goodman-Weare move in two ordered ensemble halves so each complement stays fixed during proposal generation. Reuse BAT's bookkeeping and RNG partitions without copying the full ensemble per walker.
Estimate autocorrelation from each full-sweep ensemble mean so cross-walker lag dependence remains in the variance calculation. Pool only independent BAT ensembles and decline estimates when exact path alignment is unavailable.
StretchMove has no proposal or transform tuning, so burn-in has no acceptance target to satisfy. Mark its fixed proposal state as tuned and retain normal cycle and convergence handling.
Check affine equivariance and known moments on correlated Gaussian and controlled non-Gaussian targets. Keep convergence groups aligned with independent ensembles rather than coupled walkers.
Document the coupled-ensemble contract and its diagnostic limits. Record allocation, density-call, and timing evidence for representative low- and moderate-dimensional workloads.
Revalidate affine rank after retry initialization and compute stretch factors without overflowing finite scales. Report proposal acceptance counters without treating them as convergence evidence.
Share proposal validation and step finalization without changing transition order. Reuse unshaped repetition data and remove small sources of duplicate work.
Route StretchMove through a private atomic ensemble sweep with supported sequential and threaded executors. Preserve walker-keyed streams and exact sequential samples while rejecting distributed execution before sampling.
Implement current-complement differential evolution proposals with dimension-resolved scaling and distinct ordered companion draws. Reuse the shared atomic ensemble sweep for deterministic sequential and threaded execution.
Implement four-group differential-evolution snooker proposals with the exact Hastings correction and deterministic executor behavior. Reject degenerate directions before target evaluation while preserving the current walker state.
Reject zero and nonfinite q-z directions before transform or target evaluation. Reuse the validated reverse-direction norm in the exact Hastings correction and cover both rejection paths.
Apply an active ensemble component to one complete walker sweep while retaining the existing integer and categorical selection rules. Enforce ensemble weighting, fixed-transform, and pooled-ESS contracts without disabling ordinary component proposal tuning.
Reject adaptive mixture-weight tuning when an ensemble component has no target-acceptance model. Let top-level no-tuning treat ensemble components as tuning-successful while retaining ordinary component acceptance checks.
Add calibrated deterministic stationary-moment coverage for the ensemble moves and their weighted mixture. Document proposal laws, constraints, mixtures, and executor behavior without claiming convergence or general performance.
Name the shared documentation sections without implying every ensemble move is affine-invariant. Limit the affine-equivariance statement to Stretch and DE, and define the Stretch scale notation.
Retain independent move, executor, atomicity, RNG, and stationary-law checks while removing snapshots and duplicate fixture coverage. Keep the sequential Stretch fast path and use one shared test seam for the remaining ensemble contracts.
Route sequential and generic Stretch walkers through one evaluation kernel while retaining the sequential RNG-partition schedule. Remove private and type-only ensemble checks while preserving observable transition, atomicity, RNG, and compatibility coverage.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #573 +/- ##
==========================================
+ Coverage 65.45% 66.18% +0.73%
==========================================
Files 121 125 +4
Lines 7060 7485 +425
==========================================
+ Hits 4621 4954 +333
- Misses 2439 2531 +92 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Consolidate shared ensemble policy and remove redundant tests without changing transition behavior. Fix mixture initialization and retry validation gaps found during final review.
BJMCox
force-pushed
the
add-affine-invariant-ensemble
branch
from
September 1, 2026 12:06
984f45a to
e12d101
Compare
Mixtures rebuilt transformed walker coordinates and repeated identical ensemble validation for each component. Reusing the existing coordinates and sharing the invariant checks removes duplicate work while preserving move-specific limits and six-argument compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a native Goodman--Weare stretch move to
TransformedMCMC, without adding a sampler dependency.StretchMoverequires an explicitnwalkers, at least2dwalkers, full-rank transformed initialization, andRepetitionWeighting. Affine invariance does not solve multimodality, and acceptance rate is not treated as convergence evidence.Validation:
Pkg.test();BenchmarkTools measurements confirm one target-density call per walker per full sweep and linear walker scaling. Reusing the proposed transformed-state buffer cut the measured transition allocations without changing the proposal values or RNG stream.