---
title: "Recomputing a bright-siren and a dark-siren Hubble constant"
description: "Recompute the GW170817 result from public distance samples, then calibrate bright and dark siren inference on synthetic universes."
canonical_url: "https://sandboxphysics.com/stories/standard-sirens/recomputing-bright-and-dark-siren-h0/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/standard-sirens/recomputing-bright-and-dark-siren-h0/"
last_modified: "2026-11-14"
---

[Gravitational-wave standard sirens](https://sandboxphysics.com/stories/standard-sirens/)

# Recomputing a bright-siren and a dark-siren Hubble constant

Sandbox Physics · 2026-11-14

From the public GWTC-1 distance samples of GW170817 and a single Gaussian Hubble-flow velocity, we recomputed a bright-siren posterior with its maximum at $68.5\,\mathrm{km\,s^{-1}\,Mpc^{-1}}$ and a minimal 68.3 percent interval from $60.9$ to $86.4$. The published value is $70.0^{+12.0}_{-8.0}$. The difference is explained by two simplifications listed below. On synthetic universes, the same inference with the selection normalisation is calibrated for both bright and dark sirens and biased without it.

[Open the standard sirens Lab](https://sandboxphysics.com/labs/gravitational-wave-standard-sirens/)

This guide lists every input, command, version, output and failure case so that you can repeat both parts. The physics is in [from one distance and one redshift to the Hubble constant](https://sandboxphysics.com/stories/standard-sirens/from-distance-to-hubble-constant/) and [dark sirens, galaxy catalogs and the selection normalisation](https://sandboxphysics.com/stories/standard-sirens/dark-sirens-and-selection-effects/).

## What is real data and what is synthetic

**Table 5.1** The two parts of this guide.

| Part | Data | Status |
| --- | --- | --- |
| GW170817 bright siren | LVK GWTC-1 posterior samples, sky fixed to the counterpart | real detector data, reanalysed by LVK |
| Hubble-flow velocity | $3017\pm166\,\mathrm{km\,s^{-1}}$ from the discovery paper | published measurement |
| Calibration study | events, galaxies and noise drawn by our script | synthetic, known injected cosmology |
| Reference event | ten listed galaxy velocities and two amplitudes | synthetic, used to cross-check the Lab |

The samples come from the GWTC-1 data release, document LIGO-P1800370, version 5, file GW170817\_GWTC-1.hdf5. The page states no licence, so we do not redistribute the file. The script downloads it and refuses to run if the SHA-256 digest differs. [LIGO and Virgo, LIGO-P1800370-v5: Parameter estimation sample release for GWTC-1](https://dcc.ligo.org/LIGO-P1800370/public)

## Environment

We ran everything with Python 3.9.6, NumPy 1.26.4, SciPy 1.13.1 and h5py 3.14.0 on macOS. Units are megaparsecs for distance, $\mathrm{km\,s^{-1}}$ for velocity and $\mathrm{km\,s^{-1}\,Mpc^{-1}}$ for the Hubble constant. Keep the downloaded file and the scripts in separate folders.

```
mkdir -p siren-check/data siren-check/scripts
cd siren-check/scripts
curl --remote-name-all "https://sandboxphysics.com/stories/standard-sirens/materials/{siren_model.py,synthetic_siren_study.py,recompute_gw170817_bright_siren.py,study-inputs.json}"
python3 -m venv ../venv && ../venv/bin/pip install numpy==1.26.4 scipy==1.13.1 h5py==3.14.0
```

The files are [siren\_model.py](https://sandboxphysics.com/stories/standard-sirens/materials/siren_model.py), [synthetic\_siren\_study.py](https://sandboxphysics.com/stories/standard-sirens/materials/synthetic_siren_study.py), [recompute\_gw170817\_bright\_siren.py](https://sandboxphysics.com/stories/standard-sirens/materials/recompute_gw170817_bright_siren.py) and [study-inputs.json](https://sandboxphysics.com/stories/standard-sirens/materials/study-inputs.json).

## Step 1: recompute GW170817

```
../venv/bin/python recompute_gw170817_bright_siren.py ../data/GW170817_GWTC-1.hdf5 gw170817-outputs.json
```

The script downloads the file if it is missing and checks the digest

```
eff59472991bb0f0fa8c1e58057093ce07b82eb4c112364e3578ba16fe54eca9
```

It reads the distance samples of the low-spin and high-spin runs. Because these samples were drawn with a prior proportional to $d^2$, the same prior the discovery paper used, the distance integral becomes a sample mean:

$$
p(H_0\mid x,v_H)\propto p(H_0)\,\frac1S\sum_{s=1}^{S}\exp\!\left[-\frac{(v_H-H_0d_s)^2}{2\sigma_v^2}\right],
$$

with $v_H=3017$, $\sigma_v=166$ and $S$ samples. The discovery paper shows that the selection term is constant for a distance prior. [Abbott et al., A gravitational-wave standard siren measurement of the Hubble constant, Methods](https://arxiv.org/abs/1710.05835v1)

**Table 5.2** Results, from [gw170817-bright-siren-outputs.json](https://sandboxphysics.com/stories/standard-sirens/materials/gw170817-bright-siren-outputs.json). Intervals are minimal 68.3 percent intervals on a grid with step $0.05$.

| Run | Samples | Distance median, 16 to 84 percent | Prior | Maximum | Interval |
| --- | --- | --- | --- | --- | --- |
| Low spin | $8078$ | $40.0$, $30.8$ to $45.4\,\mathrm{Mpc}$ | $1/H_0$ | $68.5$ | $60.9$ to $86.4$ |
| Low spin | $8078$ | same | flat | $69.2$ | $61.2$ to $91.9$ |
| High spin | $4041$ | $41.7$, $34.6$ to $45.7\,\mathrm{Mpc}$ | $1/H_0$ | $68.3$ | $61.3$ to $80.6$ |
| Published |  | $43.8^{+2.9}_{-6.9}\,\mathrm{Mpc}$ | $1/H_0$ | $70.0$ | $62.0$ to $82.0$ |

The low-spin posterior mean is $80.9$, against the published $78$.

## Why our numbers differ from the published ones

The discovery paper used the parameter estimation available when it was written, with a distance of $43.8^{+2.9}_{-6.9}\,\mathrm{Mpc}$. The GWTC-1 samples are a later reanalysis whose low-spin distance median is $40.0\,\mathrm{Mpc}$. A shorter distance raises the implied $H_0$ for most samples and widens the high side. The discovery analysis also modelled the measured recession velocity and the peculiar velocity as separate terms, with a flat prior on $v_p$ between $-1000$ and $1000\,\mathrm{km\,s^{-1}}$, where we use one Gaussian. [Abbott et al., A gravitational-wave standard siren measurement of the Hubble constant, Methods, Eqs. 4 to 9](https://arxiv.org/abs/1710.05835v1) We did not test which simplification causes how much of the difference. Treat our numbers as a recomputation to set beside the published result.

## Step 2: calibrate on synthetic universes

```
../venv/bin/python synthetic_siren_study.py study-inputs.json synthetic-study-outputs.json
```

The run took 51 seconds on a laptop. The model is deliberately restricted. Each event is recorded as two polarisation amplitudes with unit Gaussian noise; the detection threshold is a signal-to-noise ratio of $12$; the cosmology is flat with $\Omega_m=0.3$ and catalogs end at $z=0.07$. The phase, polarisation angle and chirp mass are treated as known. The random seed is $71154$, so a rerun gives identical numbers.

**Table 5.3** Main inputs, from study-inputs.json.

| Input | Value |
| --- | --- |
| Face-on signal-to-noise ratio at $100\,\mathrm{Mpc}$ | $15$ |
| Peculiar-velocity spread | $200\,\mathrm{km\,s^{-1}}$ |
| Prior on $H_0$ | flat, $20$ to $160$ |
| Bright trials, dark trials | $400$, $250$ |
| Galaxies per dark catalog | $40$ |
| Monte Carlo events for the selection check | $400000$ |

**Table 5.4** Results, from [synthetic-study-outputs.json](https://sandboxphysics.com/stories/standard-sirens/materials/synthetic-study-outputs.json). Expected coverage is $0.683$.

| Check | Result | Pass |
| --- | --- | --- |
| Selection fraction at $H_0=70$ | $0.02189\pm0.00023$ by Monte Carlo, $0.02179$ by quadrature | yes |
| $\beta(80)/\beta(40)$ at $\rho_{100}=4$ | $7.92$, expected $8$ | yes |
| Bright with $\beta$ | coverage $0.700$, KS $p=0.083$ | yes |
| Bright without $\beta$ | coverage $0.653$, KS $p=1.2\times10^{-9}$ | no, as expected |
| Dark with catalog $\beta$ | coverage $0.728$, KS $p=0.85$ | yes |
| Dark without $\beta$ | coverage $0.384$, KS $p=8\times10^{-42}$ | no, as expected |
| 40 bright events at $H_0=70$, with $\beta$ | $71.9$, from $70.3$ to $73.8$ | consistent |
| 40 dark events at $H_0=70$, with $\beta$ | $67.9$, from $65.3$ to $70.6$ | consistent |

The same files hold a fixed reference event. The browser model behind the Lab reproduces its distance, bright and dark posteriors to within $0.5$, $0.6$ and $1.5$ of the Python values; a repository test checks this.

## Failure cases

Three failure cases are part of the output on purpose.

1. Selection ignored. Rows 4 and 6 of Table 5.4. The 40-event dark result without $\beta$ sits at the prior edge, $159$.
2. Host missing from the catalog, analysed without an out-of-catalog term. Coverage $0.55$, KS $p=1.9\times10^{-8}$, and one posterior with no support anywhere.
3. Peculiar-velocity spread underestimated, $100$ assumed against $500$ true, at $\rho_{100}=60$. Coverage $0.64$ and KS $p=0.43$: the test passes although the model is wrong. We report it as a limit of the test, not as a success of the model.

The dark trials also redrew 51 of 250 catalogs that contained no galaxy able to produce a detection. An earlier version of the script had no limit on that loop and ran for hours without finishing.

## What this does not reproduce

We did not rerun parameter estimation on strain data, model the detector network, include galaxy clustering, luminosity weighting or catalog incompleteness in the synthetic catalogs, or use a population model for masses. The GW170817 velocity is taken from the paper, not re-derived from galaxy surveys. With these limits, the synthetic numbers test the inference logic only.

## Try it in the Lab

Press New noise several times on the default event and note how far the bright-siren median moves; compare that spread with the interval the readout reports. [Open the standard sirens Lab](https://sandboxphysics.com/labs/gravitational-wave-standard-sirens/)

## Sources

1. [LIGO and Virgo, LIGO-P1800370-v5: Parameter estimation sample release for GWTC-1](https://dcc.ligo.org/LIGO-P1800370/public)
2. [Abbott et al., A gravitational-wave standard siren measurement of the Hubble constant, Methods](https://arxiv.org/abs/1710.05835v1)

## Keep reading

Gravitational-wave standard sirens · Reading path

### From a wave amplitude to the Hubble constant

1. [Article **How can a gravitational wave tell us how far away it came from?**](https://sandboxphysics.com/stories/standard-sirens/measuring-distance-with-gravitational-waves/)
2. [Article **Waveform amplitude, orbit tilt and luminosity distance**](https://sandboxphysics.com/stories/standard-sirens/waveform-amplitude-and-luminosity-distance/)
3. [Article **From one distance and one redshift to the Hubble constant**](https://sandboxphysics.com/stories/standard-sirens/from-distance-to-hubble-constant/)
4. [Article **Dark sirens, galaxy catalogs and the selection normalisation**](https://sandboxphysics.com/stories/standard-sirens/dark-sirens-and-selection-effects/)
5. [You are here **Recomputing a bright-siren and a dark-siren Hubble constant**](https://sandboxphysics.com/stories/standard-sirens/recomputing-bright-and-dark-siren-h0/)
6. [Article **Reading the GWTC-3 dark-siren cosmology paper**](https://sandboxphysics.com/stories/standard-sirens/reading-the-gwtc3-dark-siren-cosmology-paper/)
