Reference / binference.validation.coverage

binference.validation.coverage

binference.validation.coverage(simulate, fit, n_simulations=100, *, levels=(0.5, 0.68, 0.9, 0.95), functionals=None, rng=None, progress=False)[source]

Empirical coverage of central credible intervals over simulated data sets.

functionals maps names to functions of the fractions, or of the rates for rate models (e.g. a mean redshift); their intervals are checked alongside every bin fraction.

Parameters:
simulatecallable

simulate(rng) -> (likelihoods, truth), as in sbc().

fitcallable

fit(likelihoods, rng) -> result, as in sbc().

n_simulationsint, optional

Number of simulated data sets.

levelssequence of float, optional

Credible levels whose coverage is measured.

functionalsdict, optional

Named functions of the fractions (or rates) whose intervals are also checked.

rngint, Generator or None

Random number generator.

progressbool, optional

Show a progress bar.