Scientific Background: Measuring the Universe with Supernovae
ASTR 596: Modeling the Universe¶
“Equipped with his five senses, man explores the universe around him and calls the adventure Science.”
— Edwin Hubble
The 1998 Revolution¶
In 1998, two independent teams studying distant Type Ia supernovae made a discovery so unexpected that it overturned our understanding of the cosmos: the expansion of the universe is accelerating.
This was shocking. Gravity should be slowing down the expansion. Imagine throwing a ball upward — gravity pulls it back. The universe should behave the same way. But observations showed the opposite: the expansion is speeding up, as if some mysterious “dark energy” is pushing space apart.
The 2011 Nobel Prize in Physics recognized this discovery. In Project 4, you’ll analyze the same data using the same methods.
Why Type Ia Supernovae Are Special¶
The Physics: A Cosmic Bomb¶
Type Ia supernovae occur when a white dwarf (the dense core remnant of a Sun-like star) in a binary system accretes matter from its companion. When the white dwarf reaches the Chandrasekhar limit (), electron degeneracy pressure can no longer support it, and the entire star undergoes runaway thermonuclear fusion in seconds.
Why this matters: Because they all explode at roughly the same mass, Type Ia supernovae have remarkably similar intrinsic luminosities. With careful calibration (accounting for light curve shapes and colors), they become standardizable candles — objects whose true brightness we know.
Standard Candles: Nature’s Gift to Cosmologists¶
If you know an object’s intrinsic luminosity and measure its observed flux , you can determine its distance:
where is the luminosity distance. In astronomy, we work with magnitudes instead of flux. The distance modulus is:
where:
is the apparent magnitude (what we measure)
is the absolute magnitude (the apparent magnitude the object would have if placed at a standard distance of 10 pc)
is the luminosity distance in parsecs
For our purposes, we’ll use a more convenient form with in Mpc and factoring out the Hubble constant:
where is the luminosity distance computed with (i.e., with km/s/Mpc), and is the Hubble constant.
Understanding the -factorization: The luminosity distance naturally contains km/s/Mpc in the denominator. By defining as the distance computed with , we can write the actual luminosity distance as . This separates the expansion rate normalization () from the shape of the distance-redshift relation (which depends on and ). When computing , we then have:
This form is computationally convenient because needs to be computed only once for given cosmological parameters, and the dependence enters analytically.
What We’re Measuring: The Contents of the Universe¶
The distance-redshift relationship depends on what the universe is made of. Three parameters govern cosmic expansion:
: Matter Density Parameter¶
This is the ratio of the current matter density (dark matter + baryonic matter) to the critical density — the density needed for a flat universe. Current measurements give .
Physical interpretation: About 30% of the universe’s energy budget is matter. The remaining ~70% is dark energy.
: Dark Energy Density Parameter¶
This parameterizes the “cosmological constant” — Einstein’s biggest “blunder” that turned out to be real. Dark energy has negative pressure and causes accelerated expansion. Measurements give .
Physical interpretation: Dark energy dominates the universe today. We don’t know what it is — this is one of the biggest mysteries in physics.
: Normalized Hubble Constant¶
The Hubble constant sets the current expansion rate of the universe. The parameter is dimensionless and roughly , meaning .
Physical interpretation: For every megaparsec of distance, recession velocity increases by about 70 km/s. This tells us the age and size of the observable universe.
The Flatness Constraint¶
For a “flat” universe (zero spatial curvature), we have:
This is consistent with cosmic microwave background observations. The Planck 2018 results, when combined with baryon acoustic oscillations (BAO) measurements, find spatial curvature consistent with zero: (Planck Collaboration 2018), where is the curvature parameter. Note: The CMB alone provides weaker constraints; the tight bound requires combining Planck with complementary distance measurements like BAO.
Why this matters for parameter estimation: The flatness constraint provides a critical simplification. Instead of having three independent parameters , we can work with just two parameters by expressing dark energy in terms of matter density:
This reduces the dimensionality of our inference problem. We’re trading physical generality (allowing for spatial curvature) for statistical precision (tighter constraints on the remaining parameters). When , we’d need a third parameter, which enlarges uncertainty and introduces additional degeneracies.
Why is this justified? The flatness constraint comes from independent observations (CMB acoustic peaks, baryon acoustic oscillations), not from the supernova data itself. We’re combining multiple lines of evidence — this is more powerful than analyzing supernovae in isolation. The CMB tells us the universe is flat; supernovae tell us what fills that flat universe (matter vs. dark energy).
Physical interpretation: The flat universe assumption is well-motivated by inflationary cosmology, which predicts to extraordinary precision. Our analysis implicitly assumes this paradigm.
The Distance-Redshift Relation¶
Redshift: A Cosmic Speedometer¶
When we observe distant supernovae, their light is redshifted — stretched to longer wavelengths—due to cosmic expansion. The redshift is defined as:
where is the cosmic scale factor (normalized so ).
Physical interpretation: means the universe was 2/3 its current size when the light was emitted. means it was half the current size.
The Friedmann Equation¶
General relativity tells us how the scale factor evolves:
This is the Friedmann equation. Each term corresponds to a component with different evolution because each has a different equation of state.
Equation of State: The relationship between pressure and energy density for a cosmic fluid:
where is the equation of state parameter. This determines how energy density scales with the scale factor:
The three components:
| Component | Scaling | Physical Reason | |
|---|---|---|---|
| Matter (CDM) | 0 | Volume dilution only | |
| Radiation | Volume dilution + redshift | ||
| Dark Energy () | -1 | (constant) | Vacuum energy density doesn’t dilute |
Why matter dilutes as : As the universe expands, the number density of particles decreases as (inverse volume). Since matter has negligible pressure (), the energy density is just .
Why dark energy stays constant: An equation of state means negative pressure . This is the defining property of a cosmological constant — the energy density of empty space itself, which doesn’t change as space expands.
The Friedmann equation above can be rewritten to show each component’s contribution explicitly:
where is the curvature density parameter. For a flat universe, .
Luminosity Distance Formula¶
For the general case (including spatial curvature), the luminosity distance requires the transverse comoving distance with the mapping:
where:
and the function depends on spatial curvature:
For the flat case (, which we use in this project), this simplifies significantly:
where:
In the flat case, is the speed of light.
Understanding the formula: The integral computes the comoving distance (distance in coordinates that expand with the universe). For flat space, this comoving distance multiplied by gives the luminosity distance directly. The factor converts from dimensionless integration variable to physical distance, while the integrand reflects how the expansion rate changes with redshift.
Key insight: The shape of depends on . By measuring at many redshifts, we constrain these parameters.
The Flat Universe Simplification¶
For a flat universe (), this becomes:
Alternatively, this can be written in terms of the dimensionless Hubble parameter :
where:
for the flat case. This parameterization is convenient because it clearly shows how different components contribute to the expansion rate at different epochs.
Computational note: You should implement both methods and verify they agree — this is an excellent validation strategy for your forward model.
Method 1: Numerical Integration using scipy.integrate.quad():
Define the integrand for the flat case
Integrate from 0 to
Multiply by to get (flat case)
More general: For non-flat universes, integrate with the full including curvature, then wrap the integral result with the mapping as shown in the general formula above
Method 2: Pen (1999) Fitting Formula:
Use the analytical approximation below
Much faster (no numerical integration)
Accurate to 0.4% for
Why implement both? If your two implementations agree to within ~0.4%, you can be confident your forward model is correct. This is how professional astronomers validate their code — independent implementations should give (roughly) the same answer. Additionally, comparing execution time teaches you about computational trade-offs: numerical integration is flexible but slow, while fitting formulas are fast but limited in scope.
The Pen (1999) fitting formula:
where:
and .
Worked Example: Computing Luminosity Distance¶
Let’s compute and for a supernova at redshift in a flat universe with and .
Given:
→
→
Step 1: Compute the integral
We need to evaluate:
Evaluating numerically (or using Pen’s formula) with high precision:
Step 2: Compute luminosity distance
Step 3: Compute (with factored out)
Since is defined as the luminosity distance computed with (i.e., km/s/Mpc), we have:
Alternatively, compute directly with km/s/Mpc:
Step 4: Compute distance modulus
Verification: You can check this against Ned Wright’s Cosmology Calculator with these parameters. Your implementation should reproduce this result to within accuracy.
How Different Cosmologies Look¶
The key observational signature is how differs between cosmological models:
Matter-dominated universe ():
Expansion decelerates rapidly
Distant SNe appear brighter than expected (closer than they should be)
Accelerating universe ():
Expansion accelerates at late times
Distant SNe appear fainter than expected (farther than they should be)
Empty universe ():
Linear expansion (Hubble flow)
Reference case
The 1998 teams found that high-redshift supernovae were systematically fainter than predicted by matter-dominated models—direct evidence for cosmic acceleration.
The Data: JLA Sample¶
The Joint Light-curve Analysis (JLA) sample combines data from:
Supernova Legacy Survey (SNLS)
SDSS-II Supernova Survey
Nearby supernova samples
HST observations
What you’ll work with:
n = 31 redshift bins covering
Each bin contains averaged measurements from multiple supernovae
Distance modulus and redshift for each bin
31×31 covariance matrix accounting for statistical and systematic uncertainties
Why a covariance matrix? Uncertainties are correlated between bins due to:
Common systematic uncertainties (calibration, extinction corrections)
Light curve fitting procedures
Shared observational campaigns
Ignoring these correlations gives wrong error bars. The full covariance matrix is essential.
Critical importance: If you treat errors as independent (using only a diagonal covariance matrix), you’ll systematically underestimate your uncertainties. Common systematics like photometric calibration errors shift all data points together in the same direction—a calibration error of 2% affects every supernova in the sample. When you ignore correlations, the data appears artificially constraining because you’re counting the same systematic uncertainty 31 separate times instead of once. This is a dangerous mistake in scientific inference that leads to falsely confident conclusions.
The Inference Problem: Forward vs. Inverse¶
The Forward Problem (Easy)¶
Given cosmological parameters :
Compute for each supernova redshift
Predict
This is a deterministic calculation — just plug in numbers.
The Inverse Problem (Hard)¶
Given observed and covariance :
What values of are most consistent with the data?
What’s the uncertainty on these parameters?
Are they correlated? (If I increase , must I also change ?)
This is an inference problem. You need:
A likelihood function
Prior probabilities
A way to sample the posterior
That’s where MCMC comes in.
The Likelihood Function¶
For Gaussian errors with covariance , the log-likelihood is:
which can be written more compactly in matrix notation as:
where the residual vector is:
and for the flat case.
Understanding each term:
The first term is the chi-squared statistic, measuring how well the model fits the data while properly accounting for correlated errors
The second term is a normalization factor ensuring the Gaussian integrates to 1. Since is the data covariance (fixed, independent of model parameters ), this term is just a constant in our inference problem.
The third term is another normalization constant for the Gaussian probability density
Practical note: The constant terms and don’t affect MCMC sampling (they cancel in acceptance ratios since is independent of ), so you can omit them for computational efficiency:
However, including the full expression is good practice for understanding the probabilistic framework and becomes essential if comparing models with different numbers of parameters (e.g., via Bayesian evidence).
Why This Is Hard: Degeneracies and Tensions¶
Parameter Degeneracies¶
and are correlated (degenerate). Since , you can increase (more matter → slower expansion → objects appear closer/brighter) and simultaneously decrease (larger distances → objects appear farther/fainter) to keep roughly constant. This creates a negative correlation: ↔ .
This degeneracy produces a “banana-shaped” posterior distribution in the plane. MCMC efficiently explores this correlated structure.
The Hubble Tension¶
Different methods give different values for :
Early universe (CMB + Planck):
Late universe (SNe + SH0ES):
This discrepancy is called the Hubble Tension—an active crisis in cosmology.
Why this is a big deal: A 5σ discrepancy is statistically overwhelming — if both measurements are correct and systematic errors properly accounted for, there’s only about a 1-in-3.5-million chance this arose from random statistical fluctuations. When two precision measurements disagree at this level, something fundamental is wrong. Possible explanations:
Unknown systematics: One (or both) measurements has unaccounted systematic errors
New physics in the early universe: Extra radiation, early dark energy, or modifications to expansion history before recombination
Breakdown of ΛCDM: Our standard cosmological model may be incomplete
Local inhomogeneities: We may live in an underdense region affecting local measurements
Your measurement will fall somewhere between these values (around ), illustrating the tension firsthand. This isn’t a textbook exercise — you’re exploring an open question at the frontier of cosmology. The resolution of the Hubble Tension may require new physics beyond the Standard Model of cosmology, but that is beyond the scope of this course.
Connection to Module 5: This Is a Forward Model¶
Recall from Module 5 Part 1 the fundamental structure of computational science:
Physical law → Mathematical model (Friedmann equations)
Forward model → Predict observables ( from )
Inverse problem → Infer parameters from noisy measurements
Sampling → Use MCMC to explore parameter space
This project brings together everything:
Module 1: Statistical thinking, sampling, the CLT
Module 2: You’ll see echoes of thermal equilibrium in MCMC convergence
Module 5: Bayesian inference, Metropolis-Hastings, diagnostics
Project 2: Leapfrog integration repurposed for HMC
You’re not just analyzing data — you’re measuring the composition of the universe using Nobel Prize-winning methods you built from scratch. This is the project where you are legitimately modeling the universe.
Further Reading¶
Original Papers:
Riess et al. (1998): “Observational Evidence from Supernovae for an Accelerating Universe...” (AJ 116, 1009)
Perlmutter et al. (1999): “Measurements of Omega and Lambda from 42 High-Redshift Supernovae” (ApJ 517, 565)
Data Release:
Betoule et al. (2014): “Improved cosmological constraints from a joint analysis...” (JLA sample) (A&A 568, A22)
Cosmology Background:
Hogg (1999): “Distance measures in cosmology” (arXiv:astro
-ph /9905116) Pen (1999): “Brief Note: Analytical Fit to the Luminosity Distance for Flat Cosmologies with a Cosmological Constant” (arXiv:astro
-ph /9904172)
Verification Tools:
Now proceed to the Project 4 Description to learn what you’ll implement.