# In a discrete bayes filter, why is noise in the sensor treated differently than noise in the motion

This question may be hard to explain or understand. I am studying Kalman Filters using this excellent resource. It divides up the process of a Bayesian Filter into two major steps, belief -> prior and prior -> posterior. There is an extended example involving a hallway with doors and a robot (dog) that we are trying to localize.

We start with a 'belief' of where the robot is along the hallway. In the first step we take that 'belief' and incorporate information from a sensor with respect to the environment (e.g. is what is the probability that it is looking at door and from that it comes up with a preliminary probability distribution of where the robot is along the hallway, which is called the 'prior'. Now the robot moves 0 1 or 2 steps. Using that probability distribution, we update the distribution of where the robot might be - this is called the 'posterior'. The cycle is repeated using the posterior of one step as the 'belief' of the next cycle.

Ok so far? Please correct me if I am stating it wrong.

My question is this: the sensing of the door has a probability of being accurate, in other words, the sensor has a certain probability of giving an erroneous reading. And the sensing of the motion also has a chance to be inaccurate, in other words, the robot might think it moved one spot but it really didn't at all.

This may be overthinking it but I want to understand why those two sources of error are treated differently or specially. Why do they have different names (belief, prior, posterior), why do they have to be in that order, why couldn't you have a third measurement which also could have an error factor?

• The link you posted is unavailable to us since it is a jupyter notebook on localhost. Nov 30 '19 at 23:10
• I fixed it in the main body. Dec 1 '19 at 2:10

The reason the two sources of error are treated differently is because.. they are different. To some extent, this is a matter of terminology. Imagine you're walking in a room where the lights keep flickering. Let's say you take five steps towards a door in the dark, and you can predict how far you might have walked in meters based on muscle memory - but you're very likely to be off by a bit. This is your belief, or a prior. Your internal conversion of "footsteps->how close I am to the door" is the 'system model', or 'process model'. While this is technically a type of measurement, you are not explicitly using external information. When the lights do flicker on, you might notice you're much closer to the wall than you'd initially thought. You take this measurement, and update your belief: i.e., convert the prior to a posterior. By doing this update, you've effectively reduced the error in your own position estimate. This predict->update cycle is the crux of a Kalman filter.

In your robot scenario, it is very likely that the robot might have very expensive, accurate encoders that can measure ego-motion (proprioceptive sensing) very well, but a cheap camera or a rangefinder that outputs erroneous measurements of the environment (exteroceptive sensing). When trying to describe the error characteristics of a system, it is conventional to use data from a spec sheet or something similar, that affords you some information as to the error thresholds of the measured quantity, and thus, the two error sources could have different variances. Hence, when going through the predict/update steps of the Kalman filter, it is important to describe the error characteristics for both the steps accurately.

And yes, you can have as many measurements as you want, each with a different source of error. In this case, the Kalman filter cycle would look like this:

predict
update from sensor 1
update from sensor 2
.
.
update from sensor k
predict
update from sensor 1
<so on>

• Thanks first of all for understanding my question because I had a hard time even formulating it. Your response makes sense and clarifies things for me a lot. So the key about the "predict" step and the "system model" both have to do with how many times each wheel rotates and the kinematic calculation and the premise is that neither one is sensing the outside world they are purely predicting based on internal state. What in the scenario of a drone where there's no internal prediction of position, how would that fit? Dec 4 '19 at 16:45