sbi: the simulation-based inference toolkit

sbi is a Python package for Bayesian parameter inference on simulators. It implements state-of-the-art algorithms and comes with comprehensive documentation and tutorials, making it suitable for SBI practitioners. Additionally, it offers low-level modularity for researchers who wish to explore more advanced aspects of SBI.

Scientists use numerical simulators to model real-world phenomena. Unlike purely statistical models, simulators incorporate scientific principles, which help them make better predictions with fewer parameters. However, fine-tuning these parameters to match real-world data is difficult. Simulation-Based inference (SBI) aims to find parameter values that align with prior knowledge and observed data. In other words, SBI aims to perform fully Bayesian parameter inference on simulation-based models, i.e., using only simulated data and without requiring access to the likelihood function.

SBI is an active field of research with new algorithms being developed regularly. The sbi package aims to provide a central resource for practitioners and researchers to gain access to state-of-the-art SBI algorithms, as well as extensive documentation and tutorials.

Install with pip install sbi, or check out the documentation

Inference methods

  • Neural posterior estimation (amortized and sequential [Pap18F, Lue17F, Gre19A])
  • Neural likelihood estimation [Pap19S]
  • Neural ratio estimation [Her20L]
  • Balanced neural ratio estimation [Del22R]
  • Neural variational inference (amortized and sequential [Glo22V])
  • Mixed neural likelihood estimation [Boe22F]
  • Parallelized MCMC slice sampling
  • Access to Pyro and PyMC MCMC samplers

Evaluation methods

  • Extensive plotting tools
  • Prior and posterior predictive checks
  • Access to arviz visualizations
  • Simulation-based calibration [Tal20V]
  • Classifier-based two-sample test (C2ST, [Lop17R])
  • Expected coverage [Dei22T, Mil21T]


We are currently implementing or plan to implement:

  • Flow-matching neural posterior estimation [Lip22F, Wil23F]
  • Sequential neural posterior score estimation [Sha22S]
  • Compositional neural score estimation [Gef23C]
  • Local-C2ST [Lin23L]


The sbi package originated at the University of Tübingen in the mackelab, funded by the German Federal Ministry of Education and Research (BMBF) through project ADIMEM (FKZ 01IS18052 A-D), project SiMaLeSAM (FKZ 01IS21055A) and the Tübingen AI Center (FKZ 01IS18039A) (see here for details).

Today, sbi is a community project maintained by a group of people from both the University of Tübingen and the TransferLab. It has a large group of contributors from across Europe—new contributors are welcome.

University of Tübingen


In this series