Skip to main content

Bayesian Analysis in Cosmology

Project description

Author: Jesus Torrado and Antony Lewis
Source:Source code at GitHub
Documentation:Documentation at Readthedocs
Licensing:LGPL (source) and GFDL (documentation) – exceptions: see LICENCE.txt

cobaya (COde for BAYesian Analysis; Guinea Pig, in Spanish) is a framework for sampling and statistical modelling: it allows you to explore any prior or posterior using a range of Monte Carlo samplers (including the advanced MCMC sampler from CosmoMC, and the advanced nested sampler PolyChord). The results of the sampling can be analysed with GetDist.

Its authors are Jesus Torrado and Antony Lewis. Some ideas and modules have been adapted from Monte Python, by Julien Lesgourgues and Benjamin Audren (in particular, the interface to the Planck 2015 likelihoods).

Though cobaya is a general purpose statistical framework, it includes interfaces to cosmological theory codes (CAMB and CLASS) and experimental likelihoods (in this version, Planck 2015 and Bicep-Keck 2015). The interfaces to most cosmological likelihoods are agnostic as to which theory code is used to compute the observables, which facilitates comparison between those codes.

cobaya has an overhead ~0.5ms per posterior evaluation, which makes it suitable for most cosmological applications (CAMB and CLASS take seconds to run), but not necessarily for more general statistical applications, if the evaluation time per pdf involved is of that order or smaller.

cobaya has been conceived from the beginning to be highly and effortlessly extensible: without touching cobaya’s source code, you can define your own priors and likelihoods, use modified versions of a theory code (just pass cobaya their folder!), create new parameters as function of other parameters… You can also use cobaya simply as a wrapper for cosmological likelihoods to integrate them in your analysis pipeline.

In addition, it downloads and install requirements automatically (samplers, theory codes and likelihoods); it supports MPI parallelization and HPC containerization (Singularity and Docker+Shifter; the later is WIP); and it can be run either from the shell or from a Python interpreter/notebook, and takes input either as YAML files or Python dictionaries.

How to cite us

As of this version, there is no scientific publication yet associated to this software, so simply mention its GitHub repository (see above).

To appropriately cite the modules (samplers, theory codes, likelihoods) that you have used, simply run the script cobaya-citation with your input file(s) as argument(s), and you will get bibtex references and a short suggested text snippet for each module mentioned in your input file.


Thanks to Guadalupe Cañas Herrera for extensive and somewhat painful testing.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
cobaya-0.126.tar.gz (132.9 kB) Copy SHA256 hash SHA256 Source None Apr 20, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page