AI Wiki中文/EN

State estimation: tracking what a robot cannot measure directly

状态估计

Build the probabilistic state-space model, derive the Bayes filter's predict and update steps from two Markov assumptions, see why recursion beats batch inference and why exact filtering is rarely possible, and test observability and model errors on a synthetic grid filter.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

The robot never sees its own state

State estimation means working out quantities a robot cannot measure directly, such as its position, from noisy sensor readings and a model of how it moves. The answer is kept as a probability distribution, so the robot also knows how unsure it is. A typical example is a robot in a corridor that combines “I moved one step” with “I see a door” to judge where it is.

A mobile robot needs to know where it is, which way it faces and how fast it moves. Barfoot calls these quantities the robot’s state: if known, it fully describes the motion over time. No sensor reports the state directly. Wheel encoders, gyroscopes and accelerometers sense the robot’s own motion. Cameras, laser rangefinders and GPS sense its relation to the world. Barfoot calls the first group interoceptive (sensing the robot itself) and the second exteroceptive (sensing the outside world). He notes that good estimators usually combine both, as when GPS is fused with an inertial measurement unit. State and sensors

Every sensor has limited precision, so every measurement is uncertain. When measurements are combined into an estimate, the uncertainty must be tracked too. Otherwise there is no way to know how much to trust the result. Barfoot defines estimation as reconstructing the underlying state of a system from a sequence of measurements and a prior model. Uncertainty and problem definition

Särkkä describes the same task as optimal, or Bayesian, filtering: estimating the state of a time-varying system that is observed only indirectly, through noisy measurements. The dynamics are themselves perturbed by process noise. This noise often stands for model uncertainty rather than true randomness. “Optimal” here means statistically optimal for the assumed model, not in the real world. Optimal filtering

This article covers the general framework behind a family of algorithms. It sets up the probabilistic model and derives the general recursive Bayes filter. It explains why that filter can be run exactly only in special cases. It also shows what observability and model errors do to any filter. The specific filters, such as the Kalman filter, the extended Kalman filter and the particle filter, and applications such as robot localization, SLAM and sensor fusion, are separate topics. Background: Bayes’ theorem, conditional probability and Markov chains.

Model, recursion, and the Bayes filter

This section writes down the probability model, shows why one step at a time beats processing everything at once, and derives the general filter.

The probabilistic state-space model

Särkkä writes the model as three distributions: an initial distribution of the state, a dynamic (transition) model, and a measurement model. Definition 4.1

x0∼p(x0),xk∼p(xk∣xk−1),yk∼p(yk∣xk)x_0\sim p(x_0),\qquad x_k\sim p(x_k\mid x_{k-1}),\qquad y_k\sim p(y_k\mid x_k)

In words: the state starts from a known distribution, each new state depends on the previous one through the dynamic model, and each measurement depends on the current state through the measurement model. Two assumptions make this a Markov model. Given xk−1x_{k-1}, the state xkx_k is independent of everything earlier, states and measurements alike. Given xkx_k, the measurement yky_k is independent of all earlier states and measurements. Markov properties, eqs. (4.2)–(4.4) Barfoot writes the same structure in function form, with a motion model xk=f(xk−1,vk,wk)x_k=f(x_{k-1},v_k,w_k) driven by an input vkv_k and process noise wkw_k, and an observation model yk=g(xk,nk)y_k=g(x_k,n_k) with measurement noise nkn_k. Motion and observation models

Batch versus recursive

Applying Bayes’ rule to the whole trajectory at once gives the batch posterior:

p(x0:T∣y1:T)∝p(x0)∏k=1Tp(xk∣xk−1) p(yk∣xk)p(x_{0:T}\mid y_{1:T})\propto p(x_0)\prod_{k=1}^{T}p(x_k\mid x_{k-1})\,p(y_k\mid x_k)

In words: the probability of a whole trajectory, given all measurements, is proportional to the starting probability times one motion term and one measurement term per step. This is correct but impractical: each new measurement adds a new state to the distribution, so its dimension and cost keep growing, which makes it intractable for real-time use. Batch posterior Usually we want less. Särkkä distinguishes three marginal questions. Filtering asks for p(xk∣y1:k)p(x_k\mid y_{1:k}), the current state given the measurements so far. Prediction asks for p(xk+n∣y1:k)p(x_{k+n}\mid y_{1:k}), a future state. Smoothing asks for p(xk∣y1:T)p(x_k\mid y_{1:T}) with T>kT>k, a past state revisited in the light of later measurements. Filtering, prediction, smoothing

