- A measurement z is the truth plus fresh noise w, with variance R.
- The noise is centred on zero, so the readings scatter evenly around the truth.
- Each reading has the same variance R. The error does not grow with time.
- But neighbouring readings disagree, so a GPS-only estimate is jumpy.
A friend calling out where you are
Back to walking with your eyes closed. Now a friend across the room shouts your position every few seconds. Your friend is never lost. But they are far away and guess a bit wrong each time: "3 metres!", then "1 metre!", then "4 metres!", while you only moved a little. You will never end up far from the truth. You will also never know exactly where you are.
A GPS receiver works the same way. It works out its position from satellite signals, and each answer comes with a small random error.
The measurement model
Write the GPS reading at step n as z[n]. It is the true position plus some noise:
The squiggle ~ is read as in lesson 1: "follows" (or "is distributed as"). Here each step's noise w[n] is a fresh random value that follows the bell N(0, R). N(0, R) is the Gaussian from lesson 1, with mean 0 and variance R. We call R the measurement noise. A GPS with σ = 2.2 m has R = 2.2² = 4.84 m². If the robot is really at 10 m, a reading of 12.3 m is quite normal: the error is +2.3 m, about one σ.
Mean 0 is the important part. It says the GPS is centred on the truth: it is too high as often as it is too low. Engineers call this unbiased.
No drift
Every reading gets a brand-new noise sample. Nothing carries over from the last step. So the error at step 1000 is no bigger than the error at step 1: the variance is R = 4.84 at both. That is exactly what dead reckoning could not do.
But jumpy
The same fresh noise makes the readings jump. Two readings taken one step apart have independent errors, so the gap between them has variance R + R = 2R. Subtracting an independent error adds its variance too, because −w is just as spread out as w. For example, with R = 4:
The robot moved about 0.5 m, yet the GPS can easily say it moved 3 m, or backwards.
Measuring how good an estimate is
To score an estimate against the truth, we use the RMS error (root mean square): square each error, take the mean, then the square root. It is like an average error in metres that punishes big misses. Errors of 1, −2, 2 and −1 m give:
For a GPS used on its own, the RMS error is close to its σ. In the 30-step picture above it is about 2.4 m, for a GPS with σ = 2.2 m. The lab runs a longer 80-step track with different noise, so its numbers differ a little. Under the lab's picture, the readout shows the RMS error of every line and every dot series against the dashed truth. The lab computes it for you.
Two flawed sensors
So the encoder is smooth but drifts. The GPS is right on average but jumpy. Each one's weakness is the other's strength.
Over the 30 steps in this picture, dead reckoning has an RMS error of about 3.1 m and the GPS about 2.4 m. Neither is good. The rest of this lesson combines them: the encoder smooths out the GPS jumps, and the GPS pins down the encoder drift.
A bigger example: five readings of a parked robot
The robot is parked at exactly 10 m. A GPS gives five readings: 12.1, 8.4, 10.9, 7.6 and 11.5 m.
The mean error is almost zero, so the GPS is centred. But single readings are almost 2 m off, and the track jumps by more than 3 m. A phone logs thousands of readings like these, with the same picture every time.
Where this shows up
A phone GPS is typically good to a few metres. Standing still, the blue dot on your map still wanders around. Drones see the same thing as altitude jitter. That is why no serious drone or car uses raw GPS alone.
Next: how do we use both sensors? The Kalman filter works in two steps, and the first one, predict, uses the encoder.
Examples
Example 1 · How far off one reading can be
A GPS has σ = 2.2 m, so R = 4.84 m².
Show solutionHide solution
The band is wide, but it stays the same width forever.
Example 2 · The robot that seems to jump
Same GPS. The robot moves 0.4 m between two readings. How much do the two readings disagree?
Show solutionHide solution
The real move is 0.4 m. The noise in the jump is almost eight times bigger than the move itself.
Example 3 · Averaging helps, until you move
The robot is parked. Average 10 GPS readings.
Show solutionHide solution
Much better than 2.2 m. But if the robot is moving, the old readings point to old positions, and the average lags behind. To average a moving robot, you need to know how it moved between readings. That is the encoder's job.
Example 4
Four GPS readings have errors +2, −1, −3 and +2 m. Find the mean error and the RMS error.
Show solutionHide solution
Mean: (2 − 1 − 3 + 2) / 4 = 0. The readings are centred on the truth.
RMS: squares 4, 1, 9, 4 add to 18. The mean is 18 / 4 = 4.5, and √4.5 ≈ 2.12 m. A mean of zero does not mean the errors are small.
Example 5
Dead reckoning with Q = 0.25 per step starts with P = 0. The GPS has R = 4.84. After how many steps is dead reckoning less certain than a single GPS reading?
Show solutionHide solution
Dead reckoning has P = 0.25 · n. We need 0.25 · n > 4.84, so n > 19.36.
From step 20 on, one raw GPS reading is more certain than the encoder estimate. Before that, the encoder wins. Neither wins all the time, which is a strong hint to use both.

Questions and comments
Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.