Evaluating, propagating and reporting uncertainty, from the first ± to the covariance matrix of a fit, with examples across disciplines.
Every number in science and engineering comes with an uncertainty, yet the subject is usually taught once, as a set of recipes in a first-year laboratory, and seldom carried into the places where it is needed later: curve fitting, counting experiments, correlated simulation data, numerical computation, and the systematic effects that no formula for random error will reveal. This book treats error analysis as one connected subject.
Each chapter is an executed Jupyter notebook. Every idea is derived,
demonstrated on simulated data for which the true answer is known, and
checked by simulation, so that every error bar can be compared with the
truth. The notebooks share a small Python module, errprop, written to be
read as much as to be used.
Core chapters assume partial derivatives and a first look at Python.
Advanced chapters are for graduate students and researchers who fit data, run simulations or publish numbers with error bars.
The reading guide maps every chapter to the standard textbooks and to the GUM, and suggests routes through the material.
Part I. Measurement and uncertainty¶
| Chapter | Track | Topics |
|---|---|---|
| 1. Measurements, errors and how to report a result | core | error vs uncertainty; random and systematic effects; Type A and Type B evaluation; quadrature; rounding and reporting; comparing results |
| 2. Measuring instruments | core | static characteristics; resolution, noise and dithering; calibration and accuracy specifications; first-order dynamic response and lag correction |
| 3. Propagation of uncertainty | core | the propagation law; rules for sums, products and powers; uncertainty budgets; Monte Carlo check; differences of nearly equal numbers |
| 4. Repeated measurements | core | standard deviation and standard error; the uncertainty of the uncertainty; Student’s t; what averaging does not cure; weighted mean |
Part II. Probability and statistics¶
| Chapter | Track | Topics |
|---|---|---|
| 5. Probability distributions and the central limit theorem | core | binomial, Poisson, normal, uniform, exponential and Cauchy distributions; the central limit theorem; χ², t and F |
| 6. Counting statistics | core | the square-root rule and the dispersion test; background subtraction and counting-time split; Garwood intervals for small counts; dead time |
| 7. Estimators and maximum likelihood | advanced | bias, variance and mean-square error; efficient and inefficient estimators; maximum likelihood; likelihood intervals; Cramér–Rao bound |
| 8. Hypothesis tests and goodness of fit | core | p-values, power and errors of both kinds; z, t and Welch tests; χ² test of a distribution; F test; correlation coefficient; many tests at once |
| 9. Outliers and the rejection of data | core | Chauvenet’s criterion tested; robust estimators (median, trimmed mean, Huber); the bootstrap; a policy for suspect data |
| 10. Monte Carlo methods | advanced | sampling by inverse transform and rejection; correlated inputs; the accuracy of a Monte Carlo result; Latin hypercube sampling |
Part III. Data analysis¶
| Chapter | Track | Topics |
|---|---|---|
| 11. Fitting a straight line | core | least squares and its parameter uncertainties; residuals; weighted fits and χ²; coverage check; pitfalls |
| 12. Covariance and the limits of linearisation | advanced | the general law Cy = J Cx JT; shared errors; staged calculations; second-order bias; Monte Carlo propagation |
| 13. Fit parameters and their covariance | advanced | matrix form of least squares; correlated slope and intercept; centring; transformed data and weights; absolute vs relative error bars; errors in both variables |
| 14. Nonlinear least squares | advanced | Gauss–Newton and Levenberg–Marquardt; local minima and starting values; covariance at the minimum; profile Δχ² intervals; derived quantities; coverage |
| 15. Fitting counts: maximum likelihood | advanced | Neyman vs Pearson χ² vs Poisson likelihood for histograms; goodness of fit with few counts; unbinned likelihood with a finite window |
| 16. Rules of thumb, tested | core | nine rules from course guides tested by simulation: worst case vs quadrature, overlapping error bars, limits of linearisation, the dependency trap, measuring many at once, dropping small terms, significant figures, offsets and gains, cancelling errors |
Part IV. Advanced topics¶
| Chapter | Track | Topics |
|---|---|---|
| 17. Correlated data and block averaging | advanced | variance of the mean of a time series; integrated autocorrelation time; blocking analysis; coverage test; jackknife for derived quantities |
| 18. Sensitivity analysis and uncertainty budgets | advanced | sensitivity, elasticity and importance; budgets across operating points; bottom-up vs top-down; Sobol indices; aleatory vs epistemic uncertainty; model-form error |
| 19. Numerical error | advanced | floating point and cancellation; Welford’s algorithm; conditioning; step size of numerical derivatives; Richardson extrapolation; long-time integration |
Part V. Worked examples¶
| Chapter | Track | Topics |
|---|---|---|
| 20. Physics: the acceleration of gravity from a pendulum | core | physics: a systematic error that shows up as a trend; a fit that absorbs it; a correction common to all points |
| 21. Chemical engineering: viscosity from a falling sphere | core | chemical engineering: Type B evaluation; a full budget; a model error fourteen times the budget; defining the measurand |
| 22. Chemistry: activation energy from an Arrhenius plot | advanced | chemistry: parameters with correlation 0.999; prediction with and without covariance; the statistical compensation effect |
| 23. Molecular simulation: pressure and diffusion in a Lennard-Jones liquid | advanced | molecular simulation: correlated time series; block averaging on real MD data; transport coefficients; what an error bar leaves out |
| 24. Nuclear physics: a half-life from decay counts | advanced | nuclear physics: why the log-linear fit is biased; background in the likelihood; checking four methods by simulation |
| 25. Analytical chemistry: a calibration curve and its detection limit | core | analytical chemistry: inverse prediction and its uncertainty; decision threshold and detection limit (Currie); the 3s rule tested |
| 26. Mechanical engineering: tolerance stack-up and inspection | core | mechanical engineering: worst case vs RSS vs Monte Carlo tolerancing; yield and Cpk; the Abbe error; guard bands at inspection |
Licence and citation¶
Code: MIT. Text, figures and data: CC BY 4.0. Please cite the material
using the metadata in CITATION.cff in the repository.