Read Adding up electrons across an expanding universe and Why every sightline gives a different dispersion first; they derive the two ingredients used here. The paper is Macquart et al., 2020, arXiv version 1, published in Nature 581, 391.
Get the materials and run them
Download the scripts, inputs and saved outputs and extract the archive. It contains six Python files, the three saved JSON files and a short README. The scripts use only the Python standard library. The saved run used Python 3.9.6 and took 113 seconds.
cd frb-baryon-census/scripts
python3 reproduce_benchmarks.py ../my-run
The run writes inputs.json, outputs.json and failure-cases.json into the folder you name. A rerun reproduces the saved files byte for byte. The same files are served as inputs, outputs and failure cases. Run from the scripts folder, because the main script imports its five siblings from there.
Fix the inputs and units
Dispersion measures are in pccm−3, distances in comoving megaparsecs and masses in solar masses. The fixed inputs are:
Macquart and colleagues scanned eμ from 20 to 200 and σhost from 0.2 to 2.0. Our grid is a little different, so small differences in the interval are expected.
Split each burst into its parts
Subtract the Milky Way's 80 to get DM′, compare with the mean cosmic value at the host redshift, and the remainder is what the host must supply, first as seen from Earth and then in the host's own frame.
A negative host term is not a mistake. It means the sightline has less cosmic gas than average. FRB 190611 is the one burst whose host Macquart and colleagues call tentative, and it is left out of the gold sample.
from frb_cosmology import dispersion_constant, mean_cosmic_dispersion
print(round(dispersion_constant(0.85), 2), round(mean_cosmic_dispersion(0.5), 2))
This prints 824.34 and 448.82: the constant K and the mean cosmic dispersion at z=0.5.
Build the likelihood
For each burst the probability of its DM′ is the convolution of the cosmic and host distributions, eq. 7 of the paper:
The host term is the log-normal of eq. 3, with median eμ in the host's rest frame, transformed to the observer by the factor 1/(1+z) as the Methods text after eq. 3 describes. The cosmic term is eq. 4 with Δ=DMcosmic/⟨DMcosmic⟩, σDM=Fz−1/2, and ⟨DMcosmic⟩ proportional to Ωbh70. The scripts solve for C0 by bisection so that the mean of Δ is 1 on 0.05≤Δ≤10. The total likelihood is the product over bursts, eq. 5. Priors are flat on the grid, and F, μ and σhost are summed out.
What the recomputation gives
The 95 percent interval of the grid runs from 0.0271 to 0.0734. The recomputation lands on the published frequentist value. The Markov-chain value is higher, which is consistent with its different priors and with fd(z) in place of our constant.
Two independent checks
The first check never uses the likelihood. It recomputes the mean relation with a separately written Gauss–Legendre rule, compares with Simpson's rule, and tests the two closed-form universes of the earlier chapter. All agree to about one part in 1015.
The second is a host injection. The scripts draw 40 synthetic bursts with known truth, Ωbh70=0.049, F=0.2, host median 100 and width 0.5, then fit them with the same grid. Over 20 such samples the mean recovered value is 0.04956, a bias of +0.00056, and the true value lies inside the 68 percent interval in 18 of 20. The likelihood recovers what was put in.
Six ways to get it wrong
The saved failure-cases.json records six mistakes and their size.
- Fitting all six bursts, including FRB 190611, gives 0.0394 with a 68 percent interval from 0.0277 to 0.0502. One burst with an uncertain host pulls the answer down by a fifth.
- Setting the Milky Way halo to zero instead of 50 gives 0.0562: the 50 is attributed to cosmic gas.
- Counting one free electron per proton mass, as if there were no helium, gives 0.0442, because each baryon then supplies too many electrons.
- Reading the observed residual as a rest-frame host value underestimates every host. For FRB 181112 the observed residual is 83.4, but the rest-frame value is 123.1.
- Reading dispersion as distance puts FRB 190608 at z=0.295 instead of 0.118, and FRB 190611 at 0.276 instead of 0.378. A dispersion measure is not a unique distance.
- Keeping only synthetic bursts with DM′<600, but fitting as if nothing were dropped, keeps about 23 of 40, biases the result by −0.0036 and leaves the truth inside the 68 percent interval in only 9 of 20 samples. A survey that misses high-dispersion bursts underestimates the baryon density.
What this does and does not establish
The recomputation shows that the published number follows from the published data, equations and Milky Way terms, and that the likelihood recovers injected values. It does not test the Milky Way halo value, the host model or the choice of gold sample; each of those moves the answer by about its error bar, as the failure cases show. Five bursts constrain the baryon density to between 20 and 30 percent. The newer and larger sample is discussed in Reading the FRB baryon census papers, and the halo-gas model behind F is described by Prochaska and Zheng, 2019, Section 7.1.