Latest release bilby 2.8.2 · 2026-08-10 Release notes PyPI conda-forge

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

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.

Samplers

SamplerMethodProvided by
dynestynestedbilby
bilby-mcmcMCMCbilby
emceeMCMCbilby
nessainested + flowsplugin
ultranestnestedplugin
PyMCHMCplugin
zeusensemble sliceplugin
ptemceeparallel temperingplugin
PolyChordnestedplugin
MultiNestnestedplugin
nestlenestedplugin
DNest4diffusive nestedplugin

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

  • Transients redback

    Bayesian inference and modelling of electromagnetic transients, built on bilby.

    Source

Results

  • Results PESummary

    Summary pages and plots for parameter-estimation results, including bilby's.

    Source

Using bilby in your package? Let us know and we'll add it here. Tell us about it

Citing bilby

If bilby contributes to your research, please cite the papers below.

Citation guide
  • BILBY: A user-friendly Bayesian inference library for gravitational-wave astronomy

    Ashton et al., ApJS 241, 27 (2019) · arXiv:1811.02042

    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}
    }
  • Bayesian inference for compact binary coalescences with BILBY: validation and application to the first LIGO-Virgo gravitational-wave transient catalogue

    Romero-Shaw et al., MNRAS 499, 3295 (2020) · arXiv:2006.00714

    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.