Thomas Piacentini
← Workshop

02 / 15 · 60–90 min

Measure through noise.

How do we combine prior knowledge with a measurement?

Choose a laboratory
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.

0.001.833.565.397.012Position (m)Measurement
Dots: measurements · dashed: true distance · solid: estimate · band: computed uncertainty.

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
Compare A and B →

Read values as a table
MeasurementMeasured (m)True (m)Estimated (m)
1.003.855.004.14
2.004.675.004.14
3.002.795.004.14
4.003.635.004.14
5.004.365.004.14
6.006.475.004.14
7.004.685.004.14
8.002.845.004.14
9.004.205.004.14
10.001.075.004.14
11.005.685.004.14
12.006.205.004.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.

Open my notebook →

atomsh / lab