Skip to contents

Priors

Define the prior distribution over simulator parameters.

priors
Priors for neural simulation-based inference
prior_uniform()
Box-uniform (independent uniform) prior
prior_normal()
Independent normal prior
prior_custom()
Build a prior from arbitrary sampling / density functions
sample_prior()
Draw samples from a prior
within_support()
Test whether parameters lie within the prior support

Simulation and training

Generate training data and fit a neural posterior estimator.

simulate_for_sbi()
Run a simulator over prior draws
npe()
Neural Posterior Estimation (NPE)
npe_sequential()
Sequential NPE with truncated-prior proposals (TSNPE)
density_estimator
Conditional density estimators
embedding_mlp()
Embedding (summary) networks for structured observations

Running the simulator

Parallel execution and progress reporting.

nsbi_parallel parallel-simulation
Running the simulator in parallel
nsbi_progress progress-bars
Progress reporting

Working with the posterior

Condition on data, then sample, evaluate, and summarize.

posterior()
Posterior objects
sample()
Draw samples (S3 generic)
sample(<nsbi_posterior>)
Sample from a posterior
sample_posterior()
Sample from a posterior (non-generic alias)
log_prob()
Posterior log-density
map_estimate()
Maximum a posteriori (MAP) estimate
as.data.frame(<nsbi_samples>) summary(<nsbi_samples>) summary(<nsbi_posterior>) summary(<nsbi_npe>)
Summaries and tidy accessors

Diagnostics

Calibration and predictive checks for a fitted posterior.

diagnostics
Posterior diagnostics
sbc()
Simulation-Based Calibration (SBC)
expected_coverage()
Expected coverage of central credible intervals
tarp()
TARP expected coverage
c2st()
Classifier two-sample test (C2ST)
posterior_predictive()
Posterior predictive draws

Plotting

pairplot()
Visualize posterior samples
plot_sbc()
Plot an SBC rank histogram
plot_coverage()
Plot nominal vs. empirical credible-interval coverage
plot_tarp()
Plot TARP expected coverage
plot_posterior_predictive()
Plot posterior predictive checks

Benchmark tasks

Reference inference problems shared by the tests and benchmarks.