Extending the statistical software package Engine for Likelihood-Free Inference

Vasileios Gkolemis, Michael U. GutmannarXiv 2020 · DOI

Abstract

Bayesian inference is a principled framework for dealing with uncertainty. The practitioner can perform an initial assumption for the physical phenomenon they want to model (prior belief), collect some data and then adjust the initial assumption in the light of the new evidence (posterior belief). Approximate Bayesian Computation (ABC) methods, also known as likelihood-free inference techniques, are a class of models used for performing inference when the likelihood is intractable. The unique requirement of these models is a black-box sampling machine. Due to the modelling-freedom they provide these approaches are particularly captivating. Robust Optimisation Monte Carlo (ROMC) is one of the most recent techniques of the specific domain. It approximates the posterior distribution by solving independent optimisation problems. This dissertation focuses on the implementation of the ROMC method in the software package Engine for Likelihood-Free Inference (ELFI). In the first chapters, we provide the mathematical formulation and the algorithmic description of the ROMC approach. In the following chapters, we describe our implementation; (a) we present all the functionalities provided to the user and (b) we demonstrate how to perform inference on some real examples. Our implementation provides a robust and efficient solution to a practitioner who wants to perform inference on a simulator-based model. Furthermore, it exploits parallel processing for accelerating the inference wherever it is possible. Finally, it has been designed to serve extensibility; the user can easily replace specific subparts of the method without significant overhead on the development side. Therefore, it can be used by a researcher for further experimentation.

Introduction

In scientific domains ranging from epidemiology to climate science, researchers increasingly rely on simulator-based models. These computer programs generate data based on input parameters but often lack a tractable likelihood function—the mathematical formula required to calculate the probability of observed data given specific parameters. While Approximate Bayesian Computation (ABC) has traditionally addressed this "likelihood-free" challenge, it suffers from the "curse of dimensionality," where the probability of a random simulation matching observed data drops precipitously as model complexity increases.

This paper presents the first official implementation of Robust Optimisation Monte Carlo (ROMC) within the Engine for Likelihood-Free Inference (ELFI) Python package. ROMC addresses the inefficiencies of ABC by reframing Bayesian inference as a series of parallelizable optimization tasks, providing a scalable and robust framework for complex simulators.

The ROMC Framework

ROMC is a "meta-algorithm" that shifts the focus from random sampling to targeted optimization. The implementation in ELFI follows a structured pipeline:

  1. Deterministic Mapping: The algorithm fixes the internal randomness (nuisance variables) of the simulator, rendering it deterministic for a given "seed."
  2. Optimization: For multiple random seeds, the system employs optimizers to identify the specific parameters that minimize the discrepancy between simulator output and observed data.
  3. Bounding Boxes: To account for local uncertainty, ROMC constructs "bounding boxes" around optimal points, improving upon earlier methods that relied on single-point estimates.
  4. Surrogate Modeling: To mitigate the computational cost of heavy simulations, the implementation supports surrogate models such as Gaussian Processes (GP) or quadratic functions. These surrogates approximate the simulator's behavior, allowing for rapid posterior evaluation.
  5. Parallelization: Since each optimization task is independent, the implementation leverages multi-core CPUs to execute tasks concurrently.

Experimental Validation

The implementation was validated across several benchmarks to ensure accuracy and robustness:

  • Synthetic Models: 1D and 2D toy problems were used to verify that the ROMC implementation converges to known mathematical truths. In 2D tests, the implementation achieved a low Jensen-Shannon divergence (~0.07), indicating high posterior accuracy.
  • Moving Average MA(2) Model: A standard time-series benchmark in the likelihood-free inference community.
  • Tuberculosis Spread Model: A complex, real-world simulator representing a scenario where traditional likelihood calculations are impossible.

Performance and Scalability

A key contribution of this work is the significant performance enhancement provided by the ELFI integration. Empirical results demonstrate:

  • Surrogate Efficiency: Using a Gaussian Process surrogate accelerated posterior evaluation by 5x compared to the raw simulator, while quadratic surrogates achieved a 15x speedup.
  • Parallel Speedup: On an 8-core laptop, the parallelized optimization phase was 6x faster than sequential execution.
  • Sampling Throughput: Posterior sampling was 3.5x faster when utilizing parallel processing, making the tool accessible for practitioners with limited computational resources.

Conclusion and Future Work

The integration of ROMC into ELFI provides a modular and extensible tool for the research community. Its design allows researchers to swap components—such as replacing standard optimizers with neural networks—without significant development overhead.

However, limitations remain. The current implementation uses a single bounding box per optimization, which may struggle with multi-modal distributions where multiple disconnected parameter regions fit the data. Future work will focus on handling constrained parameter spaces more efficiently and implementing "batched" training to allow for intermediate result inspection and early convergence stopping.

Summary updated

Abstract

Bayesian inference is a principled framework for dealing with uncertainty. The practitioner can perform an initial assumption for the physical phenomenon they want to model (prior belief), collect some data and then adjust the initial assumption in the light of the new evidence (posterior belief). Approximate Bayesian Computation (ABC) methods, also known as likelihood-free inference techniques, are a class of models used for performing inference when the likelihood is intractable. The unique requirement of these models is a black-box sampling machine. Due to the modelling-freedom they provide these approaches are particularly captivating. Robust Optimisation Monte Carlo (ROMC) is one of the most recent techniques of the specific domain. It approximates the posterior distribution by solving independent optimisation problems. This dissertation focuses on the implementation of the ROMC method in the software package Engine for Likelihood-Free Inference (ELFI). In the first chapters, we provide the mathematical formulation and the algorithmic description of the ROMC approach. In the following chapters, we describe our implementation; (a) we present all the functionalities provided to the user and (b) we demonstrate how to perform inference on some real examples. Our implementation provides a robust and efficient solution to a practitioner who wants to perform inference on a simulator-based model. Furthermore, it exploits parallel processing for accelerating the inference wherever it is possible. Finally, it has been designed to serve extensibility; the user can easily replace specific subparts of the method without significant overhead on the development side. Therefore, it can be used by a researcher for further experimentation.
BibTeX
@misc{gkolemis2020extending,
  author = {Vasileios Gkolemis and Michael U. Gutmann},
  title = {{Extending the statistical software package Engine for Likelihood-Free Inference}},
  year = {2020},
  eprint = {2011.03977},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.03977},
}
Figure