Skip to main content
Sandbox Physics
Pulsar timing arrays and the Hellings–Downs curve

Recompute a Hellings–Downs statistic from NANOGrav 15-year data

Sandbox Physics ·

This guide recomputes a simplified optimal statistic from public NANOGrav 15-year products and calibrates it the way the collaboration did, with phase shifts and sky scrambles. With the preferred noise model, the Hellings–Downs statistic of the real data sits 3.83.8 standard deviations of its phase-shift null above zero: one of 1000 phase shifts did as well, so p=0.002p=0.002. Sky scrambles give 3.43.4 standard deviations and p=0.004p=0.004. The guide does not reproduce the published amplitude: the recovered amplitude squared is about one twelfth of the published value, and the reason is not verified here. It also records three ways to get a misleading answer and the places where the papers and this recomputation disagree.

Read the optimal statistic and its null tests first; it defines every quantity used here. The reference paper is NANOGrav Collaboration, 2023, arXiv version 1.

Get the materials and run them

Download the scripts, frozen inputs and saved outputs and extract the archive. It holds six Python files for the statistic, four for the independent checks, two frozen input files, the four saved JSON outputs and a README. Everything uses only the Python standard library. The saved run used Python 3.9.6 and took 13 seconds.

cd pulsar-timing-optimal-statistic/optimal-statistic
python3 reproduce_optimal_statistic.py ../frozen-inputs ../my-run

The run writes inputs.json, outputs.json and failure-cases.json. Apart from the run time they should match the saved inputs, outputs and failure cases exactly, because both null distributions use fixed seeds.

What the frozen inputs are

The frozen inputs are derived from two public Zenodo records, both under CC-BY-4.0: the NANOGrav 15-year data set version 2.1.0 (record 16051178) and the per-pulsar noise spectra version 1.0.0 (record 8092346). An extraction script in the archive rebuilds them from those downloads in under a second. It writes no raw residual tables.

For each of the 67 pulsars the extraction averages the narrowband residuals by epoch, builds the basis W=[Fred ∣ M ∣ r]W=[F_{\mathrm{red}}\,|\,M\,|\,r] and stores Q=WTN−1WQ=W^{\mathsf T}N^{-1}W. Here FredF_{\mathrm{red}} holds sines and cosines at k/Tk/T for k=1k=1 to 1414, MM holds an offset, t/Tt/T and (t/T)2(t/T)^2, rr is the residual vector, and NN is the diagonal white noise from the averaged uncertainties. Every noise model below is a different prior on FredF_{\mathrm{red}}, so all of them can be computed from QQ alone.

Table 5.1 Choices of the saved run, compared with the NANOGrav analysis.
QuantityThis guideNANOGrav 15-year paper
Pulsars and pairs67 and 221167 and 2211
Time span TT16.03 yr16.03 yr
Signal frequencies5 bins, γ=13/3\gamma=13/314 bins, γ=13/3\gamma=13/3
Red-noise frequencies14 bins30 bins
Timing modeloffset, spin, spin-downfull timing model and DMX
White noiseaveraged TOA uncertaintiesEFAC, EQUAD and ECORR per backend
Pulsar noisefrozen NG15 spectra, 3 variantssampled power laws
Null trials1000 phase shifts, 1000 sky scrambles400 000 phase shifts, sky scrambles

From inner products to pair correlations

Given a red-noise prior φ\varphi on FredF_{\mathrm{red}}, the Woodbury identity gives the noise-weighted products without ever forming the full covariance:

R=Q−Q⋅F(φ−1+QFF)−1QF⋅.R=Q-Q_{\cdot F}\big(\varphi^{-1}+Q_{FF}\big)^{-1}Q_{F\cdot}.

Eliminating the three timing columns of RR by a Schur complement gives RGR_G. The signal blocks are X=RG[F,r]X=R_G[F,r] and Z=RG[F,F]Z=R_G[F,F], where FF is now the first ten columns. These are the quantities in eqs. 9 and 10 of the paper, with the spin fit marginalised.

import json
import optimal_statistic as statistic
import pulsar_projections as projections

products = json.load(open('../frozen-inputs/ng15-noise-weighted-inner-products.json'))
pulsar = products['pulsars'][0]
projection, covariance = projections.projections_for_pulsar(pulsar, 'spectrum-minus-white-floor')
print(pulsar['name'], len(projection), len(covariance))
print(round(statistic.hellings_downs(1.5707963), 4))

Run from the optimal-statistic folder, this prints B1855+09 with a ten-element projection and a ten-by-ten covariance, then −0.1449-0.1449, the Hellings–Downs value at a right angle.

Three noise models

The NG15 noise-spectra README states that each per-pulsar spectrum already contains white noise, the common-process power and any significant intrinsic red noise. That forces a choice.

