binference¶
Infer the population, then every object.
Many objects are each measured with noise. For each one you have a likelihood, a posterior computed under some prior, posterior samples, counts in measured bins with a response, or a classifier’s output. binference infers the distribution of the population the objects come from, with calibrated uncertainty, and the posterior of each object under that population. The same problem appears under different names in several fields (background); binference treats them as one model (what binference does).
Measurements with errors. A value and its uncertainty for each object: the quick start, then Gaussian measurements.
Posteriors or posterior samples. Each computed under some prior: the posterior-samples tutorial, then posteriors and samples.
Counts or classifier outputs. Counts in measured bins with a response, or scores from a classifier: the unfolding and classifier tutorials, then binned measurements and classifiers.
import binference
bins = binference.Bins.linear(0.0, 3.0, 15)
# a simulated stand-in for your arrays: measured values and their Gaussian errors
mock = binference.simulate.mock_1d(2000, bins, rng=42)
z_obs, z_err = mock.measurements["mean"], mock.measurements["sigma"]
lk = binference.Likelihoods.from_gaussian(z_obs, z_err, bins)
result = binference.infer(lk, rng=1) # method="auto" chooses the engine
print(result.summary())
Start. What binference does, whether it suits your data, how to install it, and a first fit.
Concepts. Bins and likelihoods, posteriors, the population and its objects, priors, selection and engines, in words and figures.
Tutorials. Executed examples from end to end, grouped by the kind of input.
Guides. Prepare inputs, choose bins and priors, correct for selection, then run, read and check a fit.
How it works. The model, point estimates, priors, the engines, how
autochooses, and validation.Fields. The same model in astronomy, gravitational waves, unfolding, empirical Bayes, quantification, ecology and neural deconvolution.
Reference. Every public class and function, the glossary, notation, defaults, warnings, bibliography and changelog, and how to cite binference.