These marginals can be computed recursively with a constant amount of work per time step, so arbitrarily long sequences can be processed. Constant cost per step The idea is simple: the posterior after one measurement serves as the prior for the next, and this reproduces exactly what Bayes’ rule applied to the whole batch would give. Recursive Bayes

The Bayes filter

Starting from p(x0)p(x_0), each step has two parts. The prediction step pushes the previous belief through the dynamic model; this is the Chapman–Kolmogorov equation. The update step weighs the prediction by the likelihood of the new measurement and normalizes. Theorem 4.1

p(xk∣y1:k−1)=∫p(xk∣xk−1) p(xk−1∣y1:k−1) dxk−1p(x_k\mid y_{1:k-1})=\int p(x_k\mid x_{k-1})\,p(x_{k-1}\mid y_{1:k-1})\,dx_{k-1} p(xk∣y1:k)=p(yk∣xk) p(xk∣y1:k−1)Zk,Zk=∫p(yk∣xk) p(xk∣y1:k−1) dxkp(x_k\mid y_{1:k})=\frac{p(y_k\mid x_k)\,p(x_k\mid y_{1:k-1})}{Z_k},\qquad Z_k=\int p(y_k\mid x_k)\,p(x_k\mid y_{1:k-1})\,dx_k

In words: the first line predicts where the robot may be now by averaging the motion model over the old belief; the second reweights that prediction by how well each state explains the new measurement yky_k, and ZkZ_k makes the result sum to one. The proof uses exactly the two Markov assumptions and nothing else. The Markov property lets p(xk∣xk−1,y1:k−1)p(x_k\mid x_{k-1},y_{1:k-1}) be replaced by p(xk∣xk−1)p(x_k\mid x_{k-1}) in the prediction; conditional independence lets p(yk∣xk,y1:k−1)p(y_k\mid x_k,y_{1:k-1}) be replaced by p(yk∣xk)p(y_k\mid x_k) in the update. Proof of Theorem 4.1 Barfoot presents the same recursion as a predictor–corrector: the prior belief is propagated through the motion model, then corrected with the measurement through the observation model; the result is called the belief. He calls the step that applies the Markov property to the estimator subtle and the cause of many limitations in recursive estimation, and says he will return to examine it. Bayes filter

For a finite state space the integrals become sums. On a grid of NN cells with transition probabilities P(j∣i)P(j\mid i) and a predicted belief bˉk\bar b_k:

bˉk(j)=∑i=1NP(j∣i) bk−1(i),bk(j)=P(yk∣j) bˉk(j)∑lP(yk∣l) bˉk(l)\bar b_k(j)=\sum_{i=1}^{N}P(j\mid i)\,b_{k-1}(i),\qquad b_k(j)=\frac{P(y_k\mid j)\,\bar b_k(j)}{\sum_{l}P(y_k\mid l)\,\bar b_k(l)}

In words: the predicted probability of cell jj adds up the chances of arriving there from every cell ii, and the update multiplies by the chance of the reading in cell jj and divides by the total. This is the form used in the example below. The same forward recursion appears in discrete hidden Markov models, for instance in speech recognition with HMMs.

When can it be run exactly?

The two books frame this differently, so each is attributed here. Barfoot states that the exact Bayes filter can be implemented in practice only in the linear-Gaussian case. He gives two reasons: a general probability density is infinite-dimensional, and the prediction integral is too expensive to evaluate exactly. Practical filters therefore represent the belief compactly, by Gaussian moments or by a finite set of samples, and evaluate the integral approximately, by linearization or by Monte Carlo. Why approximate Särkkä lists the closed-form cases as the Kalman filter for linear-Gaussian models (where the posterior is exactly Gaussian), the Rauch–Tung–Striebel smoother, and grid filters and smoothers for Markov models with finite state spaces. Closed-form cases So a grid filter on a finite state space, like the one in our example, is exact in Särkkä’s classification, while Barfoot, writing about continuous robot states, names only the linear-Gaussian case.

Särkkä’s approximation families include the extended Kalman filter (linearization), the unscented Kalman filter (unscented transform), particle filters (weighted Monte Carlo samples), Rao–Blackwellized particle filters, grid-based approximations, and others such as Gaussian mixtures, variational methods and MCMC. Approximation families His practical advice: use the Kalman filter and RTS smoother for linear problems; start with the EKF for nonlinear models with Gaussian noise; turn to particle methods when Gaussian approximations fail, remembering their high cost and marginalizing analytically where possible. More complicated filters are not guaranteed to give better results. Choosing a method Unknown model parameters can be added to the state or estimated separately with their own prior. Parameters

Observability

