CosmoFit.PantheonLikelihood

class CosmoFit.PantheonLikelihood(cosmology, version='pantheon+sh0es', include_cepheid=False, marginalize_MB=None, z_min=0.01)[source]

Bases: BaseLikelihood, AnalyticOffsetMixin

Pantheon+ / Pantheon+SH0ES Supernova likelihood.

Parameters:
  • cosmology – Cosmology model instance (LCDM, CPL, …).

  • version (str) – Pantheon dataset version.

  • include_cepheid (bool) –

    If False (default), the Hubble-flow sample: the 1590 light curves with z_HD > 0.01, which constrain the shape of the distance-redshift relation but not its absolute scale.

    If True, the Pantheon+SH0ES sample: the 77 Cepheid-calibrator light curves are added, and for those the predicted distance modulus is the host galaxy’s Cepheid distance (CEPH_DIST) rather than the cosmological mu(z) – their redshifts are too small to say anything about the expansion, and their Cepheids are what fix M_B. That is what lets this one dataset measure H0 (Brout et al. 2022, Eqs. 14-15).

  • z_min (float) – Hubble-flow cut on z_HD. Default 0.01, as in every published Pantheon+ fit.

  • marginalize_MB (bool, optional) –

    If True (the default without Cepheids), the SN absolute magnitude (and, equivalently, the H0 - M_B degeneracy) is marginalized over analytically instead of being fit as an explicit nuisance parameter:

    chi2 = A - B^2 / C

    A = delta^T C^-1 delta B = 1^T C^-1 delta C = 1^T C^-1 1

    where delta = m_b_corr - mu_model(z). This is the standard approach for SN-only / SN+BAO+CC analyses that do not use a Cepheid host-distance calibration to break the H0-M_B degeneracy, and it is what the CPL_MCMC notebook this library reproduces uses.

    If False, cosmology.MB is added to the model as an explicit free/fixed nuisance parameter instead (m_B = mu(z) + M_B).

    Defaults to not include_cepheid. Marginalizing with the calibrators in is refused: the analytic marginalization removes exactly the absolute scale the Cepheids exist to supply, so the calibrators would be carried along and contribute nothing.

__init__(cosmology, version='pantheon+sh0es', include_cepheid=False, marginalize_MB=None, z_min=0.01)[source]
Parameters:
  • version (str)

  • include_cepheid (bool)

  • marginalize_MB (bool | None)

  • z_min (float)

Methods

__init__(cosmology[, version, ...])

best_fit_offset()

Best-fit additive offset that analytic marginalization would assign, given the current cosmology.

chi2()

Chi-square statistic.

log_likelihood()

Return log-likelihood.

marginalized_chi2()

Chi-square with the offset analytically marginalized out.

model()

Predicted apparent magnitude.

predictions()

Alias for model().

residuals()

Data minus model residuals.

summary()

Return a summary of the likelihood evaluation.

Attributes

n_data

Number of data points.

name_and_size

Name together with the number of data points.