The published-spectrum model uses the spectra as given and so counts white noise twice. The spectrum-minus-white-floor model subtracts each spectrum's value at 2×10−7 Hz2\times10^{-7}\,\mathrm{Hz} as its white floor; it is the preferred model. The common-process-only model ignores intrinsic red noise and keeps only a γ=13/3\gamma=13/3 process at A=2.4×10−15A=2.4\times10^{-15}.

Table 5.2 Saved results, real observation recomputed with the simplified model.
Noise modelA^2\hat A^2Formal S/NPhase-shift null spreadNull standard deviationsPhase-shift pSky-scramble p
published spectrum3.46×10−313.46\times10^{-31}0.410.172.40.0130.028
minus white floor4.90×10−314.90\times10^{-31}0.720.193.80.0020.004
common process only5.49×10−305.49\times10^{-30}8.317.451.10.140.10

Read the null columns, not the formal S/N. With 1000 trials the smallest possible p-value is 1/10011/1001, so p=0.002p=0.002 means one exceedance. The three-shape fit for the preferred model gives S/N values of 0.390.39 for the Hellings–Downs shape, 0.660.66 for a monopole and 0.120.12 for a dipole, all in units of the formal spread.

Failure cases

These come from the saved failure-cases.json.

  1. White noise counted twice. The published-spectrum model inflates the noise and drops the result from 3.8 to 2.4 null standard deviations.
  2. Intrinsic red noise ignored. The formal S/N jumps to 8.3, but the phase-shift null is just as wide, 7.4, and the result is only 1.1 null standard deviations. Unmodelled red noise in a few pulsars makes every pair noisy. A large formal S/N without a null test means nothing.
  3. Timing model not marginalised. Without the spin projection, A^2\hat A^2 drops by about a third, to 3.31×10−313.31\times10^{-31}, while the S/N barely moves.
  4. Amplitude not reproduced. The preferred model recovers 0.0850.085 of the published A2=5.76×10−30A^2=5.76\times10^{-30}, and its null spread is 0.190.19 instead of about one. Both say the noise model is too large for the post-fit residuals. The likely cause is power absorbed by the full timing and DMX fit that this guide leaves out. That is a hypothesis, not a verified result.

Independent checks

The verification scripts do not reuse the closed-form curve to test itself. A direct sky quadrature of explicit antenna patterns matches the NANOGrav closed form within 3.5×10−43.5\times10^{-4} and Allen's single-source variance within 9×10−59\times10^{-5}. Allen, 2022, eqs. 2.4 and 2.6 An ensemble of 60 plane waves, averaged over 10 000 realisations, follows the curve with a largest deviation of 1.091.09 standard errors. An offline injection study with synthetic coefficients at the real positions measures false alarms and coverage; its numbers are in the optimal-statistic chapter.

Printed values that differ from the recomputation

Table 5.3 Places where a paper and this recomputation, or two papers, disagree. Each is reported as found; none is corrected.
ItemPrintedUsed or foundNote
First zero crossing of the curve49.2∘49.2^\circ49.32∘49.32^\circthe formula is +0.001+0.001 at 49.2∘49.2^\circ
Antenna-pattern denominator1−Ω^⋅p^1-\hat\Omega\cdot\hat p in the anisotropy paper1+Ω^⋅p^1+\hat\Omega\cdot\hat psame function; there Ω^\hat\Omega points to the source
Curve normalisation12\tfrac12 at zero separationAllen uses 13\tfrac13ratio 23\tfrac23
Data versionthe 2023 papers used the first releaseresiduals from version 2.1.0results may differ slightly for that reason
Signal bins in the optimal statistic145a deliberate simplification

The anisotropy paper is NANOGrav Collaboration, 2023b. Two classic papers were not opened for this guide: Hellings and Downs 1983 and Gair and colleagues 2014. Their results are used only as quoted in the NANOGrav paper.

What this recomputation does not show

It does not measure the background amplitude, does not reproduce the formal S/N of 4±14\pm1 quoted in Section 4 of the paper, and does not test the Bayesian analysis or the Bayes factors. It shows that a simple, transparent statistic on the public products already finds Hellings–Downs-shaped correlations well outside what phase shifts and sky scrambles produce, and that the conclusion depends on how noise is modelled.

Sources

  1. NANOGrav Collaboration, 2023, arXiv version 1
  2. Allen, 2022, eqs. 2.4 and 2.6
  3. NANOGrav Collaboration, 2023b

Keep reading

What this page links to directly

See this series on the content map →

Pulsar timing arrays and the Hellings–Downs curve · Reading path

From one ticking pulsar to a Galaxy-sized detector

  1. ArticleHow can a pulsar timing array tell gravitational waves from a bad clock?
  2. ArticleWhat a pulsar timing residual measures
  3. ArticleDeriving the Hellings–Downs curve
  4. ArticleThe optimal statistic and its null tests
  5. You are hereRecompute a Hellings–Downs statistic from NANOGrav 15-year data
  6. ArticleReading the NANOGrav 15-year evidence for a gravitational-wave background
Something broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy