binference
Population and hierarchical inference with PDFs.
Many objects are each measured with noise: galaxies, merger events, patients, classified documents. binference reads each object's likelihood, posterior, samples, binned measurement or classifier output. From these it infers the population the objects come from, with calibrated uncertainty, and each object's posterior under that population.
The population inferred from 2000 simulated objects, under the default Dirichlet prior (top) and a Gaussian-process prior (bottom). Each panel shows the posterior median, its 68% and 95% intervals, the true density (dashed) and the stacked estimate (dotted).
Install
pip install "binference[plot]"
The installation page lists the extras and the supported Python versions.
Example
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())
Documentation
To contribute, see CONTRIBUTING.md.
Status and citing
binference is alpha software, and its API may change before 1.0. If you use it, please cite it as described on the citing page.
License
MIT; see LICENSE.
Metadata
Release files for binference 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| binference-0.1.0.tar.gz | 291.6 kB | With provenance | Details for binference-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| binference-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for binference-0.1.0-py3-none-any.whl |
Total release size: 500.9 kB
Release files / binference-0.1.0.tar.gz
| Download URL | binference-0.1.0.tar.gz |
|---|---|
| Size | 291.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a05c57c947be7c144a9c797c5303d2be9f353f4e1f166eb8a6e0c20f2c6765c0
|
|
BLAKE2b-256 checksum How to use checksums |
79ec8011930051fd259add68e8acae3e397a51b8dd7bedb3684cf84e7c3f7ff5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logRelease files / binference-0.1.0-py3-none-any.whl
| Download URL | binference-0.1.0-py3-none-any.whl |
|---|---|
| Size | 209.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c191462311a2cf608a5b813e38a1398de0866ef8c360211ee4d08d12e0d4a7f
|
|
BLAKE2b-256 checksum How to use checksums |
d78a7751b52870386f949c0f141592d989f6bea06578139bc41f9255334db105
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logSecurity for binference 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for binference-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.