Skip to main content

Module smc

Module smc 

Source
Expand description

Tempered SMC over the Boltzmann posterior, built on fugue’s SMC engine

The old EvolutionarySMC hand-rolled the whole tempering loop (linear β ladder, weight normalization, ESS, systematic resampling, MH sweeps) and carried a weight-model bug: it reweighted by dβ · f(x) on top of a β·f(x) factor, double-counting β. This rebuild deletes all of it. The driver is [fugue::adaptive_smc_with_kernel] run against the model’s untempered target (factor(f), see EvolutionModel::smc_model): fugue supplies β by likelihood-tempering with an adaptive ESS-driven ladder, applies it exactly once, and returns an unbiased log-evidence estimate for free.

Crossover is fugue’s [fugue::CrossoverKernel] — a population-coupled Metropolis move on the product target — driven by an address mask supplied here (genome knowledge stays downstream; trace-space mechanics live upstream).

Structs§

CrossoverConfig
Configuration of the generic crossover population kernel (SharedSiteCrossover) that EvolutionSMC::run and EvolutionSMC::anneal build from EvoSmcConfig::crossover.
EvoSmcConfig
Configuration for EvolutionSMC::run.
EvolutionPosterior
The result of a tempered-SMC evolution run: fugue particles (traces + normalized weights) approximating the Boltzmann posterior π ∝ p·exp(f), plus the log-evidence estimate.
EvolutionSMC
The tempered-SMC evolution driver.
SharedSiteCrossover
Structure-safe crossover population kernel: fugue’s [fugue::CrossoverKernel] move (pick two distinct particles, exchange the block of choices at a masked address set, accept the pair with the product-target Metropolis ratio) with the mask of shared_site_crossover_mask and a completeness-checked re-score (fugue’s reconciling scorer plus its fresh/vanished report) in place of fugue’s panicking one.

Functions§

score_genome
Score a genome’s canonical trace (TraceGenome::to_trace) under an arbitrary model — convenience used by readouts and tests. Errors instead of panicking when the model’s address structure does not match the encoding (EV-N3); see EvolutionModel::score for the error cases.
shared_site_crossover_mask
The address set a SharedSiteCrossover proposal may exchange: every address present in both traces with the same value type, each kept independently with probability p_swap.