02 / 15 · 60–90 min
Measure through noise.
How do we combine prior knowledge with a measurement?
Check my intuition
01 · Predict
Before changing the settings.
Before measurement: μ₀ = 4 m and σ₀ = 2 m. One measurement gives z = 6 m with σ = 2 m. Both sources have the same variance. What is the new estimate?
A hint
Equal variances give equal weights.
02 · Experiment and compare
Put the model to the test.
Simulated true distance: 5.00 m. Mean: 4.20 m. Estimate: 4.14 ± 0.67 m (95 %).
- Sample mean
- 4.20 m
- Bayesian estimate
- 4.14 m
- Estimated std. dev.
- 0.34 m
Read values as a table
| Measurement | Measured (m) | True (m) | Estimated (m) |
|---|---|---|---|
| 1.00 | 3.85 | 5.00 | 4.14 |
| 2.00 | 4.67 | 5.00 | 4.14 |
| 3.00 | 2.79 | 5.00 | 4.14 |
| 4.00 | 3.63 | 5.00 | 4.14 |
| 5.00 | 4.36 | 5.00 | 4.14 |
| 6.00 | 6.47 | 5.00 | 4.14 |
| 7.00 | 4.68 | 5.00 | 4.14 |
| 8.00 | 2.84 | 5.00 | 4.14 |
| 9.00 | 4.20 | 5.00 | 4.14 |
| 10.00 | 1.07 | 5.00 | 4.14 |
| 11.00 | 5.68 | 5.00 | 4.14 |
| 12.00 | 6.20 | 5.00 | 4.14 |
Understand the calculations
03 · Connect the diagram to calculations
The numbers behind motion.
Assume a fixed distance, a Gaussian prior and independent Gaussian measurement errors with known variance σ² and zero mean.
z̄ = (z₁ + … + zₙ) / n
σₚ² = 1 / (1/σ₀² + n/σ²)
μₚ = σₚ² × (μ₀/σ₀² + n z̄/σ²)The band shows μₚ ± 1.96 σₚ, a 95% credible interval under these assumptions. The bias setting violates the zero-mean assumption: more measurements can yield a precise estimate around a wrong value.
A few lines to reconstruct
precision = 1 / prior_variance + n / noise_variance
variance = 1 / precision
posterior = variance * (prior / prior_variance + n * average / noise_variance)The notebook provides one function per laboratory, hand-calculated examples and tests. Exercises isolate components; these pages run the complete simulations.
Keep an observation
04 · Record
What changed?
Compare two settings. Record the effect, your explanation and a case where the model might fail. Saving keeps the current settings and seed, not a certification of competence.
atomsh / lab