The Lawfare Academy

Lawfare Group → Knowledge Institute → Lawfare Academy

← Astrophysics II: Galaxies, Observations, and Cosmology

Unit 4

Model data with uncertainties and test the numerics

Learning objectives

  • Compute an inverse-variance weighted estimate.
  • Distinguish independent noise from a shared calibration offset.
  • Validate a numerical calculation using a known case and refinement.

A model connects physical parameters and observing conditions to predicted measured quantities. For data yᵢ with independent Gaussian errors of known standard deviations σᵢ, minimizing the sum of squared residuals divided by σᵢ² is equivalent to maximizing the Gaussian likelihood for the mean model. Inspect residuals in their original observation order as well as as a histogram. A residual pattern can reveal a drift, underestimated covariance, a wrongly scaled uncertainty, or a physical effect absent from the model. Parameters near a boundary and a small sample need special care. High agreement alone cannot establish that a model is unique.

For a constant level under independent known errors, the weighted mean is Σ(yᵢ/σᵢ²)/Σ(1/σᵢ²) and its standard error is √[1/Σ(1/σᵢ²)]. A calibration error common to each observation does not shrink in that way. Separate repeatability from calibration uncertainty. When errors differ markedly, an unweighted mean can give a noisy reading too much influence, and inferring the weights after looking only at favored outcomes can bias the result. New data or held-out observations can test a fitted relationship.

A numerical experiment should include a known case and a resolution check. In the orbit unit, compare the numerical time equation with a circular orbit or an ellipse solved at a specified anomaly. A direct integration of acceleration using a symplectic method such as velocity Verlet can track an orbit with finite steps while allowing checks on energy and angular momentum. With a long step, a computed orbit can appear to precess even when the ideal model does not. Refine the step and compare stable observables before attributing this to physics. Model and rounding errors can also dominate after enough refinement.

For a numerical integral, compute an estimate at two resolutions. If the difference is materially smaller than the observation error in the quantity of interest, further integration refinement may add little. Repeat after changing the physical model, not just the numerical tolerance. Store units, input values, program version, and parameter choices. When using generated data for an injection or recovery test, state that no telescope observations are being claimed.

Open the computational workbook.

Apply the idea

Three independent measurements of a constant signal are 10 ± 1, 14 ± 2, and 8 ± 2 units. All additionally share an independent zero-point uncertainty of 0.5 units.

Compute the weighted estimate, its random standard error and the quadrature total with the shared zero-point term. Use the Python workbook to recover a known ellipse and check refinement in a separate distance calculation.

Read the worked reasoning

Weights are 1, 1/4, and 1/4. The estimate is (10 + 3.5 + 2)/1.5 ≈ 10.33. Random standard error is √(1/1.5) ≈ 0.82. The total is √(1/1.5 + 0.25) ≈ 0.96. This assumes Gaussian errors of known size, a genuinely constant signal, and a common additive error independent of the random components.

Check understanding

What does close agreement between two increasingly fine integrations show?

  1. It helps bound numerical sensitivity in the quantity tested
    Feedback

    Identical assumptions can converge to the wrong physical result. Compare independently with the model and evidence.

  2. It proves the physical model is exactly true
    Feedback

    Numerical agreement only addresses the implementation and approximation under chosen inputs.

  3. It removes uncertainty from the observations
    Feedback

    The observational and numerical uncertainties have different origins.

Further reading

Use the reduction guide to identify a stage at which a common calibration error might affect every measured flux. Compare a synthetic recovery test with the use of an actual calibration observation.

My learning →