State inference in HMM

Let's start with a simple example to show what kind of interesting questions we can ask our HMM models. We are taking an example of robot localization. There are a lot of variations of this example, but we are assuming that a robot is moving in a 2D grid, as shown in Figure 3.1. The robot also has four sensors on it. Each of these sensors detects whether there's a wall right next to the robot in the sensor's direction.

We would like to model the movement of the robot in the following grid along with the observations from our sensors:

Figure 3.1: The probability distribution of the position of the robot over time

In ...

Get Hands-On Markov Models with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.