Source-linked AI summary

Fast $ε$-free Inference of Simulation Models with Bayesian Conditional Density Estimation

George Papamakarios, Iain Murray

arXiv:1605.06376v4stat.MLcs.LGstat.CO

TL;DR

Simulator-based models have unavailable likelihoods, so ABC approximates their posteriors using tolerance-based simulation but becomes broader and more costly as ε decreases. The paper instead uses Bayesian conditional density estimation with adaptive proposal priors to learn the exact posterior efficiently. Its approach can learn accurate parametric posteriors with fewer simulations, while practical applications often rely on fixed-length summary statistics.

  • Problem

    Unavailable likelihoods prevent conventional Bayesian inference, while ABC produces ε-approximate posteriors that are broader and require more simulations as ε decreases.

  • Method

    The method trains Bayesian conditional density estimators on simulator-generated parameter–data pairs and iteratively adapts proposal priors toward the observed-data posterior.

  • Results

    The approach can learn accurate parametric representations of the exact posterior with fewer simulations than Monte Carlo ABC methods need to produce a single approximate-posterior sample.

  • Takeaways & Limitations

    Bayesian conditional density estimation provides a parametric, exact-posterior-targeting, and simulation-efficient alternative to conventional ABC.

  • Takeaways & Limitations

    In practical ABC applications, inference commonly uses fixed-length summary statistics rather than raw data, treating their calculation as part of data generation.

Abstract

from arXiv · show

Many statistical models can be simulated forwards but have intractable likelihoods. Approximate Bayesian Computation (ABC) methods are used to infer properties of these models from data. Traditionally these methods approximate the posterior over parameters by conditioning on data being inside an $ε$-ball around the observed data, which is only correct in the limit $ε\!\rightarrow\!0$. Monte Carlo methods can then draw samples from the approximate posterior to approximate predictions or error bars on parameters. These algorithms critically slow down as $ε\!\rightarrow\!0$, and in practice draw samples from a broader distribution than the posterior. We propose a new approach to likelihood-free inference based on Bayesian conditional density estimation. Preliminary inferences based on limited simulation data are used to guide later simulations. In some cases, learning an accurate parametric representation of the entire true posterior distribution requires fewer model simulations than Monte Carlo ABC methods need to produce a single sample from an approximate posterior.

1 Introduction

Simulator-based models support scientific inference when observations arise from underlying processes, but their unavailable likelihoods require likelihood-free methods. ABC approximates posteriors through repeated simulations and accepted parameter settings, while conventional approaches have representation, accuracy, and efficiency drawbacks.

  • Motivation: Simulator-based models describe data-generating processes as computer programs with parameters learned from observations.They are used in domains including evolutionary biology, ecology, epidemics, economics, and cosmology, where calibrated uncertainty can matter for conclusions and decisions.
  • Problem: Unavailable analytical likelihoods make conventional likelihood-based Bayesian inference inapplicable, motivating Approximate Bayesian Computation.ABC repeatedly simulates the model and retains parameter settings whose synthetic data resemble the observations.
  • Existing approaches: Rejection ABC accepts independent parameter samples within a distance threshold, whereas MCMC-ABC and SMC-ABC modify proposals to explore plausible regions more efficiently.MCMC-ABC perturbs accepted parameters, while SMC-ABC sequences importance-sampled distributions toward the posterior.
  • Limitations: Conventional ABC represents posteriors with samples, targets an ε-ball approximation rather than the exact posterior, and becomes impractical as tolerance decreases.Sample-based computations can be noisy, and smaller tolerances require more simulations.
  • Contribution: The proposed approach learns a parametric approximation to the exact posterior using Bayesian conditional density estimation and guides later simulations with preliminary fits.The authors state that this can reduce simulations required for accurate approximation by orders of magnitude.

2 Bayesian conditional density estimation for likelihood-free inference