Some states cannot be recovered no matter how good the filter is. Barfoot calls a system observable if its initial state can be uniquely inferred from measurements gathered over a finite time. In the batch linear-Gaussian problem the estimate exists and is unique when a certain information matrix is invertible. A good prior on the initial state together with positive-definite process noise always guarantees this. Without any prior knowledge of the initial state, for a time-invariant system xk+1=Axkx_{k+1}=Ax_k, yk=Cxky_k=Cx_k with state dimension NN, the condition (together with positive-definite process and measurement noise covariances) reduces to Kalman’s rank test: Existence, uniqueness, observability

O=[CCA⋮CAN−1],rank⁡O=N\mathcal{O}=\begin{bmatrix}C\\ CA\\ \vdots\\ CA^{N-1}\end{bmatrix},\qquad \operatorname{rank}\mathcal{O}=N

In words: stack CC, CACA, up to CAN−1CA^{N-1}; if these rows contain NN independent directions, the measurements over time pin down every component of the initial state. Barfoot notes these conditions are sufficient, not necessary. His mechanical picture treats measurements and motion constraints as springs between masses. The problem is unobservable when some group of states can be shifted without stretching any spring, for example a whole chain of carts with no knowledge of the initial state and, in his one-dimensional figure, no measurements. Mass–spring picture Nonlinear observability is a separate theory that this article does not cover.

What makes an estimate good?

For linear-Gaussian problems the full posterior is Gaussian, so its mean and its mode coincide and Bayesian and maximum a posteriori (MAP) estimation give the same answer. For nonlinear models this fails. Linear-Gaussian versus nonlinear Barfoot measures estimators by the mean error (bias) and the mean squared error, which combines bias and variance. Both must be small; returning the prior mean every time is trivially unbiased and useless. Performance metrics In his one-dimensional stereo-camera example, recovering depth from disparity, the MAP estimator was biased: over 1,000,000 simulated trials the mean error was about −33.0 cm and the mean squared error about 4.41 m², even though the true states were drawn from the estimator’s own prior. Stereo example, Fig. 4.4 Those numbers belong to his specific setup, not to MAP estimation in general.

A grid filter on a ring corridor

This section runs a small grid filter and uses it to show the recursion, its match with the batch answer, an unobservable case and a model error. The program is an original synthetic discrete Bayes filter, numpy only and deterministic: the measurement sequence is written into the code by hand, not sampled. A robot moves on a ring of N=10N=10 cells with doors at cells 0, 3 and 4 and walls elsewhere. Each step it moves +1 cell with probability 0.8, stays with 0.1 and moves +2 with 0.1. Its sensor reports “door” with probability 0.8 in front of a door and 0.1 in front of a wall. The prior is uniform. The true cells are 2, 3, 4, 5, 6, 8, 9, 9, 0, and the readings match the truth except for one deliberate false “door” at k=4k=4. All numbers are invented toy values.

import numpy as np

# Synthetic discrete Bayes (grid) filter: a robot on a ring corridor of N cells
# with door/wall landmarks. Motion and sensor models are invented toy numbers.

N = 10
MOVE = {0: 0.1, 1: 0.8, 2: 0.1}
P_HIT, P_FALSE = 0.8, 0.1


def predict(belief, move=MOVE):
    out = np.zeros_like(belief)
    for step, p in move.items():
        out += p * np.roll(belief, step)
    return out


def likelihood(z, doors, p_hit=P_HIT, p_false=P_FALSE):
    is_door = np.isin(np.arange(N), doors)
    if z == 1:
        return np.where(is_door, p_hit, p_false)
    return np.where(is_door, 1 - p_hit, 1 - p_false)


def update(prior, z, doors, **kw):
    unnorm = likelihood(z, doors, **kw) * prior
    Z = unnorm.sum()
    return unnorm / Z, Z


def entropy_bits(b):
    nz = b[b > 0]
    return float(-(nz * np.log2(nz)).sum())


def run(doors, true_x, zs, **kw):
    b = np.full(N, 1.0 / N)
    rows = []
    for k in range(1, len(true_x)):
        b = predict(b)
        b, Z = update(b, zs[k - 1], doors, **kw)
        rows.append((k, true_x[k], zs[k - 1], int(b.argmax()), b.max(), b[true_x[k]],
                     entropy_bits(b), Z, b.copy()))
    return rows


DOORS = [0, 3, 4]
TRUE_X = [2, 3, 4, 5, 6, 8, 9, 9, 0]
ZS = [1 if x in DOORS else 0 for x in TRUE_X[1:]]
ZS[3] = 1

print("1) First step by hand: uniform prior, prediction, then z=door")
b0 = np.full(N, 1.0 / N)
bp = predict(b0)
post, Z1 = update(bp, 1, DOORS)
print("   predicted belief stays uniform:", np.allclose(bp, 0.1))
print("   normalizer Z = %.4f, door cell %.4f, wall cell %.4f" % (Z1, post[0], post[1]))

print("\n2) Filtering run (doors at %s, false 'door' reading at k=4)" % DOORS)
print("   k  true  z  argmax  P(argmax)  P(true)  H(bits)")
rows = run(DOORS, TRUE_X, ZS)
for k, xt, z, am, pm, pt, h, Z, b in rows:
    print("   %d  %4d  %d  %6d  %9.4f  %7.4f  %7.4f" % (k, xt, z, am, pm, pt, h))

print("\n3) Recursive filter vs brute-force batch posterior (first 4 steps)")
T = 4
A = np.zeros((N, N))
for i in range(N):
    for step, p in MOVE.items():
        A[i, (i + step) % N] += p
joint = np.full(N, 1.0 / N)
for k in range(1, T + 1):
    lk = likelihood(ZS[k - 1], DOORS)
    joint = joint[..., None] * A.reshape((1,) * (k - 1) + (N, N)) * lk
count = joint.size
batch = joint.reshape(-1, N).sum(axis=0)
batch /= batch.sum()
rec = rows[T - 1][8]
print("   trajectories enumerated: %d, max |batch - recursive| < 1e-12: %s"
      % (count, np.abs(batch - rec).max() < 1e-12))
print("   batch p(x_4 | y_1:4) =", np.round(batch, 4))

print("\n4) Observability: periodic map, doors at [0, 5]")
pdoors = [0, 5]
zs_p = [1 if x in pdoors else 0 for x in TRUE_X[1:]]
rows_p = run(pdoors, TRUE_X, zs_p)
gap = max(np.abs(r[8] - np.roll(r[8], 5)).max() for r in rows_p)
last = rows_p[-1][8]
print("   max |p(x) - p(x+5)| over all steps = %.1e" % gap)
print("   final belief: p(0) = %.4f, p(5) = %.4f, true cell %d" % (last[0], last[5], TRUE_X[-1]))

print("\n5) Overconfident sensor model: filter assumes P(door | wall) = 0")
rows_o = run(DOORS, TRUE_X[:5], ZS[:4], p_false=0.0)
for k, xt, z, am, pm, pt, h, Z, b in rows_o:
    print("   k=%d true=%d z=%d argmax=%d P(argmax)=%.4f P(true)=%.4f exactly zero: %s"
          % (k, xt, z, am, pm, pt, pt == 0.0))

The program prints:

1) First step by hand: uniform prior, prediction, then z=door
   predicted belief stays uniform: True
   normalizer Z = 0.3100, door cell 0.2581, wall cell 0.0323

2) Filtering run (doors at [0, 3, 4], false 'door' reading at k=4)
   k  true  z  argmax  P(argmax)  P(true)  H(bits)
   1     3  1       0     0.2581   0.2581   2.6316
   2     4  1       4     0.5515   0.5515   2.1315
   3     5  0       5     0.5523   0.5523   2.1087
   4     6  1       3     0.3485   0.2646   2.5967
   5     8  0       7     0.3269   0.1508   2.7821
   6     9  0       8     0.3153   0.1722   2.6430
   7     9  0       9     0.3467   0.3467   2.5411
   8     0  1       0     0.7191   0.7191   1.6408

3) Recursive filter vs brute-force batch posterior (first 4 steps)
   trajectories enumerated: 100000, max |batch - recursive| < 1e-12: True
   batch p(x_4 | y_1:4) = [0.0499 0.0109 0.0654 0.3485 0.0864 0.0519 0.2646 0.095  0.0198 0.0077]

4) Observability: periodic map, doors at [0, 5]
   max |p(x) - p(x+5)| over all steps = 0.0e+00
   final belief: p(0) = 0.4447, p(5) = 0.4447, true cell 0

5) Overconfident sensor model: filter assumes P(door | wall) = 0
   k=1 true=3 z=1 argmax=0 P(argmax)=0.3333 P(true)=0.3333 exactly zero: False
   k=2 true=4 z=1 argmax=4 P(argmax)=0.8182 P(true)=0.8182 exactly zero: False
   k=3 true=5 z=0 argmax=5 P(argmax)=0.7700 P(true)=0.7700 exactly zero: False
   k=4 true=6 z=1 argmax=3 P(argmax)=0.7232 P(true)=0.0000 exactly zero: True

