Covariance Handling
Both probes enter the likelihood through their full covariance matrices, not through diagonal errors. This page explains how the matrices are loaded, aligned with the data and used.
At a glance
| Pantheon+SH0ES | DESI DR2 BAO | |
|---|---|---|
| Matrix | STAT+SYS | full BAO covariance |
| Size used | 1,590 × 1,590 | 13 × 13 |
| Loaded by | load_pantheon_covariance | load_desi_bao |
| Inversion | numpy.linalg.inv, once | numpy.linalg.inv, once |
Pantheon+SH0ES: STAT+SYS, subset to the kept supernovae
The .cov file stores N on its first line, then N² entries. The loader reshapes them to an N × N matrix and raises an error if the count does not match. After the redshift cut, it extracts the rows and columns of the kept supernovae (cov_full[np.ix_(kept_idx, kept_idx)]), so the matrix stays aligned with the retained distance moduli, and inverts it once. The inverse is stored and reused at every MCMC step.
Cutting rows and columns of the full matrix keeps the correlations between the retained supernovae unchanged; it does not renormalise anything.
DESI BAO: full matrix, with a shape check
The covariance file is read with numpy.loadtxt and, if it comes flat, reshaped to a square matrix. The loader checks that its dimensions match the number of parsed measurements before inverting.
Independence between probes
The combined χ² is the sum of the supernova and BAO terms. This assumes no covariance between the two probes — there is no cross-block in the code. The assumption is not tested in the pipeline.
plot_bao_residuals normalises each residual by the square root of the diagonal of the BAO covariance (obtained by inverting the stored inverse). This is a convenient visual scale; the likelihood uses the full matrix, so correlated points can look discrepant individually without contributing much to χ².