This is a linear Gaussian Filter.

We make some assumptions when using the Kalman Filter. Namely:

  • The initial state is normally distributed.
  • The system is linear.
  • The noise is normally distributed.
  • The transitions between states are Markovian.

Priori (Predict)

State Estimator

Consider a robot which has a position and velocity. We assume constant acceleration for simplicity, but in reality, this increases the dimension of our calculations by 1.

Hence, we have, at timestep :

We can then propagate an estimate for the position and velocity after a given change in time, , using the transition matrix , such that:

If we have a control input, , this would also affect this measurement, namely . Assuming this isnโ€™t the case, we have an estimate:

where is zero-mean Gaussian noise.

We then have a priori estimation of the state. The superscript minus () means the estimate is a prior prediction (before the update step).

Covariance Estimator

We also require knowledge of the spread of our prediction - this is dependent on the process noise and the covariance at the previous timestep. We have:

given our transition matrix, , from before, and the variance of the process noise, also from before ().

Kalman Gain

We should consider what weighting an observation (measurement) has, compared to a prediction, based on their respective variances. A smaller variance means a larger contribution to the state estimate.

Given a measurement model , we can form the Kalman gain, based upon the Covariance Estimator and the measurement noise, :

We have:

Posteriori (Update)

We can then form a posterior prediction (output) from our determined priori and Kalman gain. This is the update step.

State Estimator

We use the priori and the Kalman gain to determine the state. We have here, which is the observation at time :

Covariance Estimator

We can then form an estimate of the covariance at time . This is:

Where is the identity matrix.

We can then return .