Part 1 is the first step by hand. Predicting a uniform belief on a ring with any shift kernel leaves it uniform at 0.1 per cell. With the reading “door”, the unnormalized values are 0.8×0.1=0.080.8\times0.1=0.08 at each door and 0.1×0.1=0.010.1\times0.1=0.01 at each wall, so Z=3×0.08+7×0.01=0.3100Z=3\times0.08+7\times0.01=0.3100. Each door cell then has 0.2581 and each wall cell 0.0323. The posterior is not the likelihood: it is likelihood times prior, renormalized.

Part 2 runs eight steps. At k=1k=1 the three doors are equally likely (0.2581 each; the argmax 0 is just the first of the tie) and the entropy is 2.6316 bits. Two consecutive door readings followed by a wall single out the pair 3–4, and by k=3k=3 the true cell 5 holds 0.5523. The false door reading at k=4k=4 pulls the estimate to cell 3 (0.3485), while the true cell 6 keeps 0.2646, and the entropy rises to 2.5967 bits. Because the sensor model admits false alarms, the truth is never eliminated. The estimate drifts for two steps (argmax 7 and 8, with the true cell at 0.1508 and 0.1722), returns to the true cell at k=7k=7 (0.3467), and the final door reading at k=8k=8 gives 0.7191 on the true cell 0 with entropy 1.6408 bits.

Part 3 checks the recursion against the batch posterior. The program forms the full joint distribution over x0,…,x4x_0,\dots,x_4, which has 105=10000010^5=100000 entries (one per trajectory), and marginalizes it to p(x4∣y1:4)p(x_4\mid y_{1:4}). The result agrees with the recursive belief to better than 10−1210^{-12}; the marginal is [0.0499,0.0109,0.0654,0.3485,0.0864,0.0519,0.2646,0.095,0.0198,0.0077][0.0499, 0.0109, 0.0654, 0.3485, 0.0864, 0.0519, 0.2646, 0.095, 0.0198, 0.0077] for cells 0 to 9. Note that 0.3485 and 0.2646 are exactly the k=4k=4 values from Part 2. The batch table has Nk+1N^{k+1} entries and grows tenfold with each step. The recursion does the same fixed work every step: three shifted copies of a length-10 vector for the prediction and one elementwise product for the update.

Part 4 illustrates observability. With doors at 0 and 5 only, the map looks the same after a shift of five cells. Running the same true trajectory, the belief satisfies p(x)=p(x+5)p(x)=p(x+5) exactly at every step (largest difference 0.0e+00), and after eight steps p(0)=p(5)=0.4447p(0)=p(5)=0.4447, although the robot is at cell 0. No amount of such data can separate the two hypotheses. This is our discrete illustration of an unobservable state, not a theorem from the sources; the formal test in Barfoot is the linear rank condition above.

Part 5 shows a model error. If the filter assumes the sensor never gives a false alarm, P(door∣wall)=0P(\text{door}\mid\text{wall})=0, the first reading puts 1/3 on each door, and beliefs are sharper while readings are honest (0.8182 at k=2k=2, 0.7700 at k=3k=3). At the false reading at k=4k=4, every wall cell, including the true cell 6, gets probability exactly zero, and the filter puts 0.7232 on cell 3. Once a cell has probability zero, no later measurement can bring it back, because the update multiplies. The correctly specified model in Part 2 kept 0.2646 on the truth at the same step.

What no filter can do

This section lists the limits that apply to every filter, however well it is implemented.

The filter is only as good as its model. The Bayes filter is optimal under the assumed dynamic and measurement models. Part 5 shows that an overconfident likelihood can eliminate the true state outright and look confident while doing so. The proof also needs the Markov assumptions: if a sensor’s errors are correlated over time, the filter treats repeated readings as independent evidence and becomes overconfident. Barfoot calls the use of the Markov property in the estimator the cause of many limitations in recursive estimation. Markov assumption

Confidence is not observability. A peaked belief can still be wrong (Part 5), and a belief can stay split between hypotheses forever if the measurements cannot distinguish them (Part 4). In the linear case observability is a property of the model, checked by the rank of O\mathcal O, not of how sharp a posterior looks. An informative prior can make the batch solution unique even when the measurements alone would not.

Exact filtering is the exception. Grid filters scale with the number of cells, which grows exponentially with the state dimension; Kalman filters need linear-Gaussian models. Everything else is approximate, and each approximation (Gaussian moments, linearization, samples) brings its own failure modes, which belong to the articles on those filters.

This example is a toy. The corridor, the probabilities and the measurement sequence are invented, the state is one-dimensional and discrete, and the measurement sequence was chosen by hand to make each effect visible. It does not represent the performance of any real localization system.

Exercises

