# Understanding and Applying Kalman Filtering

Topics: Kalman filter, Estimation theory, Control theory Pages: 37 (2004 words) Published: May 26, 2014
Understanding and Applying
Kalman Filtering
Lindsay Kleeman
Department of Electrical and Computer Systems Engineering
Monash University, Clayton

1

Introduction
Objectives:
1. Provide a basic understanding of Kalman Filtering and assumptions behind its implementation.
2. Limit (but cannot avoid) mathematical treatment to broaden appeal. 3. Provide some practicalities and examples of implementation. 4. Provide C++ software overview.

2

What is a Kalman Filter and What Can It Do?
A Kalman filter is an optimal estimator - ie infers parameters of interest from indirect, inaccurate and uncertain observations. It is recursive so that new measurements can be processed as they arrive. (cf batch processing where all data must be present).

Optimal in what sense?
If all noise is Gaussian, the Kalman filter minimises the mean square error of the estimated parameters.

3

What if the noise is NOT Gaussian?
Given only the mean and standard deviation of noise, the Kalman filter is the best linear estimator. Non-linear estimators may be better.

Why is Kalman Filtering so popular?

Good results in practice due to optimality and structure.

Convenient form for online real time processing.

Easy to formulate and implement given a basic understanding.

Measurement equations need not be inverted.

4

Word examples:

Determination of planet orbit parameters from limited earth observations.

Tracking targets - eg aircraft, missiles using RADAR.

Robot Localisation and Map building from range sensors/ beacons.

Why use the word “Filter”?
The process of finding the “best estimate” from noisy data amounts to “filtering out” the noise.
However a Kalman filter also doesn’t just clean up the data measurements, but also projects these measurements onto the state estimate.

5

What is a Covariance Matrix?
The covariance of two random variables x1 and x2 is

cov( x1 , x2 ) ≡
=

∫ ∫

−∞ −∞

E [( x1 − x1 )( x2 − x2 )]
( x1 − x1 )( x 2 − x 2 ) p( x1 , x1 )dx1dx 2
σ 21 x2
x

where p is the joint probability density function of x1 and x2. The correlation coefficient is the normalised quantity

ρ12 ≡

2
σ x1x2

σ x1σ x 2

, − 1 ≤ ρ12 ≤ +1

6

The covariance of a column vector x=[x1 .. xn]’ is defined as

cov( x ) ≡
=

−∞

E [( x − x )( x − x )' ]

... ∫ ( x − x )( x − x )' p( x ) dx1 .. dx n
−∞
Pxx

and is a symmetric n by n matrix and is positive definite unless there is a linear dependence among the components of x.
The (i,j)th element of Pxx is

σ 2i x j
x

Interpreting a covariance matrix:
diagonal elements are the variances, off-diagonal encode correlations.

7

Diagonalising a Covariance Matrix
cov(x) is symmetric => can be diagonalised using an orthonormal basis. By changing coordinates (pure rotation) to these unity orthogonal vectors we achieve decoupling of error contributions.
The basis vectors are the eigenvectors and form the axes of error ellipses. The lengths of the axes are the square root of the eigenvalues and correspond to standard deviations of the independent noise contribution in the direction of the eigenvector.

Example: Error ellipses for mobile robot odometry derived from covariance matrices:

8

E

D to E

Error Ellipses corresponding to 50 standard deviations

D
C to D
A to B
B to C

C
B

A

9

3
10000 Monte-Carlo runs for k L = k R = 10 − m 2 , B=0.5 m
1

Means

Covariance Matrix

3.032e-5 -4.763e-5 -2.817e-5
0
Theor-4.763e-5 8.974e-5 4.700e-5
0
etical
-2.817e-5 4.700e-5 3.4849e-5
0
results
Run 1 -1.997e-5 2.980e-5 -4.651e-5 2.761e-5
5.321e-5 -4.651e-5 8.708e-5 4.585e-5
10000
3.184e-5 -2.761e-5 4.585e-5 3.437e-5
samples

10

Stand dev/ Corr Matrix
0.005506 -0.913208 -0.8667
-0.9132 0.009473 0.8404
-0.8667 0.8404
0.005903
0.005459 -0.9130 -0.8627
-0.9130 0.009332 0.8380
0.8627 0.8380 0.005862...