Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Elaborate EKF Example

Simple linear Kalman filter on a moving 2D point using factor graphs in GTSAM. This example manually creates all of the needed data structures to show how the Kalman filter works under the hood using factor graphs, but uses a loop to handle the repetitive prediction and update steps.

Author: Matt Kielo. Based on the C++ example by Frank Dellaert and Stephen Williams

Open In Colab

The code below basically implements the SRIF (Square-root Information filter version of the EKF) with Cholesky factorization.

X1 Predict: [1. 0.]
X1 Update: [1. 0.]
X2 Predict: [2. 0.]
X2 Update: [2. 0.]
X3 Predict: [3. 0.]
X3 Update: [3. 0.]

Elaborate Final Covariance (after update):
 [[0.0193 0.    ]
 [0.     0.0193]]