Cobaya: Code for Bayesian Analysis of hierarchical physical models

Jesus Torrado, Antony Lewis
5/11/2020
astro-ph.IMastro-ph.CO

Official code: CobayaSampler/cobaya (182 stars, last commit 2026-08-25).

Abstract

We present Cobaya, a general-purpose Bayesian analysis code aimed at models with complex internal interdependencies. Without the need for specific code by the user, interdependencies between different stages of a model pipeline are exploited for sampling efficiency: intermediate results are automatically cached, and parameters are grouped in blocks according to their dependencies and optimally sorted, taking into account their individual computational costs, so as to minimize the cost of their variation during sampling, thanks to a novel algorithm. Cobaya allows exploration of posteriors using a range of Monte Carlo samplers, and also has functions for maximization and importance-reweighting of Monte Carlo samples with new priors and likelihoods. Cobaya is written in Python in a modular way that allows for extendability, use of calculations provided by external packages, and dynamical reparameterization without modifying its source. It can exploit hybrid OpenMP/MPI parallelization, and has sub-millisecond overhead per posterior evaluation. Though Cobaya is a general purpose statistical framework, it includes interfaces to a set of cosmological Boltzmann codes and likelihoods (the latter being agnostic with respect to the choice of the former), and automatic installers for external dependencies.

View on arXivView PDF

Code Implementations(1)

Code for Bayesian Analysis

182169TeX, ShellSep 16, 20181 months agoNOASSERTION
bayesian-inferencecosmological-inferencemcmc-sampler

Similar Papers

Cite this paper

@article{torrado2020cobaya,
  title  = {Cobaya: Code for Bayesian Analysis of hierarchical physical models},
  author = {Jesus Torrado and Antony Lewis},
  year   = {2020},
  eprint = {2005.05290},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2005.05290}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2005.05290.svg)](https://codeofpaper.com/paper/2005.05290)

Discussion