These exercises cover the two Markov assumptions, a hand calculation, overconfidence, method choice and an observability test.

  1. Why does the Bayes filter need both the Markov property of the states and the conditional independence of the measurements? What goes wrong if a sensor’s errors are strongly correlated over time?

    Answer: In the prediction step the Markov property replaces p(xk∣xk−1,y1:k−1)p(x_k\mid x_{k-1},y_{1:k-1}) by p(xk∣xk−1)p(x_k\mid x_{k-1}); in the update, conditional independence replaces p(yk∣xk,y1:k−1)p(y_k\mid x_k,y_{1:k-1}) by p(yk∣xk)p(y_k\mid x_k). These are the only two steps in Särkkä’s proof that use assumptions. With time-correlated sensor errors the second replacement is false: the filter counts repeated, correlated readings as independent evidence and becomes overconfident. One standard remedy, adding the correlated error to the state, is a modelling choice not covered by our sources.

  2. Same ring as the example (10 cells, doors at 0, 3, 4; P(door∣door)=0.8P(\text{door}\mid\text{door})=0.8, P(door∣wall)=0.1P(\text{door}\mid\text{wall})=0.1), uniform prior. (a) Verify the program’s first step for the reading “door”. (b) Compute the posterior if the first reading is “wall” instead.

    Answer: (a) Prediction keeps the uniform belief at 0.1. Unnormalized: door 0.8×0.1=0.080.8\times0.1=0.08, wall 0.1×0.1=0.010.1\times0.1=0.01; Z=3×0.08+7×0.01=0.31Z=3\times0.08+7\times0.01=0.31. Posterior: door 0.08/0.31=0.25810.08/0.31=0.2581, wall 0.01/0.31=0.03230.01/0.31=0.0323, matching the output. (b) Likelihoods are P(wall∣door)=0.2P(\text{wall}\mid\text{door})=0.2 and P(wall∣wall)=0.9P(\text{wall}\mid\text{wall})=0.9. Unnormalized: door 0.02, wall 0.09; Z=3×0.02+7×0.09=0.69Z=3\times0.02+7\times0.09=0.69. Posterior: door 0.02/0.69=0.02900.02/0.69=0.0290, wall 0.09/0.69=0.13040.09/0.69=0.1304. Check: 3×0.0290+7×0.1304≈1.0003\times0.0290+7\times0.1304\approx1.000.

  3. A colleague says: “Our filter gives a sharp, confident belief, so the state must be observable and the estimate must be right.” Give counterexamples from this article.

    Answer: (i) Confidence does not imply correctness: with the overconfident sensor model, the belief at k=4k=4 put 0.7232 on cell 3 and exactly 0 on the true cell 6. (ii) An unobservable ambiguity can persist behind a fairly concentrated belief: on the periodic map the belief sits on two cells (0.4447 each) and never resolves them. In the linear case observability is decided by the model through rank⁡O=N\operatorname{rank}\mathcal O=N, not by the shape of the posterior. (iii) Even a correct nonlinear posterior can yield a biased point estimate, as in Barfoot’s stereo example (mean error about −33.0 cm).

  4. Which realization of the Bayes filter would you choose for: (a) a cart with linear dynamics and Gaussian noise, measured by a linear range sensor; (b) a robot with mildly nonlinear motion and Gaussian noise; (c) a robot in a building with several identical corridors, where the belief must hold several separated hypotheses; (d) a small finite set of discrete cells or modes?

    Answer: (a) A Kalman filter, which is exact for linear-Gaussian models according to both books. (b) Start with an extended Kalman filter, following Särkkä’s advice, and move to other Gaussian approximations if it fails. (c) A single Gaussian cannot represent separated modes; use a sample-based particle filter or a grid filter and accept the higher cost. (d) A grid (discrete) Bayes filter, which Särkkä lists as closed-form for finite state spaces and which is cheap when the space is small, as in the example. The details belong to the separate articles on those filters.

  5. A 1-D cart has position pp and velocity vv with pk+1=pk+vkp_{k+1}=p_k+v_k and vk+1=vkv_{k+1}=v_k. (a) Only velocity is measured, C=[0   1]C=[0\;\,1]. Is the state observable? (b) Only position is measured, C=[1   0]C=[1\;\,0]?

    Answer: Here AA has rows (1,1)(1,1) and (0,1)(0,1). (a) CA=(0,1)CA=(0,1), so O\mathcal O has rows (0,1)(0,1) and (0,1)(0,1), rank 1, less than 2: unobservable. Shifting the whole position trajectory changes no measurement, the same kind of rigid shift as in Barfoot’s mass–spring picture. (b) CA=(1,1)CA=(1,1), so O\mathcal O has rows (1,0)(1,0) and (1,1)(1,1), rank 2: observable. Two position readings also determine the velocity.

