Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 2

Modeling Uncertainty with Gaussian Distributions

Recommended resources

In our last lesson, we established a precise way to describe a robot's pose using homogeneous transformation matrices. This gives us a deterministic, exact location and orientation. However, the real world is rarely so clean. In this lesson, we will confront a fundamental reality of robotics: uncertainty. No sensor is perfect, and no motor executes a command with flawless precision. We must account for this.

Your goal is to build robust autonomous systems, and a key part of that is managing and reasoning about uncertainty. This lesson provides the mathematical language to do so. You will learn to model sensor noise and the robot's belief about its state using one of the most powerful tools in probability: the Gaussian distribution. We will go beyond a simple bell curve and explore how multi-dimensional states are described by a mean vector and, critically, a covariance matrix, which captures the intricate relationships between different sources of uncertainty.

1. From Certainty to Probability

In the last lesson, we described a robot's pose with a single 4x4 matrix, . This implies we know its position and orientation exactly. In reality, a robot's internal estimate of its pose is always a belief, not a fact. This belief is shaped by two perpetually noisy processes:

  • Motion (Actuation): When the robot's control system commands the wheels to "move forward 1 meter," wheel slip, uneven ground, and motor dynamics mean the actual motion will be something like 0.98 meters, perhaps with a slight turn of 0.5 degrees. This is called process noise.
  • Sensing (Perception): When a laser scanner measures the distance to a wall, atmospheric effects, sensor imperfections, and surface properties introduce errors. A true distance of 5.0 meters might be read as 4.99m or 5.02m. This is called measurement noise.

To build intelligent systems, we must model the robot's state not as a single value, but as a probability distribution that represents its belief.

MSR Course - 05 Motion and Sensor Models (Stachniss)

Professor Cyrill Stachniss provides an excellent introduction to why we need probabilistic models in robotics.

First, watch the section on motion uncertainty to understand the core problem. Then, see how this uncertainty is described as a probability distribution. Finally, watch the brief introduction to observation models to see how the same principles apply to sensors.


2. The Gaussian Distribution: A Model for Uncertainty

The most common way to represent this belief is with a Gaussian (or Normal) distribution. For a single variable, like the robot's x-position, the Gaussian is defined by two parameters:

  • The mean (): This is our best guess, or the most likely value, of the robot's position.
  • The variance (): This quantifies our uncertainty. A small variance means we are very confident in our estimate (the bell curve is tall and narrow). A large variance means we are very uncertain (the curve is short and wide). The standard deviation, , is the square root of the variance.

However, a robot's state is rarely a single number. At a minimum, its pose in 2D is . To model this, we need the Multivariate Gaussian Distribution.

In the multivariate case:

  • The mean becomes a mean vector , where each element is the mean of a state variable. For a 2D position, .
  • The variance becomes a covariance matrix .
A multivariate Gaussian distribution for a 2D state vector \(\mathbf{x} = [x, y]^T\). The distribution is described by a mean vector \(\boldsymbol{\mu}\) and a covariance matrix \(\boldsymbol{\Sigma}\). The 3D plot shows the probability density, while the 2D contour plot shows curves of constant probability.

3. The Covariance Matrix: Understanding Correlated Uncertainty

The covariance matrix is the heart of modeling multivariate uncertainty. For a 2D state , the 2x2 covariance matrix looks like this:

Let's break this down:

  • Diagonal Elements (): These are the variances of each variable independently. tells you the uncertainty along the x-axis, and tells you the uncertainty along the y-axis.
  • Off-Diagonal Elements (): These are the covariances. Since the matrix is symmetric, . This term is crucial: it describes how the uncertainties in and are correlated.
    • If , the errors in and are uncorrelated. Knowing something about the error in tells you nothing about the error in . The uncertainty ellipse is aligned with the coordinate axes.
    • If , and are positively correlated. This means that if the robot is actually further along than its estimated mean, it is likely also further along . The uncertainty ellipse is tilted with its major axis pointing into the first and third quadrants.
    • If , and are negatively correlated. If the robot is further along , it is likely less far along . The uncertainty ellipse is tilted the other way.

