Abstract
ELFI (Engine for Likelihood-Free Inference) is a modular Python framework designed for simulator-based statistical models where likelihood functions are unavailable. By representing inference tasks as directed acyclic graphs (DAGs), ELFI enables efficient data reuse, parallelization, and the application of advanced methods like Bayesian Optimization for Likelihood-Free Inference (BOLFI). This paper introduces the ELFI architecture and demonstrates its advantages in modularity and computational efficiency over existing tools.
Introduction
In many scientific disciplines, such as population genetics and epidemiology, complex simulators are used to model real-world phenomena. While these simulators can generate synthetic data, they often lack an explicit likelihood function, which is a prerequisite for standard Bayesian inference. This necessitates Likelihood-Free Inference (LFI), also known as Approximate Bayesian Computation (ABC). Traditional LFI methods typically rely on "brute-force" simulations, often requiring millions of expensive runs. Furthermore, existing software tools for LFI are frequently domain-specific or difficult to scale. ELFI addresses these challenges by providing a flexible, graph-based engine for efficient inference.
Methods: The ELFI Graph
At the core of ELFI is the concept of a Directed Acyclic Graph (DAG) to represent the inference model. Every component—priors, simulators, summary statistics, and distance metrics—is treated as a node in this graph. This modularity allows researchers to easily swap components without restructuring the entire model.
Bayesian Optimization for LFI (BOLFI)
A standout feature of ELFI is BOLFI. Instead of random parameter sampling, BOLFI constructs a surrogate model (typically a Gaussian Process) of the distance between simulated and observed data. It uses an acquisition function to intelligently select the next parameter values to simulate, focusing on regions most likely to match observed data. This approach can reduce the number of required simulations by several orders of magnitude compared to standard ABC methods.
Implementation and Performance
ELFI is designed for high performance in a Python environment. It utilizes NumPy-based vectorization and processes simulations in batches. This architecture facilitates easy parallelization across multiple CPU cores or clusters using tools like ipyparallel. Additionally, the graph-based structure allows for automatic data persistence; if a user modifies a summary statistic but keeps the simulator unchanged, ELFI reuses existing simulator outputs, significantly saving computation time.
Comparative Analysis
ELFI distinguishes itself from other LFI frameworks through its combination of graph-based modeling, iterative processing, and advanced inference algorithms like BOLFI.
As shown in the comparison, ELFI is the only framework among those evaluated that supports the full suite of modern LFI requirements, including data reuse and iterative processing. This makes it a versatile platform for both practitioners and methodologists.
Conclusion
ELFI provides a robust and extensible engine for likelihood-free inference. By decoupling model specification from inference algorithms, it empowers researchers to apply sophisticated techniques like BOLFI to complex simulators with minimal effort. Future work will focus on mitigating the computational overhead of surrogate models in high-dimensional spaces and expanding the library of available inference algorithms.
Summary updated