School/✦ Research Engineer/Week 12
Propagating uncertainty: linearisation and Monte Carlo
You know the wheel's circumference to 1% and the turn count to 2%. How well do you know the distance? And what if the formula is not so simple?
About 45 min · 3 goals · Checked by automated tests
1.Why should I care?
Engineering answers are calculated from measured inputs. Uncertainty propagation tells you how input errors become output errors, and which input to improve. When the function bends sharply, Monte Carlo keeps you honest.
- ◇ Propagate uncertainty through a function by first-order linearisation.
- ◇ Use quadrature rules for sums and products of independent quantities.
- ◇ Check a linearised result by Monte Carlo sampling and recognise when they disagree.
2.Discover
In the Code Lab, sample L ~ Normal(1.00, 0.02) 100,000 times, compute A = L² and the standard deviation of A. Compare with the linearised 4%. Then try h = 1/L with L ~ Normal(1, 0.3): the Monte Carlo mean is not 1/1 and the spread is lopsided. Linearisation breaks when the function curves strongly within the uncertainty.
Can't use the interactive? Read a description instead
The Code Lab activity's expected results are stated in the text: about 4% spread for L² and a biased, skewed result for 1/L with large uncertainty. The rules can all be applied with a calculator.
3.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1 · a fresh version every time
Distance driven = wheel circumference × number of turns. The circumference has a 1% relative uncertainty and the turn count a 3% relative uncertainty (independent). The rover drove about 400 m. What is the relative uncertainty of the distance, in %?
4.Apply it
A rover estimates distance to a cliff from camera disparity: Z = f·B/d with focal length f = 800 px, baseline B = 0.2 m and disparity d = 16 ± 1 px. Propagate by linearisation, then reason about (or run) a Monte Carlo check. Which method would you trust for d = 4 ± 1 px?
5.Understand
First-order propagation
For y = f(x₁, …, xₙ) with independent inputs, σ_y² ≈ Σ (∂f/∂xᵢ)² σᵢ². This is a Taylor expansion to first order: it treats f as a plane near the measured point. It is exact for linear functions and good when σᵢ is small compared with the scale on which f bends.
Handy rules
Sums and differences: absolute uncertainties add in quadrature. Products and quotients: relative uncertainties add in quadrature. Powers: y = xⁿ gives σ_y/y = |n|·σ_x/x. Correlated inputs need the covariance term 2(∂f/∂x)(∂f/∂y)Cov(x, y).
Monte Carlo propagation
Draw many input samples from their distributions, push each through f, and look at the outputs. No derivatives needed, nonlinearity and correlation handled automatically, and you get the whole output distribution. The cost is computation and the need for honest input distributions.
Explain it another way
Wiggle each input by its uncertainty and see how much the output wiggles. Independent wiggles partly cancel, so you combine them like perpendicular sides of a triangle.
The first-order (delta) method also gives the output mean as f(x̄). The second-order correction to the mean is ½Σ(∂²f/∂xᵢ²)σᵢ²: for 1/L with σ = 0.3 that is +0.09, the bias Monte Carlo reveals.
Distance d = C·N, σ_C/C = 1%, σ_N/N = 2%: σ_d/d = √(1² + 2²)% ≈ 2.24%. Range from light time r = c·t/2 with σ_t = 10 ns: σ_r = c·σ_t/2 = 1.5 m.
Mission designers run Monte Carlo campaigns of thousands of simulated landings, sampling atmosphere, aerodynamics and navigation errors, because entry dynamics are far too nonlinear for linearised propagation alone.
Worked example 1
Speed v = d/t with d = 100.0 ± 0.5 m and t = 20.0 ± 0.2 s (independent). Find v ± σ_v.
v = 5.00 m/s. Relative: √(0.5² + 1.0²)% = 1.12%. σ_v ≈ 0.056 m/s.
Common mix-ups
- Uncertainties always add.
✓ Independent uncertainties add in quadrature. Straight addition is a worst case for fully correlated errors. - The output mean is always f(mean of inputs).
✓ Only to first order. Curved functions shift the mean, which Monte Carlo shows directly.
6.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2
A position is the sum of two independent legs: 40.0 ± 0.3 m and 25.0 ± 0.4 m. What is the standard uncertainty of the total, in m?
Practice 3
Kinetic energy ½mv² with mass known exactly and v uncertain by 3%. What is the relative uncertainty of the energy, in %?
Practice 4
When is Monte Carlo propagation clearly better than linearisation?
7.Predict
Area of a square solar panel A = L². L has 2% uncertainty. What is A's relative uncertainty?
Guess first. Being wrong here is how the surprise works.
8.Reflect
Concepts: Measurement error and uncertainty · Probability and Monte Carlo simulation