sbi

sbi is a Python package for simulation-based inference, designed to meet the needs of both researchers and practitioners. Whether you need fine-grained control

What is sbi?

sbi is a Python package for simulation-based inference, designed to meet the needs of both researchers and practitioners. Whether you need fine-grained control or an easy-to-use interface, sbi has you covered.

Overview of sbi

What it is

sbi is a Python package for simulation-based inference (SBI). It is designed to meet the needs of both researchers and practitioners. With sbi, you can perform parameter inference using Bayesian inference: given a simulator that models a real-world process, SBI estimates the full posterior distribution over the simulator’s parameters based on observed data. This distribution indicates the most likely parameter values while additionally quantifying uncertainty and revealing potential interactions between parameters.

Key features

  • Low-level interfaces for maximum control over the inference process - High-level interfaces for quick and easy implementation of complex inference tasks - Amortized methods that enable reuse of posterior estimators across multiple observations without retraining - Sequential methods that focus on individual observations to optimize the number of simulations - Built-in validation tools to verify the accuracy of inferred posteriors - Comprehensive plotting and analysis functions for visualizing and interpreting posterior distributions

Use cases

sbi is used for parameter inference in any domain where a simulator is available. Typical applications include scientific modeling, engineering, and any field requiring Bayesian inference with intractable likelihoods. The package supports both amortized and sequential inference, making it suitable for scenarios with multiple observations or limited simulation budgets.

Getting started

python # Installation (requires Python 3.10+) uv pip install sbi # Optional extras for MCMC samplers uv pip install sbi[pyro] # Pyro samplers (HMC, NUTS) uv pip install sbi[pymc] # PyMC samplers (HMC, NUTS, Slice) uv pip install sbi[all] # both Pyro and PyMC # Quick start example from sbi.inference import NPE # Given: parameters theta and corresponding simulations x inference = NPE(prior=prior) inference.append_simulations(theta, x).train() posterior = inference.build_posterior()

License and pricing

Apache License Version 2.0 (Apache-2.0). This is an open-source package with no stated pricing.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/sbi-devsbi.svg)](https://yunodb.com/tools/sbi-devsbi?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/sbi-devsbi?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/sbi-devsbi.svg" alt="Featured on YunoDB" height="20"></a>