Bayesian Analysis in Cosmology
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.