The following image perfectly illustrates this effect.

The sign of the off-diagonal covariance term determines the orientation of the uncertainty ellipse. A positive covariance indicates that the variables tend to increase or decrease together. A negative covariance indicates that as one variable increases, the other tends to decrease.

4. The Geometry of Covariance

The shape and orientation of the uncertainty ellipses are not arbitrary. They are determined by the algebraic properties of the covariance matrix, specifically its eigenvectors and eigenvalues. This provides a deep connection between the linear algebra of transformation matrices we studied previously and the probabilistic representation of state.

Multivariate Gaussian distributions

The video "Multivariate Gaussian distributions" by Alexander Ihler provides a rigorous and clear mathematical explanation of these concepts. This will solidify the foundation you requested.

Please watch the following segments: The definition of the multivariate Gaussian. The visualization as a bell-shaped curve and elliptical contours. The section on independent variables, which shows how a diagonal covariance matrix leads to axis-aligned ellipses. The crucial explanation of the geometry and eigen decomposition, which connects the eigenvectors/eigenvalues of the covariance matrix to the axes of the uncertainty ellipse. Finally, watch the section on sampling to see how this decomposition is used constructively to generate data with the desired correlational structure.

As you saw in the video, the eigenvectors of point along the principal axes of the uncertainty ellipse, and the square roots of the corresponding eigenvalues define the length of those axes. This is a powerful insight: the abstract concept of correlation is made geometrically concrete by the structure of the covariance matrix.


5. A Formal Representation for Robotic Systems

This probabilistic view is so central to modern robotics that entire frameworks are built around it. A robot's belief about its own state and the state of objects in the world can be represented by a very large state vector and an associated (and even larger) covariance matrix.

[PDF] Estimating Uncertain Spatial Relationships in Robotics - MIT

A foundational 1990 paper from MIT, "Estimating Uncertain Spatial Relationships in Robotics," formalized this approach. We will read the section that defines the representation.

In the PDF, please read Section 2.1, "Representation," starting on page 2. Focus on the definitions of the system state vector and the system covariance matrix. Notice how the covariance matrix is composed of smaller blocks: the diagonal blocks C(xi) are the covariance matrices for individual objects, and the off-diagonal blocks C(xi, xj) are the cross-covariance matrices that encode the dependencies between the estimates of different objects.

This "stochastic map" representation, where the state is a pair , is the foundation for almost all modern state estimation and SLAM (Simultaneous Localization and Mapping) systems. When a robot moves or senses, it's not just updating its state estimate ; it's also updating its uncertainty according to the rules of probability.


Conclusion

In this lesson, we've made a critical shift from a deterministic world to a probabilistic one. You now have the fundamental tools to represent and reason about uncertainty, which is an unavoidable aspect of any real-world autonomous system.

Here are the key takeaways:

  • Robot motion and sensing are inherently noisy, so we represent the robot's knowledge as a belief, which is a probability distribution.
  • The Gaussian distribution is a common and powerful model for this belief, defined by a mean vector () and a covariance matrix ().
  • The mean is our best estimate of the state.
  • The covariance matrix quantifies our uncertainty. Its diagonal elements are the variances of individual state variables, and its crucial off-diagonal elements represent the correlation between them.
  • The geometry of the covariance matrix, visualized as an uncertainty ellipse, is determined by its eigenvectors and eigenvalues.

We can now represent not just where a robot is, but also how sure it is about its location. The next question is, what happens to this belief when the robot moves? Propagating a Gaussian distribution through a robot's motion model requires another essential mathematical tool. In the next lesson, we will dive into calculus and learn to compute partial derivatives and Jacobians, which are the keys to propagating uncertainty through the non-linear functions that govern robot dynamics.