mod mixing

module mixing

Inverted Gelman–Rubin for cooperative search.

MCMC wants (hat R to 1): chains have mixed onto one stationary distribution. Cooperative search splits that diagnostic:

  • explore-role chains must stay unmixed ((hat R) large);

  • a sampled incumbent is dominant only when occupant chains have mixed onto it, it is uniquely deepest among observed attractors, and it is strictly more occupied than every observed competing basin.

Mixing onto a lone icosahedral floor diagnoses one sampled mode. It does not prove that an unobserved lower mode is absent. Catalog saturation and leftover-mass diagnostics quantify search evidence without converting it into a global-optimality certificate.

Variables

const CERTIFY_CHAINS: usize

Occupant plus competitor, when a competitor is on file.

const CERTIFY_DRAWS_PER_HALF: usize

Vehtari minimum draws per split half.

const CERTIFY_MIN_SAMPLES: usize

Occupant traces shorter than this do not support the mixing diagnostic. Two quench reports on two random-start families give (hat R = 0) but do not establish convergence or global optimality. 2 × 2 × 4 = 16 (Hop.certify_min_samples).

const CERTIFY_SPLIT_HALVES: usize

Vehtari split-(hat R) halves per chain.

const MIXED_RHAT: f64

Vehtari, Gelman, Simpson, Carpenter & Bürkner (2021), Bayesian Anal. 16:667-718: use the sample only if split (hat R<1.01). Gelman & Rubin (1992) used 1.1; Brooks–Gelman (6/5) is the SI algebra identity, not the occupant cut.

Functions

fn explore_collapsed(explore_series: &[Vec<f64>]) -> bool

Explore-role chains have collapsed onto one attractor.

fn explore_must_leave(energy_explore: &[Vec<f64>], n_on_incumbent_packing: usize, n_assigned: usize) -> bool

Explore-role failure: mixed energy, or two or more assigned walks rematched onto the frozen incumbent packing.

One occupied packing with several occupants is a collapse. Waiting for a second family never opens that family. Live family-label (hat R) is not this test: a growing DECAF codebook moves the label under the walks. Distinct packings rematched against the incumbent histogram do not force Leave.

fn invert_mixing(attractors: &[AttractorStrength], explore_series: &[Vec<f64>]) -> MixingEvidence

Combine attractor strengths and the explore-role series.

fn mixed(rhat: f64) -> bool

Whether (hat R) says the chains have mixed.

fn occupant_rhat(series: &[Vec<f64>]) -> f64

Occupant split-(hat R) for certification. Series shorter than CERTIFY_MIN_SAMPLES are dropped, so two-point quenches cannot certify. Explore-role collapse uses rhat_split on the raw traces.

fn rhat_series(chains: &[Vec<f64>]) -> f64

Gelman–Rubin (hat R) on one scalar series per chain.

Constant traces at the same value are mixed ((hat R = 0)). Constant traces at different values have (W = 0) and (B > 0), which is unmixed ((hat R = infty)). The MCMC crate::methods::GelmanRubin skip on (W = 0) would call that mixed; inverted search cannot.

fn rhat_split(chains: &[Vec<f64>]) -> f64

Vehtari split-(hat R): each chain is cut in half, then rhat_series runs on the (2m) windows. Chains shorter than two CERTIFY_DRAWS_PER_HALF draws are dropped.

fn sampled_minimum_is_dominant(putative: &AttractorStrength, competitors: &[AttractorStrength], uniquely_deepest: bool) -> bool

Whether an observed minimum is dominant within the sampled attractors.

A second mixed competitor is required only when a competitor is on file: that competitor must be mixed (an attractor, not a flyby), and the sampled incumbent must be strictly more occupied. An empty competitor set means only that the sample contains one mode. This predicate makes no statement about unobserved modes or global optimality.

fn stronger(left: &AttractorStrength, right: &AttractorStrength) -> bool

Strict attraction order: more occupants win; equal occupancy breaks toward the tighter occupant mix.

Structs and Unions

struct AttractorStrength

Occupancy and occupant mixing of one packing family or census basin.

energy: f64

Lowest energy observed among occupants.

occupancy: usize

Number of independent chains sitting on this attractor.

occupant_rhat: f64

Gelman–Rubin (hat R) of occupant energy series.

Implementations

impl AttractorStrength

Functions

fn mixed(&self) -> bool

Occupant chains have mixed onto this attractor.

struct MixingEvidence

Inverted Gelman–Rubin evidence consumed by the catalog policy.

explore_collapsed: bool

Explore-role (or lone-floor) series have mixed.

certified_attractor: bool

Incumbent attractor is uniquely deepest and occupant-mixed. A competitor, when one exists, must also be mixed and less occupied.

pruned: bool

Asynchronous successive halving discarded this walk at a rung.