Figures
Abstract
High-throughput experimental platforms now routinely generate data from dozens or hundreds of independent observations. Simulation-based inference (SBI) offers a powerful framework for estimating model parameters from such complex datasets, but standard methods struggle to scale to the noisy multiple-replicates regime without incurring prohibitive computational costs or careful hyperparameter tuning. Here, we introduce a new method for fast and robust collective posterior inference from multiple independent replicates using a robust product-of-experts aggregation scheme that automatically mitigates the influence of outliers. Evaluating it on synthetic and empirical evolutionary datasets, we find it achieves state-of-the-art estimation accuracy and computational efficiency, including inference from noisy observations. Our method is compatible with any SBI framework, providing a scalable, plug-and-play solution for inference from noisy multiple-replicate datasets.
Author summary
Many biological studies rely on repeated experiments to capture natural variation and reduce uncertainty. However, replicate measurements often exhibit higher variance than standard models predict due to biological heterogeneity, batch effects, or faulty samples. This discrepancy makes it difficult to draw reliable conclusions or report uncertainty in a principled manner. In this study, we introduce a straightforward method for aggregating evidence across multiple replicates to estimate a single, well-calibrated probability distribution over model parameters. By first inferring the implications of each replicate independently and then combining them using an outlier-robust framework, we ensure that a few problematic samples do not skew the final result. Our approach is broadly applicable to various computational inference methods. We demonstrate its utility using simulated evolutionary data, experimental evolution time series in yeast, and cultural transmission datasets of bird song, providing a robust pathway for reliable inference from high-variability biological data.
Citation: Ben Nun N, Rosset S, Gresham D, Ram Y (2026) Collective posterior inference from highly variable empirical replicates. PLoS Comput Biol 22(8): e1014534. https://doi.org/10.1371/journal.pcbi.1014534
Editor: Raymond Louie, University of New South Wales, AUSTRALIA
Received: February 1, 2026; Accepted: July 5, 2026; Published: August 11, 2026
Copyright: © 2026 Ben Nun et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: We use the Python package sbi (Tejero-Cantero et al. 2020) for rejection-ABC (MCABC in sbi), Neural Posterior Estimation (NPE), inference from multiple replicates with permutation-invariant embedding (NPE+PIE), and neural posterior score estimation (NPSE). We implemented the collective posterior in Python with PyTorch. For benchmarking using the GLU and the SLCP simulator, we used the sbibm package (Lueckmann et al., 2021). All source code is available on GitHub at https://github.com/yoavram-lab/collective_posterior. Empirical data is publicly available from previous studies (Lachlan et al., 2018; Chuong et al., 2025).
Funding: This work was supported in part by the US–Israel Binational Science Foundation (2021276 to YR & DG; did not play a role), Minerva Center for Live Emulation of Evolution in the Lab (to YR; did not play a role), and fellowships from the Edmond J. Safra Center for Bioinformatics at Tel Aviv University (to NBN; did not play a role) and the AI and Data Science Center at Tel Aviv University (to NBN; did not play a role). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Competing interests: The authors have declared that no competing interests exist.
1. Introduction
Bayesian inference from multiple replicates
Many biological studies aim to infer parameters of a generative model from data while quantifying uncertainty. In a Bayesian framework, this uncertainty is captured by a posterior distribution over model parameters conditioned on the data. Increasingly, experiments produce multiple replicates collected under the same protocol and intended to reflect a shared underlying process. Here, a replicate is one observation (possibly multivariate, e.g., time series of genotype frequencies); multiple replicates are a set of replicates assumed to be conditionally independent given the model parameters, that is, independent draws from the same generative model with shared parameter values.
In practice, however, departures from this assumption are common: technical replicates can differ due to variability in experimental procedures and batch effects [1–3], biological replicates capture heterogeneity across individuals or populations [4,5], and faulty or mislabeled samples can introduce additional inconsistencies. The central problem we address here is how to construct a posterior distribution that reflects the shared signal from multiple replicates while remaining robust to departures from the assumed generative model.
Simulation-based inference
Classical Bayesian inference requires an explicit likelihood function that specifies the probability of the data given the model parameters. For many scientific models, however, this likelihood is intractable [6–10]. To address this, simulation-based inference (SBI; also likelihood-free inference) is often used. Initially developed to study human evolution [11,12], SBI has been adopted across various scientific domains, including experimental evolution [13–15], economics [16,17], epidemiology [18,19], and astronomy [20–22].
The simplest SBI method is Rejection-Approximate Bayesian Computation (rejection-ABC) [23]. Given a set of empirical observations, the analyst defines (i) a (stochastic) generative model, implemented via a simulator, that maps parameters to a synthetic observation; (ii) a prior distribution over the model parameters; (iii) summary statistics of observations; (iv) a function that measures similarity between two summary statistics; and (v) a similarity threshold. Parameter values drawn from the prior are accepted as posterior samples if, when used to run the simulator, they generate a synthetic observation whose summary statistics are within the similarity threshold of the empirical summary statistics. More efficient ABC variants, such as MCMC-ABC and SMC-ABC, improve sample efficiency by adaptively exploring the parameter space and reducing the number of required simulations.
More recently, neural density estimators – artificial neural networks that approximate complex probability distributions – have been integrated with SBI [24]. For example, in Neural Posterior Estimation (NPE) [25,26], a training set is generated by sampling parameters from the prior distribution and using a simulator to produce corresponding synthetic observations. A neural density estimator—an artificial neural network that outputs the parameters of a flexible conditional density—is then trained on parameter-observation pairs to learn an approximation to the posterior distribution. Once trained, the estimator can be conditioned on real observations to approximate the posterior distribution, enabling posterior evaluation at specific parameter values and efficient posterior sampling. However, these methods are typically designed to condition on a single replicate, whereas many experimental designs collect multiple replicates to capture biological variability and to overcome technical measurement error.
SBI with multiple replicates
Although SBI is widely used, comparatively few methods directly target posterior inference from multiple replicates. With an explicit likelihood, the posterior conditioned on all replicates is obtained by factoring the likelihood across replicates and combining it with the prior. In likelihood-free settings, this route is unavailable, and conditioning on multiple replicates is less straightforward.
A direct strategy is to explicitly model the full hierarchical data-generating process and concatenate the replicates into a single “super observation” vector, followed by inference on the global parameters from this high-dimensional input. However, posterior estimation generally becomes harder as the dimensionality of the data increases (curse of dimensionality), both for neural and non-neural density estimators [26–28]. Consistent with this, Avecilla et al. [29] found that concatenating replicates reduced inference accuracy when estimating selection coefficients from evolutionary experiments.
Several recent approaches extend SBI to inference from multiple replicates. We categorize these methods by their mechanism for aggregating information and their specific limitations in terms of computational efficiency and model flexibility.
Embedding-based approaches (NPE + PIE)
This approach is inspired by exchangeable neural-network architectures [30,31] and implemented in the sbi framework [32]. A permutation-invariant embedding (PIE) network learns embeddings for single replicates and then performs a permutation-invariant aggregation (e.g., mean or sum) on these embeddings. The aggregated embedding serves as input to the density estimator. In a recent practical guide to SBI [33], NPE + PIE was highlighted as an approach for neural posterior estimation from multiple replicates.
Training of NPE + PIE requires a large training set, because the PIE network and the density estimator are trained together on randomly constructed subsets of replicates. Furthermore, it enforces a rigid simulation structure: to learn the embeddings, the training data must capture the variance of the simulator for fixed parameters, often requiring batches of replicates for every θ rather than independent (x, θ) pairs.
Hierarchical inference approaches
Hierarchical NPE (HNPE) explicitly models the hierarchical data-generating process [34]. It learns separate estimators for replicate-specific and shared parameters, allowing it to disentangle sources of variation. However, like NPE + PIE, HNPE requires specialized, hierarchical neural architectures and relies on the simulator’s ability to generate data with a specific hierarchical structure, which limits its applicability to generic simulators and noise structures. It also imposes a significant simulation burden, as the network learns not just the shared parameters but also the distribution of replicate-specific latent parameters, requiring a large dataset for every training example to characterize the hierarchical structure.
Another hierarchical approach assumes that each replicate has its own latent parameters, which are sampled from a shared distribution [35], as in standard random-effects models. Replicate-specific posteriors are amortized with conditional normalizing flows, and inference over the parameters of the shared distribution combines a mixed-effect model with Monte Carlo sampling from these learned individual posteriors. The second step can be slow, especially when replicates are noisy, and the replicate-specific posteriors are broad, requiring many samples for stable estimates.
Hierarchical posterior aggregation under conditional independence has also been explored in cosmology. For example, Leyde et al. [36] applied neural posterior estimation to hierarchical gravitational-wave population inference, combining information from multiple independent observations through sequential recombination of sub-population analyses. In contrast, our work focuses specifically on robustness to replicate heterogeneity, outliers, and posterior density pathologies in noisy biological replicate datasets.
Our approach is also conceptually related to divide-and-conquer Bayesian inference methods developed for scalable posterior inference on large datasets, including consensus Monte Carlo [37] and median-based posterior aggregation methods [38]. These approaches partition a large dataset into subsets, perform inference independently on each subset, and then combine the resulting subset posteriors. However, their primary goal is computational scalability in distributed settings, whereas our setting focuses on aggregating naturally distinct empirical replicates that may exhibit excess variability or model misspecification. In particular, consensus Monte Carlo methods typically combine subset posteriors through averaging or weighted aggregation, while Minsker et al. proposed a geometric median aggregation for robustness to corrupted subsets. Our approach instead uses a robust product-of-experts formulation with a density floor, designed specifically for simulation-based inference from multiple noisy replicates and compatible with amortized neural posterior estimators.
Score-based and diffusion approaches
Recent studies have adapted score-based generative models to the multiple-replicate setting [39–41]. These approaches typically learn the gradient of the log-posterior (the score) or a flow-matching objective conditioned on single replicates. While highly accurate, they introduce significant inference complexity. Methods like NPSE [39,40] rely on iterative Langevin dynamics, requiring hundreds of network evaluations per sample. Similarly, the recent flow-matching approach of Arruda et al. [41] requires careful differential equation solver scheduling and error damping to avoid numerical instabilities during the integration of the flow.
Our contribution
Here, we propose a novel method for simple and flexible inference from multiple replicates, the collective posterior, that combines posteriors conditioned on individual replicates into a single posterior conditioned on the full dataset. Unlike existing SBI pipelines, our method allows that some replicates may not have been generated by the same generative model as the others; the method can downweight or even effectively ignore replicates whose individual posteriors are inconsistent with the dominant generative model. This feature is crucial in applied settings: empirical datasets routinely include faulty measurements, mislabeled samples, or biological outliers that pass standard quality-control filters but distort inference if treated on equal footing with the rest of the data. Our method yields posterior estimates that remain stable in the presence of such aberrant observations, providing a principled safeguard against the bias these observations can introduce. The collective posterior is general and integrates with existing Bayesian inference frameworks, from rejection-ABC to neural SBI, and also with likelihood-based inference. We demonstrate the collective posterior on several simulation-based inference tasks, using both rejection-ABC and NPE as individual posterior estimators, and compare it to a prominent existing approach, NPE + PIE. We also applied it to quantify how genetic background affects the evolutionary dynamics of GAP1 copy-number variants (CNVs) [42] and CNV stability [43] in Saccharomyces cerevisiae.
2. Methods
Existing methods
Rejection-ABC.
Rejection-Approximate Bayesian Computation [23] is a simple SBI method. It includes the following steps: i) Sample parameter proposals from the prior distribution, θi∼p(θ). ii) Simulate synthetic data, xi ~ f(θi), where f is a simulator that generates data from the intractable likelihood, p(x|θ). iii) Compute summary statistics for the synthetic data, s(xi), and empirical data, s(xo). iv) Accept proposal θi if d(s(xo),s(xi)) ≤ ε, where d(⋅,⋅) is a dissimilarity function and ε is a dissimilarity threshold. v) Repeat until enough proposals are accepted. With sufficient summary statistics and ε → 0, the distribution of accepted parameters converges to p(θ|xo). This approach can be easily parallelized but can suffer from low acceptance rates (and therefore low computational efficiency) when the prior and posterior distributions have a small overlap, when the number of parameters is large, and when ε is small.
Neural Posterior Estimation (NPE).
A prominent example of SBI with neural density estimation is Neural Posterior Estimation [25,26]. NPE directly approximates the posterior density of model parameters conditioned on an observation, p(θ|x) (S1A Fig). The neural conditional density estimator qφ(θ|x) (parameterized by φ) is trained to approximate p(θ|x): a training set of pairs (θi, xi) is generated by sampling parameters from the prior, θi ~ p(θ), and simulating observations, xi ~ f(θi); then gradient-based optimization is used to find φ* that maximizes Σilog(qφ(θi|xi)). This yields an amortized posterior estimator, qφ*(θ|x), which, when conditioned on a specific observation xo, provides qφ*(θ|xo)≈p(θ|xo). Importantly, once trained, evaluating the posterior estimator qφ* on a new observation xo does not require additional training or simulation, in contrast to sampling methods such as rejection-ABC, which require additional simulations to infer the posterior distribution for every new observation. The neural density estimator can be implemented by a normalizing flow, which provides a general way of constructing flexible probability distributions over continuous random variables [44]. Our previous studies [29,45] demonstrated that NPE infers more accurate and confident posterior distributions from evolutionary experimental data than popular sampling-based Bayesian inference methods (rejection-ABC and SMC-ABC [46]).
Neural Posterior Score Estimation (NPSE).
Recent studies on SBI from independently and identically distributed (i.i.d.) observations have introduced score-based models for improved accuracy of SBI [39–41]. While their results are promising, we did not observe any advantage in using NPSE over NPE for our empirical data (S6 Fig). We therefore proceeded with NPE as the neural SBI method for individual posterior estimation. For tasks where NPSE is better at individual posterior estimation, our method can be applied using NPSE as the individual posterior estimator, or by leveraging NPSE’s i.i.d. formulation [39,40].
Collective posterior distribution
Standard collective posterior distribution.
Assuming that multiple replicates {xi}ni=1 are independent conditioned on the model parameters, θ, that is, p(xi,xj|θ) = p(xi|θ)p(xj|θ), we can compute the collective posterior distribution of model parameters conditioned on all replicates, p(θ|x1,…,xn), from individual posterior distributions, p(θ|xi), and the shared prior distribution, p(θ), by applying Bayes’ theorem twice (a full derivation is available in S1 Text),
Robust posterior distribution.
Posterior distribution approximation in SBI, while accurate in the high posterior density region (HDR), tends to be uncalibrated in low-density regions, sometimes producing erratic posterior density values (S3 Table). To mitigate this, we introduce a robust individual posterior distribution,
We combine these robust individual posterior distributions into a robust collective posterior distribution,
For ε → 0, we have pε(θ|xi)→p(θ|xi) and pε(θ| x1,…,xn)→p(θ|x1,…,xn). High values of ε will focus only on high-density regions of the individual posterior distributions, overfitting to a given replicate set. An optimal choice of ε balances robustness to outliers with accurate parameter inference (Fig 1).
(A) First, we are given a set of independent empirical replicates (e.g., time series; blue), possibly including outliers. (B) A density estimator infers replicate-specific posterior distributions (blue). (C) The naïve solution would combine the individual posterior distributions to form a collective posterior conditioned on the full replicate set (grey). (D) Instead, we use the ε-flooring to form a robust collective posterior distribution (red). (E) Finally, posterior predictive checks assess whether collective-posterior predictions (red) reproduce the empirical distribution of time series across replicates (blue), including between-replicate variability.
Sampling from the robust collective posterior distribution.
To sample from the collective posterior (Eq. 3), we implemented and compared three distinct sampling strategies. Based on the trade-off between computational efficiency and approximation accuracy, Sampling Importance Resampling (SIR) was selected as the primary method for the results presented in this study. The other strategies are detailed in the supporting information (S1 Text).
Sampling Importance Resampling (SIR).
To efficiently approximate the collective posterior without relying on sequential chains (i.e., MCMC), we used an SIR scheme [47]. We used the prior distribution p(θ) as the proposal distribution to ensure robust coverage of the parameter space while not relying on the sampling efficiency of the individual posterior distribution. Importance weights were calculated as the ratio of the unnormalized robust collective posterior density to the prior density. To counteract the artificial variance reduction inherent in the product-of-experts aggregation, where multiplying independent densities shrinks the variance, we used an adaptive temperature scaling to the importance weights. This temperature was determined via binary search to maintain a target effective sample size (ESS), preventing weight collapse as the number of replicates increased. Then, at resampling, we applied Gaussian jittering to the results. This vectorized approach enabled rapid, high-throughput posterior approximation. While practical and accurate, our SIR scheme is designed for high-performance approximation rather than the asymptotic sampling guarantees of MCMC.
Test cases
Synthetic evolutionary data.
Consider a Wright–Fisher model of a haploid population of fixed size N = 104 with three bi-allelic loci. The eight genotypes are represented by a bit-string (b1,b2,b3)∈{0,1}3, with the population initialized as all wild type, (0,0,0). Genotype fitness is multiplicative: the presence of a mutant allele 1 contributes a fitness factor 1 + si, so the fitness of genotype g = (b1,b2,b3) is ∏3i=1[(1 + si)bi].
Mutation is independent across loci. By default, we allow only forward mutation 0 → 1 with per-locus rates μ1, μ2, μ3, so that mutation is applied by an 8 × 8 transition matrix M, where M[g,h] is the probability of mutation from genotype g to genotype h; this probability factorizes across loci by the mutation rates. Genetic drift arises from multinomial sampling given the expected genotype frequencies after mutation and selection.
We simulate the model for 1,000 generations, and we record allele (rather than genotype) frequencies every 100 generations. The simulator returns the time points and three allele-frequency time series as a single 30-dimensional vector, which is used as a single replicate.
For testing, we generate a dataset of 200 observations, each consisting of 10 replicates (Fig 2). The intrinsic stochasticity of this model produces substantial variance among replicates. However, to better resemble real datasets, we further contaminate the data: of the 10 replicates, seven replicates correspond to simulations using parameters perturbed by additive Gaussian noise sampled from N(0, 0.1), mimicking biological variability through a hierarchical process. The remaining three are simulations of the same parameters, perturbed by a large additive Gaussian noise sampled from N(0,1), which introduces outlier observations to the dataset. Finally, to simulate measurement error, we perturb each observation with heteroscedastic Gaussian noise, where the standard deviation is set to 10% of the observed value (σ = 0.1 ⋅ xo). Overall, this design aims to mimic empirical datasets, which are inherently noisy due to both stochastic and measurement variability. We found that introducing these perturbations produces datasets that closely resemble experimental observations in their variability and structure (S4 Fig).
(A-C) Synthetic replicate sets. Each test instance comprises n = 10 Wright-Fisher replicate time series simulated with shared parameters, θ (A, Clean). To introduce between-replicate heterogeneity, we generate 7 replicates using parameters perturbed by moderate Gaussian noise and 3 replicates using parameters perturbed by larger Gaussian noise (B, Hierarchical). Finally, we add measurement noise to the time series (C, Noisy). (D) Coverage. For each nominal confidence level α, we compute the empirical coverage Pr[θi ∈ HDRα] of per-parameter highest-density regions (ideal: diagonal). The collective posterior achieved consistently better coverage (closer to the diagonal) than NPE + PIE, indicating less overconfidence. (E-J) Accuracy. Distributions of per-parameter estimation errors (defined as the log-ratio of the posterior mean and true value). Across parameters, the collective posterior is more tightly centered around zero, indicating more accurate inference.
Empirical evolutionary datasets.
We consider our recent study [42] in which we inferred the parameters of a Wright-Fisher model from experimental evolutionary data. The data are time series of the proportions of cells with more than one copy of the GAP1 gene in haploid yeast populations (4 different genotypes, 27 time series in total) in a glutamine-limited environment over 116 generations. By inserting a green fluorescent protein (GFP) next to GAP1, the CNV proportion was monitored throughout the experiment using flow cytometry [48]. The inference task involves estimating three parameters: the selection coefficient s of GAP1 duplications, its formation rate δ, and its initial undetectable frequency φ, which is non-zero due to cells with non-GFP GAP1 duplications in the founder population. The evolutionary model includes four genotypes: WT, with an initial proportion X0WT = 1-φ and fitness of wWT = 1; C-, representing cells with GAP1 duplications that formed before the fluorescent reporter insertion (thus undetectable throughout the experiment), with an initial proportion X0C- = φ and fitness of wC- = 1 + s; C+, representing cells with GAP1 duplications that formed after reporter insertion, with an initial proportion X0C+ = 0 and fitness wC+ = 1 + s; and B, representing other beneficial genotypes, with initial proportion X0B = 0 and fitness wB = 1.001. At generation , mutations occur with rates δ from WT to C+ and μ = 10-5 from WT to B, so that the change in the genotype frequencies is described by
Then, genotype frequencies Xi’ change following their associated fitness wi,
Finally, frequencies change due to random genetic drift,
The effective population size in the chemostats was estimated to be Ne = 3.3 × 108 [29]. Here, we use a lower value of Ne = 107 for training and testing the neural density estimator to increase the variance between observations, posing a more difficult inference challenge. Our main analyses focus on the empirical evolutionary data, and we also benchmarked performance on synthetic datasets by simulating 500 observations, each consisting of 10 replicates (see SI for results).
Swamp sparrow song dataset.
Lachlan et al., 2018 [5] analyzed song patterns from six geographically distinct swamp sparrows (Melospiza georgiana) populations to infer the parameters of a cultural evolutionary model of syllables transmission: μ, mutation rate per learning event; ν, variance of demonstrator/tutor bias; patt, proportion of syllable types that are attractive to learn; α, conformity bias; and Nt, number of potential demonstrators. Posterior inference was performed using Population Monte Carlo ABC (PMC-ABC). The authors computed 13 summary statistics per population, applied partial least squares (PLS) regression for dimension reduction, and then ran PMC-ABC on the resulting PLS features with decreasing acceptance threshold.
Using the published simulations output, we constructed population-specific posteriors by selecting, for each population, the 100 simulations most similar to the empirical PLS features (Euclidean distance) and fitting a kernel density estimator (KDE) to corresponding accepted parameter values. We then combined the six KDE-based posteriors into a collective posterior distribution using our method. For comparison, we also reconstructed the single posterior corresponding to conditioning on the mean empirical PLS feature vector across populations, as in Lachlan et al. [5]. Conditioning on the mean feature vector is a common ABC strategy for multi-replicate data, but it removes information about between-replicate variation.
SBI benchmarks.
We also test our method on two common simulation-based inference benchmarks [27]: Gaussian Linear Uniform (GLU), where the prior θ ~ U[-1,1]10 and data points are drawn from a multivariate normal distribution such that y ~ MVN(θ, Σ = 0.1⊙I); and Simple Likelihood Complex Posterior (SLCP), which presents a more challenging simulation-based inference task. The prior is θ ~ U[-3,3]5, and the observations are sets of four two-dimensional points sampled from a normal distribution whose mean and variance are nonlinear functions of θ. The resulting posterior has four symmetrical modalities and vertical cut-offs, making parameter inference particularly challenging.
In previous studies, experimental limitations in biological settings restricted the number of empirical replicates to between three and eight [5,29,42,43,45]. However, serial dilution plates are typically designed to facilitate experiments with up to 12–96 replicates. Therefore, we chose n = 10 replicates per observation set as a balanced compromise.
Evaluation metrics with synthetic data.
We assess the estimation accuracy of the inferred posterior by computing the log-ratio of the posterior mean and the true parameter value. To evaluate estimation uncertainty, we use coverage [49], defined as the probability that the true parameter is within an HDR of level α, P(θtrue∈HDRα), for α = 0.1, 0.2, …, 0.9, 0.95. A perfectly calibrated posterior would obtain P(θtrue∈HDRα)=α. While recent studies focus on the local classifier 2-sample test [50], we believe that the marginal metrics of accuracy and coverage better reflect the computational biologist’s needs from SBI. First, biological research is typically parameter-centric. Marginal metrics allow us to disentangle performance across distinct biological processes, verifying that key parameters are estimated reliably even if high-order correlations are imperfect. Global metrics like LC2ST compress this complexity into a single score, obscuring the specific sources of error. Second, calculating LC2ST requires training a separate classifier for every test observation, which becomes computationally prohibitive when validating performance across hundreds or thousands of synthetic multi-dimensional observations. In contrast, marginal accuracy and coverage can be efficiently computed, enabling us to perform high-throughput validation.
Evaluation metrics with empirical data.
To assess whether each method produced calibrated predictions for the empirical trajectories, we computed its posterior predictive coverage [51]. For each dataset and inference method, we drew parameter samples from the inferred posterior and simulated frequency trajectories with these parameter samples. At each nominal coverage level α∈{0.1, 0.2,…, 0.9, 0.95}, we formed central posterior predictive intervals by taking the (1-α)/2 and (1 + α)/2 quantiles of the simulated trajectories at each generation. We then computed the fraction of empirical observations that fell within these intervals. A calibrated posterior predictive distribution should have empirical coverage close to the nominal level. We summarized calibration error as the mean absolute deviation between empirical and nominal coverage across all nominal levels. We plotted 1-MAE as a coverage score, where larger values indicate better predictive calibration. To quantify whether posterior estimates were stable, we used an inference cycle [52,53]: first, we inferred the posterior distribution conditioned on the empirical data (5–8 replicates). Then, we used 10 samples from the posterior distribution to simulate a synthetic dataset of 10 replicates. We inferred a posterior distribution conditioned on the synthetic dataset and compared it to the original posterior (conditioned on the empirical data). For each parameter, we computed the overlapping coefficient (Weitzman’s Δ, or OVL) [54] between the marginal posterior distributions, OVL(p, q) = ∫min[p(θ), q(θ)] dθ, where p is the original posterior marginal and q is the inference-cycle posterior marginal. The OVL ranges from 0 to 1, with 0 indicating no overlap and 1 indicating identical marginal distributions. In practice, we estimated the OVL from posterior samples by binning both sample sets on the same parameter range, normalizing the bin counts to probability masses, and summing the minimum probability mass in each bin. We report the mean OVL across parameters as a metric for inference-cycle stability, where larger values indicate greater agreement between the original and cycle posteriors.
Hyperparameter tuning.
Our implementation of the robust collective posterior distribution with SIR sampling includes a single hyperparameter: ε, the lower bound density of the robust individual posterior distribution, pε(θ|xi). Based on our experiments, as long as the simulator and inference method do not change, the same value of ε remains useful, i.e., leads to both accurate inference and robustness to outliers. To avoid arbitrary selection, we derived a global and adaptive data-driven heuristics based on the dynamic range of the neural density estimator. First, we defined the baseline uninformative posterior density by drawing independent pairs of parameters and observations (θ,x) from the prior, p(θ), and the simulator, p(x|θ), respectively, and computing their posterior densities, p(θ|x), with the neural density estimator. A high (e.g., 95th) percentile of these densities represents the highest density the estimator assigns to a random pair (θ,x). Setting ε to the chosen percentile imposes a lower bound on the posterior density, ensuring that outlier observations are assigned a minimal weight in the collective posterior. While this heuristic shifts the hyperparameter selection from a raw density value to a percentile, the latter is more interpretable and stable across different tasks, as it scales naturally with the estimator’s dynamic posterior density range. This prevents outliers from disproportionately collapsing the collective posterior. We applied this approach to the synthetic benchmarks presented in the Results section. Second, in empirical applications, measurement noise and model misspecification (the simulation-to-reality gap) often cause the estimator to assign systematically lower posterior densities to empirical data compared to synthetic training data. To account for this shift, we propose an alternative estimation method. Here, ε is calculated specifically for each replicate set {xi}i by evaluating the posterior densities of a batch of parameters {θj}j sampled from the prior, p(θ), conditioned on the replicates, {p(θj|xi)}i,j. ε is then set to a chosen percentile of these posterior densities. Crucially, this estimation of ε remains independent of the number of replicates N, because it is based on the assigned posterior densities given to individual observations. This calibrates the minimum posterior density to the specific experimental conditions, ensuring robustness even when the overall posterior densities are shifted due to model misspecification.
Data and code availability
We use the Python package sbi (Tejero-Cantero et al. 2020) for rejection-ABC (MCABC in sbi), Neural Posterior Estimation (NPE), inference from multiple replicates with permutation-invariant embedding (NPE + PIE), and neural posterior score estimation (NPSE). We implemented the collective posterior in Python with PyTorch. For benchmarking using the GLU and the SLCP simulator, we used the sbibm package [27]. All source code is available on GitHub at https://github.com/yoavram-lab/collective_posterior. Empirical data is publicly available from previous studies [5,42].
3. Results
Synthetic data from evolutionary simulations
We evaluated the collective posterior and NPE + PIE (an established approach for inference from multiple replicates [33]) on the synthetic benchmark to assess posterior accuracy and calibration. The collective posterior achieved substantially improved empirical coverage across confidence levels (Fig 2D): coverage closely followed the nominal level, indicating well-calibrated uncertainty estimates, whereas NPE + PIE and NPSE showed systematic under-coverage, consistent with overconfident posteriors (credible intervals that are too narrow). Across parameters (Fig 2E–2J), the collective posterior yielded errors that were more tightly concentrated around zero, indicating higher accuracy and tighter posteriors around the true parameter values. Overall, the collective posterior produced more accurate and better-calibrated posterior estimates than NPE + PIE and NPSE on this benchmark.
Empirical data from evolutionary experiments
We next analyzed four empirical datasets from Chuong et al. (2025). Each dataset contains 5–8 experimental replicates of the same genotype (wildtype or one of three mutants). We generated 30,000 noisy Wright-Fisher simulations for training, adding Gaussian noise N(0,0.02) to the simulated time series. Using NPE as the replicate-level posterior estimator, the collective posterior produced accurate posterior predictive timeseries across datasets (Fig 3). In addition, it achieved the best predictive coverage score on all four datasets (Fig 3C) and consistently produced stable posterior distributions (Fig 3D). NPSE performs similarly well (and maybe better) in terms of stability, however was significantly less calibrated to the empirical datasets. NPE + PIE yielded inaccurate posterior predictive timeseries for two of the four datasets (Fig 3A and 3B). The collective posterior is also the most computationally efficient method: NPE training was 10-fold faster than NPE + PIE with n = 10; NPSE inference time is 100-fold slower than the collective posterior (S1 Table).
(A-D) For each of the four datasets from Chuong et al. (2025), which follow the evolution of copy number variants (CNV) in yeast populations, we simulate 50 time series using parameter sets sampled from the collective posterior with NPE (red), NPE + PIE (blue), and NPSE (yellow), and compare them to the empirical replicates (grey). The collective posterior more closely captures the observed between-replicate variability. Here, ε is estimated separately for each replicate set. (E) Predictive coverage, i.e., the deviation from ideal prediction-to-data calibration. (F) Inference stability, i.e., the overlap between the estimated posteriors (from empirical vs. synthetic data).
Furthermore, applying collective posterior inference with rejection-ABC (rather than NPE) as the replicate-level posterior estimator to the most challenging dataset (Fig 3B) produced MAP estimates similar to those obtained with NPE (S2 Fig), providing an additional cross-check of our method.
Robustness to outliers
Empirical replicate datasets often show greater dispersion than simulations, and replicates that pass standard outlier checks still induce anomalous inference. In its default form (Eq. 1), the collective posterior can be influenced by such outlier replicates. We therefore use a robust posterior formulation that enforces a minimum per-replicate posterior density ε (Eq. 2). Fig 4 illustrates the effect on one dataset from Chuong et al. (2025): with an extremely small floor (ε = e-1000), the collective posterior is dominated by a single outlier replicate. Increasing the floor to ε = e-10 yields a collective posterior that aligns with the high-density overlap of the replicate-specific posteriors and substantially improves posterior predictive checks (Fig 4).
(A-B) Inferred posteriors for the dataset in Fig 3D under two choices of the minimum-density parameter ε. With log(ε) = -1000, the collective posterior (red) is dominated by an outlying replicate; with log(ε) = -10, the collective posterior (red) shifts toward the region of overlap among replicate-specific posteriors (grey). (C-D) Posterior predictive checks: empirical replicate time series (grey) and 200 simulations from parameter draws from the collective posteriors (red), showing improved agreement with the between-replicate variability under the higher ε setting.
Dependence on ε and the number of replicates N
Ideally, we would select an ε that achieves optimal performance. However, identifying an ε that simultaneously balances accuracy and calibration is computationally demanding and can only be rigorously validated on synthetic datasets. We empirically evaluated our percentile-based estimation approach on the evolutionary benchmark. Importantly, the estimation of ε is independent of the number of replicates in the dataset, since it relies on the densities of posteriors conditioned on individual observations (S19 Fig). Moreover, although increasing the number of replicates generally improves inference, the impact of ε on inference quality is both independent of N and substantially greater than the effect of increasing N (S20 Fig).
Swamp sparrow song dataset
We analyzed the swamp sparrow song dataset of Lachlan et al. [5], which comprises six geographically distinct populations treated as replicates. The goal is to infer five parameters of a cultural transmission model from the population-level summary statistics derived from recorded song repertoires, and to compare posterior inference based on combining replicate-specific evidence versus conditioning on summary statistics averaged across populations.
Using the published simulation output from Lachlan et al. [5], we reconstructed replicate-specific posteriors for each population by smoothing the accepted parameter sets with kernel density estimation. These replicate-specific posteriors were more concentrated and yielded lower discrepancies to the empirical summary statistics than the posterior obtained by conditioning on mean summary features across populations.
We then combined the six replicate-specific posteriors using the collective posterior. It assigned high density to regions of parameter space where the replicate-specific posteriors overlap, and low density where they disagree (Fig 5). In contrast, the mean-conditioned posterior of Lachlan et al. remains comparatively broad, assigning high density over a wider range and therefore more closely resembling the replicate-specific posteriors. The increased concentration of the collective posterior is analogous to a simple Gaussian product-of-experts case: the product of k identical Gaussian distributions N(μ,σ2) is proportional to a Gaussian with the same mean and reduced variance, . Our implementation exhibits this variance reduction, reflecting the degree of agreement among replicates. More generally, these results show that the collective posterior captures cross-replicate consensus by combining replicate-specific posteriors, rather than by first averaging their summary statistics and then performing inference on the aggregated data.
Grey curves show replicate-specific posteriors inferred separately for six populations. The purple curve reproduces the posterior from Lachlan et al. (2018), obtained by conditioning on summary statistics averaged across populations, which yields a comparatively broad posterior. The collective posterior (red) combines replicate-specific posteriors to emphasize parameter regions supported consistently across populations, producing a sharper posterior for parameters with strong cross-population agreement (e.g., ν and μ).
SBI benchmarks
We next evaluated the collective posterior on two standard SBI benchmarks (GLU and SLCP), using NPE as the replicate-level posterior estimator, and compared it to NPE + PIE. Across both benchmarks, the collective posterior was comparable to NPE + PIE, and in some cases, more closely centered on the true parameter values. For GLU, where averaging replicates is informative because the mean of the replicates concentrates around the truth, the collective posterior achieved higher accuracy and better calibration (S8 Fig). For SLCP, performance was similar overall, with improved accuracy for one parameter (S9 Fig). Together, these benchmark results are consistent with the patterns observed in the empirical datasets.
4. Discussion
Taken together, our results show that collective posterior inference is more accurate and better calibrated than NPE + PIE across tasks we considered, including three synthetic benchmarks and one empirical dataset. In our analyses, it required significantly less training than NPE + PIE while remaining compatible with a wide range of replicate-level posterior estimators.
Based on our findings, as well as related results in the literature [35,39–41], we conclude that combining replicate-specific posteriors can be advantageous relative to directly learning a single multi-replicate posterior, particularly when replicate-to-replicate variability and departures from the assumed generative model are non-negligible. A central difficulty in inference from multiple replicates is accommodating variability that exceeds what is expected under the model’s intrinsic stochasticity. Such excess between-replicate variance can arise from unmodeled hierarchical structure, technical effects, or other sources of heterogeneity not captured by the simulator. We show that, even in the presence of such excess variance, collective posterior inference can still yield accurate and well-calibrated posteriors.
The collective inference approach is method-agnostic: it can be combined with any replicate-level posterior estimator to perform inference from multiple replicates. A key feature is its robustness to outliers: during aggregation, the method can downweight or effectively ignore idiosyncratic replicates without requiring explicit outlier detection (Fig 4). On synthetic benchmarks, the collective posterior paired with NPE matched or outperformed NPE + PIE, even though both approaches use the same NPE posterior estimator and differ primarily in how replicate information is incorporated (aggregation of replicate-level posteriors versus set-conditions via permutation-invariant embeddings).
In our setting, the motivating failure mode occurs when empirical replicates differ more than predicted by the simulator due to batch effects, biological heterogeneity, or the simulation-to-reality gap. This discrepancy can be viewed as a form of model misspecification. Under misspecification, standard product aggregation, which conditions on all replicates assuming they are independent and identically distributed (i.i.d.), can become highly unstable. This instability arises because posterior inference for a single replicate focuses heavily on accurately estimating high-density regions, leaving tail estimates potentially inaccurate and noisy. While the distinction between different extreme low densities is practically irrelevant for a single replicate, it becomes catastrophic during product aggregation when replicates disagree on where the high-density regions lie. Because density estimators cannot reliably distinguish between these low-density values, a single conflicting replicate can effectively zero out parameter regions strongly supported by the rest. The ε-floor regularization introduced here directly resolves this by acting as a robustness mechanism, bounding the influence of these unreliable, low-density tail contributions during aggregation. This perspective connects our approach to broader robust Bayesian and simulation-based inference frameworks, including generalized Bayesian inference approaches that temper or modify likelihood contributions under model misspecification [55,56]. In contrast to these methods, our approach operates directly at the level of replicate-specific posterior aggregation and remains compatible with any posterior estimators and existing SBI methods without any modification.
We showed that collective posterior inference can accommodate biological variability and idiosyncratic replicates while preserving accurate parameter estimation. Because it operates by combining replicate-level posteriors, it is compatible with a broad range of likelihood-based and likelihood-free posterior estimators, including newer neural SBI methods. Moreover, unlike set-conditioning approaches that assume a fixed maximum number of replicates, the collective posterior naturally scales to varying numbers of replicates.
Finally, the collective posterior can also be applied to computational replicates, such as multiple independently trained neural posterior estimators, providing a “floor raising” alternative to standard ensembling. Whereas common ensembles (e.g., bagging or simple averaging) combine estimators by averaging their densities, yielding a broad union that retains between-run training variability (S18 Fig, blue), our robust product formulation (Eq. 3) aggregates estimators through an intersection-type operation that emphasizes regions where they agree. As a result, it attenuates run-to-run training variance and produces sharper posterior estimates that more directly reflect the consensus signal (S18 Fig, red).
Supporting information
S1 Fig. Simulation-based inference with Neural Density Estimation.
(A) Inference. Proposal parameters are sampled from a prior distribution and used for model simulations. These parameters and the corresponding simulation results are used as a training set for a neural density estimator, e.g., normalizing flow. The neural density estimator evaluates an observation, effectively approximating a joint posterior distribution of model parameters. Adapted from Cranmer, Brehmer, and Louppe, 2020 (1). (B) Evaluation. The trained neural density estimator is evaluated on synthetic observations for which the true parameters are known. By comparing the resulting posterior distributions to the true parameters, we estimate the accuracy of the sample mean (or another point estimate) and the coverage of the highest-density region (HDR).
https://doi.org/10.1371/journal.pcbi.1014534.s001
(TIF)
S2 Fig. The collective posterior distribution is similar, regardless of the individual inference framework.
(A-C) The collective posterior distribution from ABC concentrates around the NPE Maximum A-Posteriori (MAP). Individual posteriors of seven experimental replicates inferred for the Wright-Fisher model with rejection-ABC (purple, ,
simulations per observation) compared to the collective posterior distribution (red). Collective MAP estimates of NPE (3) are marked by the black dashed lines. (D) Collective posterior predictions agree with empirical data. Collective posterior predictions using Wright-Fisher simulations with 100 parameter sets sampled from the collective posterior distribution (thin red lines), from the mean of the collective posterior (bold red line), and empirical data (grey).
https://doi.org/10.1371/journal.pcbi.1014534.s002
(TIF)
S3 Fig. Collective posterior distributions from synthetic Wright-Fisher simulations.
(A-C). Accuracy. The difference between the sample mean and the true parameter. The median errors for the collective posterior distribution are 0.0144, -0.0354, and -0.0550 for , respectively. The median errors for NPE + PIE are 0.0492, -0.2277, and -0.0086, respectively. (D) Coverage. The probability that the true parameter is within the
of the estimated posterior, for
. Coverage is nearly identical for the two methods across all parameters and confidence levels, with a few minor exceptions.
https://doi.org/10.1371/journal.pcbi.1014534.s003
(TIF)
S4 Fig. Our noising scheme can lead to experimental-like variability.
Estimated parameters for the LTR genotype from Chuong et al. (2025) were simulated ten times using the standard WF simulator (regular) and using perturbations on
and Gaussian measurement noise. Empirical data is shown in grey.
https://doi.org/10.1371/journal.pcbi.1014534.s004
(TIF)
S5 Fig. Effect of
on inference.
We used (one MAP estimate from Chuong et al., 2025) for simulating 10 observations. Then, we simulated 2 outliers using
and
. Each column shows the marginal posterior distributions for the three model parameters using a different value of
, when inferring a collective posterior distribution from the 10 standard simulations (“No outliers”, blue) or the 12 mixed simulations (“With outliers”, red). Without outliers, inference is accurate for any
. With outliers, however, the standard collective posterior distribution (
) fails to infer the parameters accurately. Our implementation of the collective posterior distribution exhibits accurate inference with robustness to outliers for
.
https://doi.org/10.1371/journal.pcbi.1014534.s005
(TIF)
S6 Fig. Posterior predictive checks of NPE and NPSE on the empirical data.
Simulation of posterior sample mean from 100 samples. Both density estimators trained on 30,000 noisy WF simulations with their default hyperparameters.
https://doi.org/10.1371/journal.pcbi.1014534.s006
(TIF)
S7 Fig. Predictive coverage curve for Chuong et al., 2025 data.
The probability that the empirical data falls within the of the posterior predictive simulations, corresponding to confidence levels
.
https://doi.org/10.1371/journal.pcbi.1014534.s007
(TIF)
S8 Fig. The sample mean accuracy of the collective posterior and NPE + Permutation Invariant Embedding (PIE) for Gaussian Linear Uniform (GLU).
Subplots show for the ten estimated parameters.
https://doi.org/10.1371/journal.pcbi.1014534.s008
(TIF)
S9 Fig. The sample mean accuracy of the collective posterior (with rejection sampling) and NPE + Permutation Invariant Embedding (PIE, with rejection sampling) for Simple Likelihood Complex Posterior (SLCP).
Subplots show for the five estimated parameters.
https://doi.org/10.1371/journal.pcbi.1014534.s009
(TIF)
S10 Fig. Example of pairwise and marginal collective posteriors for SLCP.
A single collective posterior distribution for SLCP, with (the last benchmark from [8]), marked in black vertical lines. The observation is a set of 10 independent SLCP simulations of
.
https://doi.org/10.1371/journal.pcbi.1014534.s010
(TIF)
S11 Fig. Collective posterior inference from genome rearrangement model simulations.
Marginal individual posterior distributions of ten synthetic observations, inferred using rejection-ABC (blue); marginal collective posterior distributions, aggregated from the individual posterior distributions (red); and the true parameter values (black dotted line) for the five model parameters.
https://doi.org/10.1371/journal.pcbi.1014534.s011
(TIF)
S12 Fig. Distribution of phylogenetic summary statistics.
Histograms of summary statistics from 100 simulations of the estimated parameter values from Moshe et al. (2022).
https://doi.org/10.1371/journal.pcbi.1014534.s012
(TIF)
S13 Fig. The collective posterior with NPE and NPE + PIE are comparable on clean evolutionary simulations.
(A) Coverage plots. Box plots of coverages , corresponding to confidence levels
. (B-G) Accuracy. Distributions of the difference between the posterior sample mean and the true parameter for all model parameters.
https://doi.org/10.1371/journal.pcbi.1014534.s013
(TIF)
S14 Fig. The collective posterior with NPE outperforms NPE + PIE on hierarchical evolutionary simulations (without measurement noise).
(A) Coverage plots. Box plots of coverages , corresponding to confidence levels
. (B-G) Accuracy. Distributions of the difference between the posterior sample mean and the true parameter for all model parameters.
https://doi.org/10.1371/journal.pcbi.1014534.s014
(TIF)
S15 Fig. Simulations from the single-locus WF model have an extremely low variance.
10 replicates of the same parameter values fed to the single-locus WF simulator (random seed, unfixed).
https://doi.org/10.1371/journal.pcbi.1014534.s015
(TIF)
S16 Fig. NPE + PIE and the collective posterior are comparable on clean single-locus WF simulations.
(A) Coverage plots. Box plots of coverages , corresponding to confidence levels
. (B-D) Accuracy. Distributions of the difference between the posterior sample mean and the true parameter for all model parameters. NPE + PIE shows dramatically better results for the selection coefficient
, however underperforms for
.
https://doi.org/10.1371/journal.pcbi.1014534.s016
(TIF)
S17 Fig. The collective posterior with NPE outperforms NPE + PIE on perturbed single-locus WF simulations.
(A) Coverage plots. Box plots of coverages , corresponding to confidence levels
. (B-D) Accuracy. Distributions of the difference between the posterior sample mean and the true parameter for all model parameters.
https://doi.org/10.1371/journal.pcbi.1014534.s017
(TIF)
S18 Fig. Improved precision via “Floor Raising” ensemble.
To assess the impact of ensembling on estimator accuracy, we trained 10 independent NPE neural density estimators on the same Wright-Fisher task and evaluated them on a single replicate. Thin lines show the posterior distributions from each of the 10 density estimators, illustrating stochastic variation in neural estimator training. Blue distribution represents the standard averaging ensemble (arithmetic mean of the posterior), which broadens the posterior to encompass the variance of all individual estimators. Red distribution represents the proposed “Floor Raising” ensemble, calculated using the robust collective posterior formula (Eq. 7) across the 10 estimators. By treating each estimator as independent experts, the Floor Raising method identifies the consensus region where all estimators agree, resulting in significantly sharper parameter estimates compared to averaging ensemble.
https://doi.org/10.1371/journal.pcbi.1014534.s018
(TIF)
S19 Fig. ε estimation does not depend on the number of replicates.
Distribution of estimated epsilon by quantile choice for the evolutionary benchmark for varying replicate numbers on 100 test observations. For N = 10 we used the original test observations with 3 outliers. For the other replicate numbers, we sampled randomly (without replacement) from the original 10 replicates, resulting in a varying expected number of outliers (0.9 for 3 replicates, 1.5 for 5 replicates, and 2.1 for 7 replicates).
https://doi.org/10.1371/journal.pcbi.1014534.s019
(TIF)
S20 Fig. Inference quality is highly dependent on ε.
Posterior accuracy (the mean distance between the posterior mean and the true parameter) and mean coverage error as a function of ε and N (number of replicates) for the evolutionary synthetic benchmark. While increasing the number of replicates N can slightly helps both accuracy and coverage, ε has a strong effect on both, requiring a balance between accuracy and coverage optimization. For N = 10 we used the original test observations (with 3 outliers out of the 10 replicates). For the other replicate numbers, we sampled randomly (without replacement) from the original 10 replicates, resulting in a varying expected number of outliers (0.9 for 3 replicates, 1.5 for 5 replicates, and 2.1 for 7 replicates). In each panel, the error bars show the between-parameter variance in the respective metric, and the markers show the mean value across parameters.
https://doi.org/10.1371/journal.pcbi.1014534.s020
(TIF)
S1 Table. The Collective Posterior is faster compared to NPE + PIE and NPSE.
Training (including simulation) and inference times for all methods, tested on the Chuong et al. (2025) task. While NPE + PIE offers rapid sampling, the Collective Posterior requires significantly less training time, with a small inference overhead. In addition, NPSE needs a short training time, but a significantly longer inference time. Analysis performed on 48 CPU cores with NPE and NPSE (5) default hyperparameters. Inference corresponds to 10,000 samples from the estimated posterior for each of the 500 observation sets. For the collective posterior, we report the running times for both sampling strategies: SIR (sampling importance resampling), and MCMC (Markov Chain Monte Carlo).
https://doi.org/10.1371/journal.pcbi.1014534.s021
(XLSX)
S2 Table. Scalability of the collective posterior with importance sampling.
The collective posterior can easily scale to 100 or even 1,000 observations in reasonable times, while using the same neural density estimator that required less than 1 hour to train. For comparison, training NPE + PIE for datsets of 1,000 observations would take about two weeks, and inference of NPSE would take about 36 hours.
https://doi.org/10.1371/journal.pcbi.1014534.s022
(XLSX)
S3 Table. Erratic posterior densities.
Log-posterior probability by NPE of both prior edges and the sample mean, conditioned on the empirical data shown in S4 Fig. While the posterior density is consistent for a given observation, the densities for unlikely values change by hundreds of orders of magnitude among observations. The density of the sample mean is similar among observations.
https://doi.org/10.1371/journal.pcbi.1014534.s023
(XLSX)
S1 Text. Supplementary methods and extended analyses.
Includes detailed descriptions of the simulation-based inference pipeline, mathematical derivations, sampling techniques, and additional test cases.
https://doi.org/10.1371/journal.pcbi.1014534.s024
(DOCX)
Acknowledgments
We thank Yoav Livne, Tamar Joseph, Tomer Oron, Julie N. Chuong, Titir De, Yoni Green, Tal Pupko, Adi Stern, and Ofir Levy for helpful discussions and advice.
References
- 1. Cooper TF, Lenski RE. Experimental evolution with E. coli in diverse resource environments. I. Fluctuating environments promote divergence of replicate populations. BMC Evol Biol. 2010;10:11. pmid:20070898
- 2. Johnson WE, Li C, Rabinovic A. Adjusting batch effects in microarray expression data using empirical Bayes methods. Biostatistics. 2007;8(1):118–27. pmid:16632515
- 3. Leek JT, Scharpf RB, Bravo HC, Simcha D, Langmead B, Johnson WE, et al. Tackling the widespread and critical impact of batch effects in high-throughput data. Nat Rev Genet. 2010;11(10):733–9. pmid:20838408
- 4. Blainey P, Krzywinski M, Altman N. Replication. Nat Methods. 2014;11(9):879–80.
- 5. Lachlan RF, Ratmann O, Nowicki S. Cultural conformity generates extremely stable traditions in bird song. Nat Commun. 2018;9(1):2417. pmid:29925831
- 6. HODGKIN AL, HUXLEY AF. A quantitative description of membrane current and its application to conduction and excitation in nerve. J Physiol. 1952;117(4):500–44. pmid:12991237
- 7. Gillespie DT. Exact stochastic simulation of coupled chemical reactions. J Phys Chem. 1977;81(25):2340–61.
- 8. Hethcote HW. The mathematics of infectious diseases. SIAM Review. 2000;42(4):599–653.
- 9.
Barrett CL, Bisset KR, Eubank SG, Feng X, Marathe MV. SC’08: Proceedings of the 2008 ACM/IEEE Conference on Supercomputing. 2008. 1–12. https://ieeexplore.ieee.org/abstract/document/5214892/
- 10. Springel V, White SDM, Jenkins A, Frenk CS, Yoshida N, Gao L, et al. Simulations of the formation, evolution and clustering of galaxies and quasars. Nature. 2005;435(7042):629–36. pmid:15931216
- 11. Tavaré S, Balding DJ, Griffiths RC, Donnelly P. Inferring coalescence times from DNA sequence data. Genetics. 1997;145(2):505–18. pmid:9071603
- 12. Pritchard JK, Seielstad MT, Perez-Lezaun A, Feldman MW. Population growth of human Y chromosomes: a study of Y chromosome microsatellites. Mol Biol Evol. 1999;16(12):1791–8. pmid:10605120
- 13. Barrick JE, Kauth MR, Strelioff CC, Lenski RE. Escherichia coli rpoB mutants have increased evolvability in proportion to their fitness defects. Mol Biol Evol. 2010;27(6):1338–47. pmid:20106907
- 14. Hegreness M, Shoresh N, Hartl D, Kishony R. An equivalence principle for the incorporation of favorable mutations in asexual populations. Science. 2006;311(5767):1615–7. pmid:16543462
- 15. Moura de Sousa JA, Campos PRA, Gordo I. An ABC method for estimating the rate and distribution of effects of beneficial mutations. Genome Biol Evol. 2013;5(5):794–806. pmid:23542207
- 16. Taştan H. Simulation-based estimation of threshold moving average models with contemporaneous shock asymmetry and an application to Turkish business cycles. Commun Stat - Simul Comput. 2017;46(5):3870–91.
- 17. Geraci A, Fabbri D, Monfardini C. Testing exogeneity of multinomial regressors in count data models: does two-stage residual inclusion work?. J Econom Methods. 2018;7(1).
- 18. Kulkarni S, Krell MM, Nabarro S, Moritz CA. Hardware-accelerated simulation-based inference of stochastic epidemiology models for COVID-19. J Emerg Technol Comput Syst. 2022;18(2):30:1-30:24.
- 19.
Marin R. Computational modeling, parameterization, and evaluation of the spread of diseases. 2022. Accessed 2025 June 8.
- 20. Jennings E, Madigan M. astroABC: an approximate Bayesian computation sequential Monte Carlo sampler for cosmological parameter estimation. Astron Comput. 2017;19:16–22.
- 21. Krause E, Kobayashi Y, Salcedo AN, Ivanov MM, Abel T, et al. A parameter-masked mock data challenge for beyond-two-point galaxy clustering statistics. arXiv.org. 2024. https://arxiv.org/abs/2405.02252v1
- 22.
Montel N. Simulation-based inference for astrophysical data. 2024. 2620. https://ui.adsabs.harvard.edu/abs/2024eas.conf.2620A
- 23. Beaumont MA, Zhang W, Balding DJ. Approximate Bayesian computation in population genetics. Genetics. 2002;162(4):2025–35. pmid:12524368
- 24. Papamakarios G. Neural density estimation and likelihood-free inference. 2019. Accessed 2025 February 9. http://arxiv.org/abs/1910.13233
- 25. Papamakarios G, Murray I. Fast ε-free inference of simulation models with bayesian conditional density estimation. Adv Neural Inf Process Syst. 2016;29.
- 26.
Greenberg D, Nonnenmacher M, Macke J. Automatic posterior transformation for likelihood-free inference. In: Proceedings of the 36th International Conference on Machine Learning, 2019. 2404–14. https://proceedings.mlr.press/v97/greenberg19a.html
- 27.
Lueckmann JM, Boelts J, Greenberg D, Goncalves P, Macke J. In: Proceedings of The 24th International conference on artificial intelligence and statistics, 2021. 343–51. https://proceedings.mlr.press/v130/lueckmann21a.html
- 28. Fearnhead P, Prangle D. Constructing summary statistics for approximate bayesian computation: semi-automatic approximate bayesian computation. J Royal Stat Soc Series B: Stat Methodol. 2012;74(3):419–74.
- 29. Avecilla G, Chuong JN, Li F, Sherlock G, Gresham D, Ram Y. Neural networks enable efficient and accurate simulation-based inference of evolutionary parameters from adaptation dynamics. PLoS Biol. 2022;20(5):e3001633. pmid:35622868
- 30. Chan J, Perrone V, Spence JP, Jenkins PA, Mathieson S, Song YS. A likelihood-free inference framework for population genetic data using exchangeable neural networks. Adv Neural Inf Process Syst. 2018;31:8594–605. pmid:33244210
- 31.
Zaheer M, Kottur S, Ravanbakhsh S, Poczos B, Salakhutdinov R, Smola A. Deep Sets. 2018. Accessed 2026 January 5.
- 32. Tejero-Cantero A, Boelts J, Deistler M, Lueckmann JM, Durkan C, Gonçalves PJ. SBI -- A toolkit for simulation-based inference. 2020. Accessed 2025 February 9. http://arxiv.org/abs/2007.09114
- 33. Deistler M, Boelts J, Steinbach P, Moss G, Moreau T, Gloeckler M. Simulation-based inference: a practical guide. 2025. Accessed 2025 November 4. http://arxiv.org/abs/2508.12939
- 34. Rodrigues P, Moreau T, Louppe G, Gramfort A. HNPE: leveraging global parameters for neural posterior estimation. Adv Neural Inf Process Syst. 2021;34:13432–43.
- 35. Arruda J, Schälte Y, Peiter C, Teplytska O, Jaehde U, Hasenauer J. An amortized approach to non-linear mixed-effects modeling based on neural posterior estimation. bioRxiv. 2023;2023:2023–08.
- 36. Leyde K, Green SR, Toubiana A, Gair J. Gravitational wave populations and cosmology with neural posterior estimation. Physical Review D. 2024;109(6):064056.
- 37. Scott SL, Blocker AW, Bonassi FV, Chipman HA, George EI, McCulloch RE. Bayes and big data: the consensus Monte Carlo algorithm. Big Data and Information Theory. Routledge; 2022. 8–18.
- 38. Minsker S, Srivastava S, Lin L, Dunson DB. Robust and scalable Bayes via a median of subset posterior measures. J Mach Learn Res. 2017;18(124):1–40.
- 39.
Geffner T, Papamakarios G, Mnih A. Compositional score modeling for simulation-based inference. In: Proceedings of the 40th International Conference on Machine Learning, 2023. 11098–116. https://proceedings.mlr.press/v202/geffner23a.html
- 40. Linhart J, Cardoso GV, Gramfort A, Corff SL, Rodrigues PLC. Diffusion posterior sampling for simulation-based inference in tall data settings. arXiv. 2024.
- 41. Arruda J, Pandey V, Sherry C, Barroso M, Intes X, Hasenauer J. Compositional amortized inference for large-scale hierarchical Bayesian models. arXiv. 2025.
- 42. Chuong JN, Ben Nun N, Suresh I, Matthews JC, De T, Avecilla G, et al. Template switching during DNA replication is a prevalent source of adaptive gene amplification. Elife. 2025;13:RP98934. pmid:39899365
- 43. De T, Ben Nun N, Spealman P, Suresh I, Avecilla G, Abdul-Rahman F. Segmental copy number amplifications are more stable than aneuploidies in the absence of selection. Mol Biol Evol. 2026;43(4):msag095.
- 44. Papamakarios G, Nalisnick E, Rezende DJ, Mohamed S, Lakshminarayanan B. Normalizing flows for probabilistic modeling and inference. J Mach Learn Res. 2021;22(57):1–64.
- 45. Caspi I, Meir M, Ben N, Abu R, Yakhini U, Stern A, et al. Mutation rate, selection, and epistasis inferred from RNA virus haplotypes via neural posterior estimation. Virus Evol. 2023;9(1):033.
- 46. Sisson SA, Fan Y, Tanaka MM. Sequential Monte Carlo without likelihoods. Proc Natl Acad Sci. 2007;104(6).
- 47. Smith AFM, Gelfand AE. Bayesian statistics without tears: a sampling–resampling perspective. Am Stat. 1992;46(2):84–8.
- 48. Lauer S, Avecilla G, Spealman P, Sethia G, Brandt N, Levy SF, et al. Single-cell copy number variant detection reveals the dynamics and diversity of adaptation. PLoS Biol. 2018;16(12):e3000069. pmid:30562346
- 49. Deistler M, Goncalves PJ, Macke JH. Truncated proposals for scalable and hassle-free simulation-based inference. Adv Neural Inf Process Syst. 2022;35:23135–49.
- 50.
Linhart J, Gramfort A, Rodrigues PLC. L-C2ST: Local diagnostics for posterior approximations in simulation-based inference. arXiv, 2023. https://doi.org/10.48550/arXiv.2306.03580
- 51. Leininger TJ, Gelfand AE. Bayesian inference and model assessment for spatial point patterns using posterior predictive samples. Bayesian Anal. 2017;12(1).
- 52. Cook SR, Gelman A, Rubin DB. Validation of software for Bayesian models using posterior quantiles. J Comput Graph Stat. 2006;15(3):675–92.
- 53. Säilynoja T, Schmitt M, Bürkner PC, Vehtari A. Posterior SBC: simulation-based calibration checking conditional on data. Stat Comput. 2026;36(2):78.
- 54. Pastore M, Calcagnì A. Measuring distribution similarities between samples: a distribution-free overlapping index. Front Psychol. 2019;10:1089. pmid:31231264
- 55. Bissiri PG, Holmes CC, Walker SG. A general framework for updating belief distributions. J R Stat Soc Ser B Stat Methodol. 2016;78(5).
- 56. Miller JW, Dunson DB. Robust Bayesian inference via coarsening. J Am Stat Assoc. 2019;114(527):1113–25. pmid:31942084