Reference / binference.validation.sbc

binference.validation.sbc

binference.validation.sbc(simulate, fit, n_simulations=100, *, n_draws=99, log_likelihood=True, rng=None, progress=False)[source]

Simulation-based calibration.

Parameters:
simulatecallable

simulate(rng) -> (likelihoods, true_value) drawing a population from the prior and a catalogue from it (see binference.simulate.prior_predictive()). The true value is the fractions, or the rates for rate models.

fitcallable

fit(likelihoods, rng) -> PopulationResult running the inference to be validated (with the same prior as the simulator).

n_simulationsint

Number of simulated data sets.

n_drawsint

Posterior draws ranked per fit, thinned evenly from its draws. They should be roughly independent, i.e. fewer than the ESS: a warning names how many fits have a smallest bulk ESS below it, since autocorrelated draws make the rank histograms look over-dispersed.

log_likelihoodbool

Also rank the joint log-likelihood of the true population.

rngint, Generator or None

Seed or generator of the simulations and fits.

progressbool

Show a progress bar over the simulations.