History and further reading

This section summarizes the history as the two books tell it and suggests where to read next. Barfoot traces estimation back to Gauss, who used least squares to predict the position of the dwarf planet Ceres in 1801; he notes a debate over whether Legendre had priority. In 1960 Kalman introduced observability and the Kalman filter in two papers. Barfoot recounts that NASA soon used Kalman filtering for spacecraft trajectories, and that the Apollo 11 lunar module’s computer used a Kalman filter to estimate its position above the lunar surface from radar. History He cites Jazwinski (1970) when deriving the Bayes filter, and his timeline lists 1970 as the year Jazwinski coined the term. Bayes filter origin

Särkkä’s account starts optimal filtering with the Wiener filter, a frequency-domain solution for stationary signals, which he dates to 1950. Barfoot’s timeline places the Wiener filter in 1949; we report each book’s year rather than choosing one. Särkkä describes Kalman’s 1960 result as the recursive discrete-time solution, and notes that the Kalman–Bucy filter contains the Wiener filter as a limiting special case. He adds that the Kalman filter was soon recognized as a Bayesian filter, and in his preface credits Stratonovich with pioneering the Bayesian approach in the 1950s and 1960s, even before Kalman’s article. Origins We did not read Kalman, Wiener, Stratonovich or Jazwinski directly; these statements are as given by the two books.

For further study, Särkkä’s book develops the Gaussian and sample-based filters and smoothers chapter by chapter, and Barfoot’s book goes well beyond the opening chapters used here; we have not read those later parts. In a perception-driven controller such as visual servoing, depth or pose must itself be estimated online, which turns part of the control problem into a state-estimation problem. Related estimation ideas appear in maximum likelihood and the Gaussian distribution.

Make a prediction, then check

A 10-cell ring corridor has doors at cells 0, 3, 4; P(z = door | door) = 0.8, P(z = door | wall) = 0.1; the prior is uniform. After a first reading 'door', what is the posterior of each door cell and each wall cell?

Choose one answer

Learning objectives

  • Write the probabilistic state-space model and its two Markov assumptions, derive the Bayes filter's prediction step (Chapman–Kolmogorov equation) and update step, and carry out one step by hand on a discrete grid.
  • Explain why recursive estimation has constant per-step cost while the batch posterior grows, why the exact Bayes filter is implementable only in a few cases, and how observability and model misspecification limit any filter.

Prerequisites & connections

Explore related knowledge →

References

  1. Bayesian Filtering and Smoothing — scoped
    Simo Särkkä · 2013
  2. State Estimation for Robotics — scoped
    Timothy D. Barfoot · 2017

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Claude · 2026-12-03 · Independent AI check (Claude subagent, not the author; not a human or expert review). Research was done by a separate research subagent (facts.md) and the prose by a writer subagent; style-only edits suggested by the Gemini app were applied to the intuition section before this check, and all eight logged edits for this topic (gemini-edits-016a.json) were compared old/new and found to change no fact, hedge or attribution. I first made readability (D012) edits to the intuition section and section openings in both languages, then checked the edited text. I ran example.py with the pinned interpreter (numpy 1.26.4); output is byte-identical to example.stdout.txt, both python blocks are byte-identical to example.py, and every quoted number was compared with the output. I re-derived the first-step posterior (Z=0.31, 0.2581/0.0323), the 'wall' variant (Z=0.69, 0.0290/0.1304), the observability matrices of exercise 5 and the quiz answer. I fetched Särkkä 2013 (cup_book_online_20131111.pdf, pdftotext) and re-read the preface (Stratonovich), Ch. 1 pp. 1 and 7-14 (optimal filtering, process noise as model uncertainty, Wiener 1950, Kalman 1960b, Kalman-Bucy, batch intractability, constant per-step cost, closed-form classes incl. grid filters), §4.1-4.2 (Definition 4.1, Properties 4.1-4.2, Theorem 4.1 and proof) and §13.1. I fetched Barfoot (barfoot_ser17.pdf, pdftotext) and re-read Ch. 1 pp. 1-4 (state, history, timeline with Wiener 1949 and Jazwinski 1970, sensors, problem definition), §3.1.4 pp. 46-50 (existence/uniqueness, cases (i)/(ii), observability matrix, mass-spring Fig. 3.2), §4.1 pp. 95-96 (MAP bias -33.0 cm, 4.41 m^2, 1,000,000 trials, truth drawn from the prior) and §4.2.1-4.2.2 pp. 96-100 (Markov property, Bayes filter, the two reasons exact filtering is only possible in the linear-Gaussian case). I did not read other chapters, the primary papers cited through the books, and did not run the site validator or build.

  • The example was re-run with the pinned interpreter; output matches example.stdout.txt byte for byte, both code blocks match example.py, and all numbers in prose and exercises match the output or hand calculation.
  • The Bayes-filter predict/update steps and the proof's reliance on only the two Markov assumptions match Särkkä's Definition 4.1, Properties 4.1-4.2 and Theorem 4.1.
  • Exactly solvable cases are attributed per book: Barfoot names only the linear-Gaussian case; Särkkä also lists the RTS smoother and finite-state grid filters as closed-form.
  • Wiener-filter years are reported per book: 1950 in Särkkä, 1949 in Barfoot's timeline.
  • Observability conditions (sufficient not necessary, rank test, mass-spring picture) and the MAP-bias numbers (-33.0 cm, 4.41 m^2, truth drawn from the prior) were checked against the Barfoot pages read.
  • zh and en were compared section by section: claims, equations, numbers, exercises and answers match; the Gemini style edits changed no fact, hedge or attribution.

