05: Inference Comparison & Parameter Space Mapping

Why Compare Methods? In science, confidence comes from convergence — when independent approaches reach the same answer, we trust that answer far more than any single method could justify. This notebook loads saved results from notebooks 02–04c and compares all inference methods head-to-head. Each method makes different computational assumptions: ABC-SMC uses distance thresholds, BSL assumes Gaussian summary statistics, NPE learns a normalizing flow, and NRE learns a likelihood ratio classifier. If these fundamentally different approaches agree on the mutation-selection parameters, we have strong evidence that those parameters are genuinely constrained by the fitness trajectory data — not artifacts of any particular computational choice.

This matters biologically because the five inferred parameters — mutation rate (μ), DFE shape (γshape), DFE scale (γscale), fraction beneficial (pbeneficial), and environmental noise (σenv) — jointly determine whether a population adapts or melts down under the extended Fisher's Theorem: d(m̄)/dt ≈ Var(m) + μ·Eg[s]·b̄. Getting these parameters right is essential for predicting a population's evolutionary fate.

1. Head-to-Head Posterior Comparison

Posterior comparison across all methods
Figure 1: Overlaid marginal posteriors from all inference methods. Each panel shows one of the five mutation-selection parameters, with histograms from ABC-SMC (blue), BSL (orange), NPE (green), and SNPE (purple). Red dashed lines mark the true values used to generate the synthetic fitness trajectory.

How to read this figure:
Biological interpretation for each parameter:
MethodStrengthsBest biological use case
ABC-SMCWell-established, PyMC ecosystemInitial parameter exploration with limited compute
BSLProper MCMC diagnostics, no epsilonPublication-quality estimates with uncertainty
NPE (amortized)Instant posteriors after trainingParameter space mapping across many conditions
SNPE (sequential)Tighter posteriors, fewer simsPrecise estimation for a single population
NREEnables model comparison via Bayes factorsTesting additive vs. epistatic fitness models

2. Parameter Space: Selection vs. Meltdown Boundary

Parameter space mapping
Figure 2: The mutation-selection phase boundary — the central scientific result. A 20×20 grid scans mutation rate (μ) vs. DFE scale (γscale), running 5 replicate simulations per grid point (2,000 total simulations). This map reveals the fundamental structure of the Basener-Sanford mutation-selection landscape.

Left panel — Net fitness change over 200 generations:
Right panel — Discrete regime classification: The sharp transition from green to red confirms that the phase boundary is a genuine feature of the model, not a gradual continuum. Populations are either above or below the critical threshold, with a narrow transitional zone between.
Biological Significance: Tying It All Together

The parameter space map above is the culmination of this entire notebook series. It answers the question that Basener & Sanford (2018) raised with their extension of Fisher's Fundamental Theorem: under what conditions does natural selection maintain population fitness, and under what conditions does mutational meltdown occur?

The extended FTNS gives the theoretical answer: fitness increases when Var(m) > μ·|Eg[s]|·b̄ and decreases when the inequality is reversed. The parameter space map provides the computational answer, showing exactly where this transition occurs across realistic ranges of mutation rate and DFE scale.

Why Bayesian inference matters here: The theoretical condition involves population-level quantities (fitness variance, mean birth rate) that are difficult to measure directly. But the five parameters we infer — μ, γshape, γscale, pbeneficial, σenv — determine these quantities. By inferring the parameters from an observed fitness trajectory, we can place a population on this map and determine probabilistically whether it sits in the selection-dominated or meltdown-dominated regime.

The role of each inference method:
Together, these methods transform the Basener-Sanford model from a theoretical framework into a quantitative tool for analyzing real populations — one that provides not just point estimates but full probability distributions over the parameters that determine evolutionary fate.