Bayesian inference made simple.
bilby is a user-friendly Bayesian inference library for Python. Define a likelihood and priors, pick any of a dozen samplers, and get posteriors and evidences back, from fitting a straight line to measuring the masses of merging black holes.
Install
pip install bilby
conda install -c conda-forge bilby
uv add bilby
pip install "bilby[gw]"
Find your way
Try bilby without installing it
Choose an example, change anything you like, and run it. The code runs in your browser with Pyodide, so nothing leaves your computer.
Press Run (or Ctrl/⌘+Enter) to sample in your browser with Pyodide. Nothing is installed on your computer.
Runs on one CPU core in your browser. For more examples, including gravitational-wave analyses, open the full examples site.
What bilby does
- Any sampler, one interface
- Switch between dynesty, emcee, bilby-mcmc, nessai, ultranest, PyMC and more by changing one keyword. Sampler plugins let anyone add their own.
- Gravitational-wave ready
- bilby.gw provides waveforms, detector networks, calibration and marginalised likelihoods. It underpins inference for LIGO-Virgo-KAGRA catalogues.
- Priors that make sense
- A rich library of priors, including conditional, joint and constrained distributions, that you combine with plain Python.
- Results you can share
- Corner plots, evidences, and portable result files in HDF5 or JSON, ready for hierarchical and population analyses with bilby.hyper.
The bilby ecosystem
bilby is the core of a family of packages for pipelines, population studies and astrophysical transients.
Gravitational waves
-
Gravitational waves
bilby_pipe
Configure and run bilby gravitational-wave analyses on a computing cluster from a single ini file.
Source -
Gravitational waves
parallel_bilby
Run bilby gravitational-wave analyses across many CPUs with MPI.
Source -
Gravitational waves
bilby_tgr
Tests of general relativity with bilby.
Source
Populations
-
Populations
gwpopulation
Hierarchical population inference for gravitational-wave catalogues, built on bilby.
Source
Transients
Results
Using bilby in your package? Let us know and we'll add it here. Tell us about it
-
BILBY: A user-friendly Bayesian inference library for gravitational-wave astronomy
BibTeX
@article{Ashton_2019, title = {Bilby: A User-friendly Bayesian Inference Library for Gravitational-wave Astronomy}, volume = {241}, ISSN = {1538-4365}, url = {http://dx.doi.org/10.3847/1538-4365/ab06fc}, DOI = {10.3847/1538-4365/ab06fc}, number = {2}, journal = {The Astrophysical Journal Supplement Series}, publisher = {American Astronomical Society}, author = {Ashton, Gregory and Hübner, Moritz and Lasky, Paul D. and Talbot, Colm and Ackley, Kendall and Biscoveanu, Sylvia and Chu, Qi and Divakarla, Atul and Easter, Paul J. and Goncharov, Boris and Vivanco, Francisco Hernandez and Harms, Jan and Lower, Marcus E. and Meadors, Grant D. and Melchor, Denyz and Payne, Ethan and Pitkin, Matthew D. and Powell, Jade and Sarin, Nikhil and Smith, Rory J. E. and Thrane, Eric}, year = {2019}, month = Apr, pages = {27} } -
BibTeX
@article{Romero_Shaw_2020, title = {Bayesian inference for compact binary coalescences with <scp>bilby</scp> : validation and application to the first LIGO–Virgo gravitational-wave transient catalogue}, volume = {499}, ISSN = {1365-2966}, url = {http://dx.doi.org/10.1093/mnras/staa2850}, DOI = {10.1093/mnras/staa2850}, number = {3}, journal = {Monthly Notices of the Royal Astronomical Society}, publisher = {Oxford University Press (OUP)}, author = {Romero-Shaw, I M and Talbot, C and Biscoveanu, S and D’Emilio, V and Ashton, G and Berry, C P L and Coughlin, S and Galaudage, S and Hoy, C and Hübner, M and Phukon, K S and Pitkin, M and Rizzo, M and Sarin, N and Smith, R and Stevenson, S and Vajpeyi, A and Arène, M and Athar, K and Banagiri, S and Bose, N and Carney, M and Chatziioannou, K and Clark, J A and Colleoni, M and Cotesta, R and Edelman, B and Estellés, H and García-Quirós, C and Ghosh, Abhirup and Green, R and Haster, C-J and Husa, S and Keitel, D and Kim, A X and Hernandez-Vivanco, F and Magaña Hernandez, I and Karathanasis, C and Lasky, P D and De Lillo, N and Lower, M E and Macleod, D and Mateu-Lucena, M and Miller, A and Millhouse, M and Morisaki, S and Oh, S H and Ossokine, S and Payne, E and Powell, J and Pratten, G and Pürrer, M and Ramos-Buades, A and Raymond, V and Thrane, E and Veitch, J and Williams, D and Williams, M J and Xiao, L}, year = {2020}, month = Sept, pages = {3295–3319} }
Community
bilby is developed in the open by researchers across gravitational-wave astronomy and beyond. Everyone is welcome.