Source locations checked:

  • Bayesian Filtering and Smoothing — scoped · pdftotext of cup_book_online_20131111.pdf (printed page = PDF page − 20 in the main text). Contents pp. v–vii; Preface p. ix (Bayesian approach pioneered by Stratonovich in the 1950s–60s, before Kalman 1960). Ch. 1 p. 1 (optimal/Bayesian filtering definition, state, process noise, smoothing). §1.2 pp. 7–8 (Wiener 1950 stationary; Kalman 1960b recursive; Kalman–Bucy contains Wiener as limiting special case; Bayesian recognition; Stratonovich; DLM; LQG). §1.3 pp. 8–12 (eqs. 1.1–1.6, Figs. 1.5–1.9, intractability of batch posterior, Markov model, constant per-step cost). §1.4 pp. 12–14 (KF, RTSS, grid filters closed form; EKF, ERTSS, UKF, URTSS, particle, UPF, Rao–Blackwellised, grid approximations, others). §1.5 p. 14 (parameters, eq. 1.7). §3.3 p. 31 opening paragraph (posterior as next prior reproduces batch). §4.1–4.2 pp. 51–56 (Definition 4.1, Properties 4.1–4.2 eqs. 4.2–4.4, Example 4.1 Gaussian random walk, eqs. 4.7–4.9, Theorem 4.1 eqs. 4.10–4.13, discrete-sum remark, proof eqs. 4.14–4.16); §4.3 first paragraph eqs. 4.17–4.18. §13.1 pp. 204–206. NOT read: Ch. 2, rest of Ch. 3, KF equations beyond eq. 4.18, Ch. 5–12, §13.2 beyond its first paragraph, appendices.
  • State Estimation for Robotics — scoped · pdftotext of barfoot_ser17.pdf ('unofficial version compiled December 10, 2022'; printed page = PDF page − 16). Revision history pp. iii–iv skimmed. Ch. 1 pp. 1–4: state definition; seafaring, Harrison 1764; Gauss least squares Ceres 1801 and Legendre footnote; Kalman 1960a observability and 1960b filter; NASA Ranger/Mariner/Apollo, Apollo 11 LM radar; timeline sidebar (incl. 'Jazwinski coins Bayes filter', 1970); sensors' limited precision; interoceptive/exteroceptive with GPS+IMU and star tracker+gyros examples; estimation problem definition; start of §1.3. §3.1.3 end and §3.1.4 pp. 46–50: eqs. 3.32–3.48, cases (i)/(ii), Cayley–Hamilton, observability matrix, margin definition of observable, mass–spring Fig. 3.2; start of §3.1.5 eqs. 3.49–3.51. Ch. 4 opening and §4.1 pp. 91–96: LG vs nonlinear, stereo model eq. 4.1, MAP eqs. 4.6–4.10, e_mean and e_sq eqs. 4.11–4.13, Fig. 4.4 (−33.0 cm, 4.41 m², 1,000,000 trials). §4.2.1–4.2.2 pp. 96–100: eq. 4.14, Markov property, Bayes filter (Jazwinski 1970) eqs. 4.15–4.20, Fig. 4.6, two reasons for approximation. §4.2.3 pp. 100–101 opening (Schmidt/Apollo EKF history, eqs. 4.21–4.26 skimmed). NOT read: §4.1.1 details pp. 92–93, Ch. 2, §3.1.1–3.1.2, §3.2–3.4 (incl. §3.3.7), §4.2.4 onward, Parts II–III.

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.