The method directly learns the exact parameter posterior from simulator-generated pairs using conditional density estimation, then iteratively focuses simulations through an adaptive proposal prior. Bayesian neural density estimation supports small simulation batches by reducing overfitting and eliminating validation data.

  • 2.1 Simulator-based models and ABC: ABC replaces the unavailable likelihood with the probability that simulated data fall within an ε-ball, producing a broader posterior that becomes exact only as ε → 0.Reducing ε improves accuracy but drives match probabilities toward zero and causes existing methods to break down.
  • 2.2 Learning the posterior: The method directly estimates p(θ | x = xo) from simulated parameter–data pairs using a flexible conditional density qφ(θ | x).Parameters are drawn from a proposal prior, corresponding data are simulated, and qφ is trained by maximum likelihood.
  • 2.2 Learning the posterior: A proposal prior can be reweighted to recover the exact posterior when it differs from the actual prior.The conditional density learns the posterior under the simulation distribution, requiring importance reweighting for an alternative proposal.
  • 2.3 Choice of estimator: The conditional estimator is a mixture density network whose Gaussian weights, means, and covariances are produced from the simulated data.With sufficiently many components and hidden units, the architecture can represent conditional distributions arbitrarily accurately while remaining trainable by backpropagation.
  • 2.3 Choice of proposal prior: A Gaussian proposal prior permits analytical posterior correction for simple uniform or Gaussian priors, yielding a Gaussian mixture at the observed data.The corrected mixture parameters depend on the estimator outputs evaluated at xo.
  • 2.4 Learning the proposal prior: The proposal prior is iteratively updated from the learned posterior so simulations increasingly concentrate near plausible parameters.The procedure starts from the prior, trains on simulated pairs, updates the proposal, and repeats until convergence.
  • 2.4 Learning the proposal prior: Typically 4–6 iterations of 200–500 samples learned fast Gaussian approximations to the true posterior in the reported experiments.These approximations can be used directly or as proposal priors for fine-tuning a non-Gaussian posterior.
  • 2.5 Bayesian neural density estimators: MDN-SVI improves robustness and efficiency by resisting overfitting, using every sample for training, and avoiding careful training-time tuning.This enables smaller simulation batches without reserving a validation set.

3 Experiments

Experiments compare conditional-density estimators with ABC across toy, analytically tractable, and simulator-based models. MDNs learn accurate posteriors while proposal-guided training improves simulation efficiency and can produce more confident estimates than ABC.

  • Experimental setup: The experiments compare three MDN strategies with rejection, MCMC, and SMC-ABC baselines across mixture, regression, Lotka–Volterra, and M/G/1 models.The MDN variants use either the actual prior or a learned proposal prior, while the ABC baselines use progressively more adaptive sampling schemes.
  • Mixture of two Gaussians: 10K simulations trained the MDN with prior, whereas proposal training used 4 iterations of 200 simulations and MDN with proposal used 1000 additional simulations.The proposal-guided strategy therefore focused later simulations near the observed value rather than learning across the full prior-supported observation range.
  • Mixture of two Gaussians: Both MDN strategies learned good parametric approximations to the analytically tractable mixture posterior, while proposal training was accurate mainly near the observed x_o = 0.The MDN with prior learned conditional posteriors over a broad range of x, whereas the proposal-guided MDN specialized near the observation.
  • Bayesian linear regression: In Bayesian linear regression, ABC improves as ϵ decreases but eventually fails or becomes prohibitively slow, while MDN with proposal and long-run SMC-ABC achieve the best approximations.Approximation quality was measured by KL divergence from the analytically known posterior.
  • Bayesian linear regression: Sequentially fitting a proposal was more than ten times cheaper and more accurate than training with prior samples, and MDNs used simulations more efficiently than Monte Carlo ABC.ABC costs are reported per effective sample, whereas MDN costs are total training simulations; practical ABC costs also depend on the number of effective samples required.
  • Simulator-based models: Across Lotka–Volterra and M/G/1, MDN methods achieved higher confidence around true parameters and used simulations more efficiently than ABC.The authors attribute the narrower estimates to learning the exact posterior rather than ABC’s broader approximation, and the efficiency to using all simulations for training.

4 Related work

