Start / Is binference right for my data?

Is binference right for my data?

binference fits when three things hold. You have many objects. Each object carries its own noisy information about one quantity, which you can divide into bins (intervals, grid cells or categories). And you want the population of that quantity, or each object’s value informed by it. The tables below match what you have and what you want to binference’s inputs and outputs.

What you have

Each row names the constructor that turns your data into a Likelihoods, then the guide section that explains it and the tutorials that use it.

You have, for each object

binference reads it with

Read more

a measured value and its Gaussian error

Likelihoods.from_gaussian

guide, quick start, Empirical Bayes deconvolution

likelihoods or log-likelihoods on the bins

Likelihoods.from_table

guide, Mixed-stock analysis

a likelihood function or a SciPy distribution

Likelihoods.from_density

guide

a posterior on the bins, and the prior it was computed under

Likelihoods.from_table

guide, Posteriors on a grid

posterior samples, and the prior they were drawn under

Likelihoods.from_samples

guide, Posteriors on a grid

the bin it was measured in, and the detector’s response matrix

Likelihoods.from_binned

guide, Binned counts and a response: unfolding a spectrum

a classifier’s probabilities, and the class prevalence it was trained on

Likelihoods.from_table

guide, Classifier outputs: class fractions under label shift

a classifier’s scores, and a labelled validation set

Likelihoods.from_binned with Response.from_labelled

guide, Classifier outputs: class fractions under label shift, Mixed-stock analysis

Posteriors and posterior samples need their interim prior, which binference divides out (pitfalls).

What you want

You want

binference gives

Read more

the population, with its uncertainty

result.samples, result.summary, result.plot

guide, Gaussian measurements: a redshift distribution

a number computed from the population, such as its mean

result.functional

guide

each object’s value, informed by the population: its hierarchical posterior

result.assignment_probabilities, result.sample_values

guide, Empirical Bayes deconvolution

the histogram of these objects, the realised sample

result.realized_counts

guide

totals and rates from an incomplete catalogue, given its selection function

infer’s selection, then result.total, result.rates

guide, Selection effects and rates, Selection measured by injections

a quick single answer, a point estimate

method="map"

guide

What binference does not do

  • Compute the per-object inputs. binference starts where each object already has a likelihood, a posterior, samples or a measured bin. Fitting photometry, training a classifier or simulating a detector happens before it.

  • Use posteriors whose prior is unknown. Without its interim prior, binference cannot turn a posterior back into a likelihood.

  • Fit a population without bins. The population is a histogram on your bins, optionally with a finer B-spline Basis. binference has no parametric population models, such as a power law, and no neural density models (Neural and simulation-based deconvolution).

  • Let the population depend on other variables. All objects share one population; binference has no covariate-dependent populations.

  • Model correlated objects. The model multiplies the objects’ likelihoods, so it treats their data as independent given the population (theory).