Chapter six The three compared, and unified
Now that each method has been built from its own starting point, the differences are easy to state, because they all reduce to two decisions: how do you handle the curve, and how much of the past do you keep?
| EKF | UKF | Factor graph | |
|---|---|---|---|
| Handles the curve by | One tangent, at the current guess | Sampling 2n+1 points through the true function | Re-linearising repeatedly at improving guesses |
| Needs Jacobians | Yes, analytic, by hand | No | Yes, but frameworks autodiff them |
| Accuracy order | 1st (mean), 2nd (covariance) | 3rd for Gaussian inputs | Local optimum of the true cost |
| Cost per step | Lowest, one pass | ≈ 2n+1 model evaluations | Highest, tunable by window size |
| Memory | O(1) | O(1) | O(window) or O(trajectory) |
| Can revise the past | No | No | Yes — this is the point |
| Loop closure | Cannot use it properly | Cannot use it properly | Native |
| Typical home | Flight controllers, INS/GNSS fusion | Nonlinear models with ugly or absent derivatives | SLAM, VIO, bundle adjustment, calibration |
6.1 · The unifying statement
Once you see this, the whole taxonomy collapses into a single axis. Filtering and smoothing are not rival theories; they are the two ends of a spectrum, and fixed-lag smoothing is the dial in between. The UKF sits off to one side of that axis entirely — it is a filter, at the same point on the spectrum as the EKF, differing only in how it moves a Gaussian through a curve.
6.2 · How to choose
Reach for an EKF when you have a hard real-time deadline on constrained hardware, a high update rate that keeps the linearisation error small, and no need to ever revisit the past. Attitude and position estimation on a flight controller is the archetype.
Reach for a UKF when the nonlinearity is strong enough that a tangent misleads you, or when \(f\) is a lookup table, a simulation, or something else you cannot differentiate cleanly. It is a drop-in replacement with the same interface and a modest constant-factor cost.
Reach for a factor graph whenever the same place can be observed twice. Loop closures, multi-sensor calibration, offline trajectory refinement, anything where a measurement arriving now should be allowed to change your opinion about an hour ago. This is why every serious SLAM and visual-inertial system built in the last decade is a graph optimiser and not a filter.
In a real robot these coexist rather than compete. The autopilot runs an EKF at hundreds of hertz because it must. The companion computer runs a factor graph at a lazier rate because it can afford to think. Choosing between them is usually not a question of which is better, but of which layer of the stack you are standing in.