Related work includes parametric ABC corrections, synthetic-likelihood models, more efficient Monte Carlo ABC, recognition networks, and learned proposal distributions. These approaches differ in whether they adjust samples, model likelihoods, accelerate sampling, invert generative models, or learn proposals.

  • Parametric likelihood-free methods: Regression adjustment trains a parametric mapping from simulated data x to parameters θ, then corrects posterior samples obtained with a large ϵ.Prior work used linear regressors and neural networks that separately predicted parameter means and variances.
  • Parametric likelihood-free methods: Synthetic-likelihood methods estimate p(x | θ) with Gaussian, mixture-Gaussian, or Gaussian-process models trained across parameter settings.These methods model the data distribution conditional on fixed parameters rather than directly estimating the posterior.
  • Efficient Monte Carlo ABC: Hamiltonian, optimization, and Bayesian-optimization ABC reduce Monte Carlo costs by improving exploration, optimizing sample locations, or modeling distances with Gaussian processes.These methods remain within sample-based ABC while targeting fewer rejected or inefficient proposals.
  • Recognition networks: Recognition networks learn to invert generative models, providing a machine-learning precedent for neural density estimators that map observations toward latent parameters.The cited examples include the Helmholtz machine, variational auto-encoders, and stochastic backpropagation.
  • Learning proposals: Neural density estimators have also been used to learn proposal distributions for importance sampling and sequential Monte Carlo, whereas this work focuses on fitting conditional posteriors directly.The learned posterior could additionally be used within Monte Carlo inference methods, but that is not the paper’s primary focus.

5 Conclusions

Bayesian conditional density estimation improves likelihood-free inference by representing the posterior parametrically, targeting the exact posterior, and using simulations efficiently.

  • The approach represents the posterior parametrically, enabling probabilistic evaluations later in the inference pipeline.
  • It targets the exact posterior rather than an ε-approximation.
  • It uses simulations efficiently by avoiding rejection, interpolating between samples, and gradually focusing on plausible parameter regions.

A Proof of Proposition 1

The proof shows that maximizing conditional log probability minimizes a KL divergence whose optimum recovers the posterior under the proposal prior.

  • Maximizing the average log probability of qφ(θn | xn) is the optimization objective for the conditional density estimator.
  • As the number of simulated pairs grows, the average log probability converges almost surely to its corresponding expectation.
  • Maximizing this expectation is equivalent to minimizing a KL divergence between the simulated joint distribution and the model using qφ(θ | x).
  • The KL divergence is minimized at zero only when the modeled joint distribution matches the target distribution almost everywhere.
  • At the optimum, qφ(θ | x) becomes the posterior associated with proposal prior ˜p(θ).

B Parameterization and training of Mixture Density Networks

The mixture density network represents conditional densities with Gaussian mixtures whose parameters are produced by a feedforward network and trained by maximum likelihood.

  • An MDN is a conditional density estimator qφ(θ | x) formed as a mixture of K Gaussian components.
  • A feedforward neural network computes the mixing coefficients, means, and covariance matrices from x.
  • The softmax makes mixing coefficients positive and normalized, while the means are affine functions of the network output.
  • The covariance matrices are parameterized through upper-triangular Cholesky factors of their inverses to ensure symmetry and positive definiteness.
  • The inverse-covariance parameterization also permits efficient calculation of the covariance log determinant.
  • Training the MDN by maximum likelihood maximizes the average log probability with respect to its parameters.

C Analytical calculation of parameter posterior

After training the conditional density estimator, the parameter posterior at the observed data is obtained analytically from the estimator and prior ratio, under conditions ensuring valid covariance matrices.

  • After training qφ(θ | x), the posterior at x = xo is approximated using the estimator evaluated at the observation.
  • For a uniform prior, the posterior estimate is specialized from the general analytical posterior expression.
  • The method is also used for uniform priors with broad but finite support.
  • When the proposal prior is Gaussian and qφ is a Gaussian mixture, their ratio can be calculated and normalized analytically.
  • The resulting posterior estimate is itself a mixture of K Gaussians.
  • The resulting mixture requires positive-definite covariance matrices, which can fail when the proposal prior is narrower than a posterior component.
  • Such non-positive-definite covariance matrices were rarely observed and indicated improperly configured algorithm parameters.

D Stochastic Variational Inference for Mixture Density Networks

