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.
functionalsmaps 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 insbc().- fitcallable
fit(likelihoods, rng) -> result, as insbc().- 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.