MLE & MAP
Maximum Likelihood Estimation (MLE) and Maximum A Posteriori (MAP) estimation are the two statistical principles that turn “SLAM” from a vague goal into a concrete optimization problem. Almost every SLAM back-end — filter or smoother — is computing one of these two estimates.
Bayes’ theorem sets the stage
Let be the state (robot poses and map) and the measurements (feature observations, IMU readings). Bayes’ theorem relates what we want (the posterior) to what our sensor and motion models give us:
- — the likelihood: how probable the measurements are if the state were (from the observation model).
- — the prior: what we believe before seeing (from a motion model, or previous estimates).
- — a normalizer, irrelevant for optimization.
The two estimators
MAP picks the state maximizing the posterior:
MLE drops the prior (equivalently, assumes a uniform prior) and maximizes the likelihood alone:
MAP = MLE + prior. In SLAM terms: pure bundle adjustment over image observations is MLE; add motion-model factors, IMU factors, or a prior on the first pose, and you are doing MAP.
From probabilities to least squares
The reason SLAM back-ends are least-squares solvers and not generic probabilistic inference engines is the Gaussian noise assumption. Take a measurement model with . Then
where is the squared Mahalanobis distance. Taking the negative logarithm — which turns maximization into minimization and products of independent measurements into sums — the MAP problem becomes:
The first sum is the observation cost (e.g. reprojection error with measurement covariance ); the second is the motion-model cost (odometry/IMU, with process covariance ). Three consequences worth internalizing:
- Squared errors are not arbitrary — they are the negative log of a Gaussian. If the noise is not Gaussian (outliers!), the squared loss is the wrong likelihood, which is exactly why M-estimators exist.
- Covariances become weights: a confident sensor (small ) contributes a strongly weighted residual. Information matrices in g2o/GTSAM are precisely these weights.
- Independence becomes sparsity: each measurement depends on only a few state variables, so the log-posterior is a sum of small local terms — a factor graph, whose structure the solver exploits.
Filters vs. smoothers
The Extended Kalman Filter computes a recursive Gaussian approximation of the posterior one time step at a time (predict with , update with ), while modern smoothing back-ends solve the full MAP problem over the whole trajectory with non-linear optimization. Both are chasing the same posterior; they differ in what they approximate and when they linearize.
Why it matters for SLAM
MLE/MAP is the bridge between the probabilistic formulation of SLAM and the optimization machinery that solves it. Every design decision downstream — why residuals are weighted by inverse covariances, why bundle adjustment minimizes squared reprojection error, why a prior factor anchors the gauge freedom, why outliers demand robust kernels — is a direct corollary of “MAP under Gaussian noise equals weighted nonlinear least squares”. If you can re-derive that one line, most back-end papers become easy reading.