The Bayesian MDN represents parameter beliefs with independent Gaussian variables and trains their means and log variances by maximizing a variational lower bound. Local reparameterization makes stochastic expectation estimates more efficient and lower variance.

  • MDN parameters φ are modeled as independent Gaussian random variables with means φm and log variances φs.The induced variational distribution uses a diagonal covariance structure.
  • The Gaussian prior initializes all parameter means to zero and all log variances to log λ^-1, with λ = 0.01 in the experiments.
  • SVI optimizes φm and φs so q(φ) approximates the Bayesian posterior over MDN parameters by maximizing a variational lower bound.The objective combines a stochastically approximated expected-data term with an analytically calculated KL term.
  • The unconstrained parameterization permits backpropagation through stochastic lower-bound estimates and use of standard gradient-based stochastic optimizers.The implementation uses Theano with Adam for stochastic maximization.
  • Local reparameterization samples each unit activation directly as a Gaussian instead of sampling weights and biases, reducing random-number calls and stochastic-estimation variance.For activation a, its mean and variance are computed from the input vector and the weight and bias distributions.

E Effective sample size of ABC methods

ABC methods return samples with different dependence and weighting structures, so their simulation costs are compared using simulations per effective sample. Effective sample size measures the independent-sample equivalent of a returned sample set.

  • Rejection ABC returns independent samples, MCMC-ABC correlated samples, and SMC-ABC independent weighted samples.
  • Simulations per effective sample equals total simulations divided by the effective sample size of the returned set.This metric enables fairer cost comparisons across ABC algorithms with different sample structures.
  • For rejection ABC, the effective sample size equals the number of returned samples because all samples are independent.
  • For MCMC-ABC, effective sample size is estimated separately for each component from autocorrelations and taken as the minimum across components.The autocorrelation sum ends at the first lag whose estimated coefficient equals zero.
  • For SMC-ABC, effective sample size reflects weight concentration: equal weights give Neff = N, while one nonzero weight gives Neff = 1.

F Setup for the Lotka–Volterra experiment

The Lotka–Volterra experiment infers four reaction-rate parameters from normalized summary statistics of predator–prey time series. Carefully tuned parameters produce oscillatory populations, yielding a posterior expected to be tightly concentrated near the true values.

  • Gillespie simulation draws exponential waiting times using the total reaction rate, selects a reaction proportionally to its rate, and repeats.
  • Each experiment starts with X = 50 predators and Y = 100 prey, runs for 30 time units, and records both populations every 0.2 time units.This produces two time series of 151 values each.
  • The observed-data vector contains 9 statistics: means, log variances, lag-1 and lag-2 autocorrelations, and the cross-correlation of the two series.Statistics are normalized using means and standard deviations from a 1000-simulation pilot run.
  • Carefully tuned parameters θ1 = 0.01, θ2 = 0.5, θ3 = 1, θ4 = 0.01 produce oscillatory predator–prey behavior, so the posterior is expected to be tightly peaked around the true parameters.Algorithms are evaluated by the log probability assigned to the true parameters.
  • The parameter prior is uniform in the log domain, with log θα = -5 and log θβ = 2, and all inference is performed in log parameters.

G Setup for the M/G/1 experiment

The M/G/1 experiment infers three queue parameters from five percentiles of empirical interdeparture times. Percentile summaries are whitened using a large pilot simulation to address differing scales and correlations.

  • The M/G/1 model describes a single server processing continuously arriving jobs, with service, arrival, and departure times linked by recursive equations.The experiment uses I = 50 jobs.
  • The experiment infers θ = (θ1, θ2, θ3) from the 0th, 25th, 50th, 75th, and 100th percentiles of interdeparture times.The 0th and 100th percentiles are the minimum and maximum interdeparture times.
  • The percentile vector is whitened using the mean vector and covariance matrix estimated from 100K pilot simulations.Subsequent simulations subtract the pilot mean and decorrelate and normalize with the pilot covariance matrix.
  • Inference algorithms are evaluated by the log probability assigned to the true parameter values.The observed data are generated by simulating the model at a specified parameter setting, with a uniform non-axis-aligned prior that includes those values.
Loading 1605.06376v4…