Unit 27 · Semester 2 · about three weeks, 20–30 hours
Bayesian estimation and filtering
Mission: Track a slow rover from noisy position readings and test whether a filter helps before trusting it. This 100-minute introduction is separate from the full unit; prerequisites are probability and Chapter 10.
The interactive version of this unit needs JavaScript. Below are its steps as text.
Steps
1. Follow a known path
Press Move rover to reveal the seeded position path.
Why it matters: The truth path lets us assess an estimator in simulation. A real filter does not get this truth as an input.
2. See the noisy reading
Press Read sensor to compare observations with the same truth path.
Why it matters: A measurement can differ from position. These invented measurements use a specified noise variance.
3. Predict before observing
Press Predict one step to add the known 0.1 m motion to the previous estimate.
Why it matters: The prior prediction carries what the model knows before the next reading. Adding process variance allows for uncertain motion.
4. Use one observation
Press Combine reading to weight the first measurement against the prediction.
Why it matters: The gain weights the measurement innovation: observed minus predicted position. Under the specified linear Gaussian assumptions this is a scalar Kalman update.
5. Repeat the two steps
Press Filter the path to repeat prediction and update for 60 observations.
Why it matters: Each posterior becomes the next prediction’s starting point. The process is recursive Bayesian estimation for this particular model.
6. Read uncertainty carefully
Press Show band to display one model standard deviation around the estimate.
Why it matters: Variance is in m²; its square root is a standard deviation in m. A narrow model band does not establish that the estimate is correct.
7. Score one seed
Press Compare errors to calculate raw and filtered position RMSE for seed 1.
Why it matters: Root mean squared error summarizes squared position misses in m. One favorable seed is insufficient evidence.
8. Include thirty trials
Press Run thirty seeds to show every seeded trial and pooled errors.
Why it matters: Pooling sums all squared errors before taking a square root. It is not an average of trial RMSE values.
9. Overtrust the sensor
Press Assume zero R to set assumed measurement variance to zero while actual noise stays unchanged.
Why it matters: An incorrect covariance can make the filter overconfident. Changing assumed R does not change the actual readings or their noise.
10. Expose sensor bias
Press Add bias to give every measurement a +0.5 m offset.
Why it matters: This filter has no bias state, so it cannot remove an unmodelled sensor offset. Noise averaging is not bias calibration.
11. Question the motion model
Press Assume zero Q to ignore actual process disturbances in the filter.
Why it matters: Wrong assumptions can cause misleading uncertainty and tracking error. No finite batch proves that a filter always improves every trial.
12. Keep reproducible evidence
Press Show handoff to reveal the original assessment requirements.
Why it matters: Record your own code, versions, seeds, assumptions, raw outputs and metrics. Supplied examples do not establish your work or completion.
Go deeper
A scalar special case
Truth evolves xk=xprevious+u+w. Measurement z=x+bias+noise. The filter receives u and z, never truth. Independent Gaussian process and measurement noise have variances Qtrue and Rtrue. Prediction: xminus=xhat+u, Pminus=P+Qassumed. Innovation=z−xminus; S=Pminus+Rassumed; K=Pminus/S; posterior=xminus+K innovation. Scalar Joseph covariance: P=(1−K)²Pminus+K²Rassumed. Zero S is undefined and is diagnosed.
This is a position-only linear Gaussian Kalman filter, a special Bayesian estimator. P0=0.04 m² is an assumption; true initial position is fixed at 0 m in these trials. The drawn ±1 standard-deviation band has no empirical coverage guarantee. Wrong covariance, correlated noise, unknown motion or sensor bias can invalidate its interpretation.
Reproducibility and assessment
Park–Miller modulus2147483647, multiplier16807; seeds1–30. Each normal draw uses fresh Box–Muller uniforms with no cache; each step consumes a process draw then a measurement draw even when its variance is zero. Default N=60 and dt=1 s. Pooled RMSE weights each trial by sample count. Ties use 0.000000000001 m tolerance. Retain every trial, including worse cases; finite results are not population guarantees.
Primary reading
MIT Underactuated Robotics, State Estimation, is the curriculum’s advanced reading. Its current page is an outline; a video for this unit remains unverified. Welch and Bishop’s primary Kalman-filter report supplies further equations and assumptions. These references do not validate this page or learner outcomes.