CosmoFit.PantheonLikelihood¶
- class CosmoFit.PantheonLikelihood(cosmology, version='pantheon+sh0es', include_cepheid=False, marginalize_MB=True)[source]¶
Bases:
BaseLikelihood,AnalyticOffsetMixinPantheon+ / Pantheon+SH0ES Supernova likelihood.
- Parameters:
cosmology – Cosmology model instance (LCDM, CPL, …).
version (str) – Pantheon dataset version.
include_cepheid (bool) – If True, include Cepheid calibrator supernovae.
marginalize_MB (bool, optional) –
If True (default), 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.MBis added to the model as an explicit free/fixed nuisance parameter instead (m_B = mu(z) + M_B), useful when calibrating H0 with Cepheid distances.
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_dataNumber of data points.
name_and_sizeName together with the number of data points.