swyft: Truncated Marginal Neural Ratio Estimation in Python
Abstract
Parametric stochastic numerical simulators are ubiquitous in science. They model observed phenomena by mapping a parametric representation of simulation conditions to a hypothetical observation - effectively sampling from a probability distribution over observational data known as the likelihood. Simulators are advantageous because they easily encode relevant scientific knowledge. Simulation-based inference (SBI) is a machine learning technique which applies a simulator, a fitted statistical surrogate model, and a set of prior beliefs to estimate a probabilistic description of the parameters which plausibly generated some observational data. This description of parameters is known as the posterior and it is the end-product of Bayesian inference.
Our package swyft implements a specific, simulation-efficient SBI method called Truncated Marginal Neural Ratio Estimation (TMNRE) (Miller et al., 2021); it estimates the likelihoodto-evidence ratio to approximate the posterior, as in Hermans et al. (2020). swyft (Miller et al., 2020) provides a collection of tools to simulate and store data, locally or in a distributed computing setting, and perform (marginalized) simulation-based Bayesian inference. It produces ready-to-publish plots that demonstrate the calibration of the posterior estimate along with the posterior itself.- Publication:
-
The Journal of Open Source Software
- Pub Date:
- July 2022
- DOI:
- 10.21105/joss.04205
- Bibcode:
- 2022JOSS....7.4205M
- Keywords:
-
- simulation-based inference;
- Jupyter Notebook;
- inverse problem;
- bayesian inference;
- Python;
- system identification;
- parameter identification;
- likelihood-free inference;
- machine learning