Baryonic Acoustic Oscillations

Synopsis:BAO, f_sigma8 and other measurements at single redshifts, with correlations
Author:Antony Lewis (adapted to Cobaya by Jesus Torrado, with little modification)

This code provides a template for BAO, \(f\sigma_8\), \(H\) and other redshift dependent functions.

The datasets implemented at this moment are:

  • bao.sixdf_2011_bao
  • bao.sdss_dr7_mgs
  • bao.sdss_dr12_consensus_bao
  • bao.sdss_dr12_consensus_full_shape
  • bao.sdss_dr12_consensus_final (combined data of the previous two)


If you use the likelihood sixdf_2011_bao, please cite:
F. Beutler et al, The 6dF Galaxy Survey: baryon acoustic oscillations and the local Hubble constant (arXiv:1106.3366)

If you use the likelihood sdss_dr7_mgs, please cite:
A.J. Ross et al, The clustering of the SDSS DR7 main Galaxy sample - I. A 4 per cent distance measure at z = 0.15 (arXiv:1409.3242)

If you use any of the likelihoods sdss_dr12_*, please cite:
S. Alam et al, The clustering of galaxies in the completed SDSS-III Baryon Oscillation Spectroscopic Survey: cosmological analysis of the DR12 galaxy sample (arXiv:1607.03155)


To use any of these likelihoods, simply mention them in the likelihoods block, or add them using the input generator.

These likelihoods have no nuisance parameters or particular settings that you may want to change (except for the installation path; see below)

Defining your own BAO likelihood

You can use the likelihood bao.generic as a template for any BAO data.

To do that, create a file containing the data points, e.g. myBAO.dat, as

[z] [value at z] [quantity]

where you can use as many different quantities and redshifts as you like.

The available quantities are

  • DV_over_rs: Spherically-averaged distance, over sound horizon radius
  • rs_over_DV: Idem, inverse
  • DM_over_rs: Comoving angular diameter distance, over sound horizon radius
  • DA_over_rs: Physical angular diameter distance, over sound horizon radius
  • Hz_rs: Hubble parameter, times sound horizon radius
  • f_sigma8: Differential matter linear growth rate, times amplitude of present-day fuctuations
  • F_AP: Anisotropy (Alcock-Paczynski) parameter

In addition create a file, e.g. myBAO.cov, containing the covariance matrix for those data, with the same row order as the data file.

Now, add to your likelihood block:

measurements_file: /full/path/to/myBAO.dat
cov_file: /full/path/to/myBAO.cov         # either this one,
invcov_file: /full/path/to/myBAO_inv.cov  # or this one!
# Fiducial sound horizon with which data have been stored
rs_fid:  #  in Mpc
# [Optional] Speed in evaluations/second
# (will be measured automatically if not specified)
speed: 2500

You can rename your BAO likelihood and use multiple ones with different data (see Custom names and multiple instances of the same internal class).


This likelihood can be installed automatically as explained in Installing cosmological codes and data. If are following the instructions there (you should!), you don’t need to read the rest of this section.

Manual installation of the BAO likelihood data

Assuming you are installing all your likelihoods under /path/to/likelihoods, simply do

$ cd /path/to/likelihoods
$ git clone

After this, mention the path to this likelihood when you include it in an input file, e.g.

    path: /path/to/likelihoods/bao_data