CosmoFit.CosmologyParameters¶
- class CosmoFit.CosmologyParameters(H0, Omega_m, Omega_k=0.0, w0=-1.0, wa=0.0, rd=147.05, MB=-19.3, Omega_b=0.0493, A_s=0.7, alpha=0.0, sigma8=0.811, n_s=0.9649, ln1e10As=3.044, tau_reio=0.0544, N_eff=3.044, m_nu=0.06, A_planck=1.0)[source]¶
Bases:
BaseParametersGeneric container for the parameters shared by every cosmological model implemented in CosmoFit (LCDM, CPL, …).
Models that do not use a given parameter simply ignore it (e.g. LCDM ignores
w0/wa).- Parameters:
H0 (float) – Hubble constant today [km/s/Mpc].
Omega_m (float) – Present-day matter density parameter.
Omega_k (float, optional) – Present-day curvature density parameter. Default 0 (flat universe).
w0 (float, optional) – Dark-energy equation-of-state parameter at z=0. Default -1 (cosmological constant).
wa (float, optional) – CPL evolution parameter. Default 0.
rd (float, optional) – Sound horizon at the drag epoch [Mpc], used as a free nuisance parameter for BAO analyses.
MB (float, optional) – Supernova absolute magnitude nuisance parameter, used by likelihoods that do not analytically marginalize over it (
marginalize_MB=False/marginalize_offset=FalseonPantheonLikelihood/DESSN5YRLikelihood). Default is a typical SN Ia peak absolute magnitude, insideDEFAULT_BOUNDS’s"MB"range – unlike every other default here,0.0would sit outside that range, which fails the initial-walker check ifMBis fit as free, or silently inflates chi2 by ~19 magnitudes if it’s left fixed instead.Omega_b (float, optional) – Present-day baryon density parameter. Not used by the background expansion (E(z)) itself, but required by the recombination fitting formulas (redshift of decoupling z*, sound horizon r_s) used by
PlanckLikelihood. Default is the Planck 2018 best-fit value.A_s (float, optional) – Generalized Chaplygin Gas density parameter (0 < A_s < 1), used only by
GCG. Equal to -w(z=0) in that model (A_s=1 reduces GCG to flat/curved LCDM). Default 0.7.alpha (float, optional) – Generalized Chaplygin Gas exponent in p = -A/rho^alpha, used only by
GCG(alpha=1 is the original/”pure” Chaplygin gas). Default 0.sigma8 (float, optional) – Present-day linear matter power spectrum normalization (RMS density contrast in 8 Mpc/h spheres). Used only by the growth-of-structure machinery (
GrowthCalculator,FSigma8Likelihood,S8Likelihood) – every model computes its own scale-independent growth factor D(z) fromE(z)/dEdz/mu(a,k);sigma8only sets its overall normalization. Default is the Planck 2018 best-fit value.n_s (float, optional) – Scalar spectral index of the primordial power spectrum. Inert for every background-only fit; used only when a Boltzmann code computes CMB anisotropies from scratch (
PlanckLiteLikelihood). Default is the Planck 2018 best-fit value.ln1e10As (float, optional) –
ln(10^10 A_s), the log primordial scalar amplitude at k = 0.05 /Mpc – the parameter CMB analyses sample, sinceA_sitself spans orders of magnitude.Deliberately not named
A_s: that name is already taken in this container by the Generalized Chaplygin Gas density parameter, a completely unrelated quantity that happens to share the symbol in its own literature. Two different physical quantities cannot share one field, and renaming the GCG parameter would invalidate every saved chain and script that names it, so the primordial amplitude carries the longer name. Inert outside a from-scratch CMB fit.tau_reio (float, optional) – Reionization optical depth. Inert outside a from-scratch CMB fit, where it damps the high-l spectra by
exp(-2 tau)and is degenerate withln1e10Asunless the"tau"dataset is included. Default is the Planck 2018 best-fit value.N_eff (float, optional) – Effective number of relativistic neutrino species. The Standard Model value (3.044) is the default; varying it tests for extra relativistic energy density (“dark radiation”), which shifts the sound horizon and so moves H0. Used by the sound-horizon and Boltzmann calculators, not by any model’s low-redshift
E(z).m_nu (float, optional) – Sum of the neutrino masses in eV. Default 0.06, the minimal normal-hierarchy value assumed by the Planck 2018 baseline. Like
N_eff, it enters the thermal history and the CMB, not the low-z background, where massive neutrinos are already counted insideOmega_m.A_planck (float, optional) – Planck absolute calibration, the one nuisance parameter
plik_liteleaves for a downstream fit (the ~20 foreground parameters of the full high-l likelihood have already been marginalized out of it). Every bandpower prediction is divided byA_planck^2. Planck’s own constraint on it is 1.000 +- 0.0025; leaving it fixed at 1 is what the referenceplik_liteimplementations do and costs almost nothing, so that is the default.
- __init__(H0, Omega_m, Omega_k=0.0, w0=-1.0, wa=0.0, rd=147.05, MB=-19.3, Omega_b=0.0493, A_s=0.7, alpha=0.0, sigma8=0.811, n_s=0.9649, ln1e10As=3.044, tau_reio=0.0544, N_eff=3.044, m_nu=0.06, A_planck=1.0)¶
Methods
__init__(H0, Omega_m[, Omega_k, w0, wa, rd, ...])as_dict()Convert parameters to a dictionary.
copy()Return a deep copy.
default_bounds()Default prior bounds for every parameter in this container: the module-level
DEFAULT_BOUNDS, plus any extra bounds contributed bybuild_params_class()for a custom model's extra parameters.defaults()Return the default values.
from_dict(values)Create from a dictionary.
from_numpy(theta)items()Iterate over (name, value) pairs.
names()Return the parameter names.
ndim()Return the number of parameters.
parameter_set([bounds])Build a
ParameterSetdescribing this container, with LaTeX labels and (by default)default_bounds().to_numpy()Return parameters as a NumPy vector.
update([theta])Update parameter values.
values()Return parameter values as a tuple.
Attributes
H0Omega_mOmega_kw0wardMBOmega_bA_salphasigma8n_sln1e10Astau_reioN_effm_nuA_planckthetaAlias for to_numpy().