You are on page 1of 11

12/14/2011

Lecture 11
Kalman Filters Basics

Dr. Tahir Zaidi

Overview

What is a Kalman Filter?

Conceptual Overview

The Theory of Kalman Filter (only the equations


you need to use)

Simple Example

12/14/2011

What is a Filter by the way?


Class Define mathematically what a filter is ?
Some applications of Kalman Filtering (or Filtering in general):
1) Your Car GPS (predict and update location)
2) Surface to Air Missile (hitting the target)
3) Ship or Rocket navigation (Appollo 11 used some sort of

filtering to make sure it didnt miss the Moon!)

The Problem in General


Black Box
System
Error Sources

External
Controls

System

Sometimes the system state


and the measurement may
be two different things

System State
(desired but not
known)
Optimal
Estimate of
System State

Observed
Measurements

Measuring
Devices

Estimator

Measurement
Error Sources

System state cannot be measured directly


Need to estimate optimally from measurements

12/14/2011

What is a Kalman Filter?

Recursive data processing algorithm


Generates optimal estimate of desired quantities
given the set of measurements
Optimal?
For

linear system and white Gaussian errors, Kalman


filter is best estimate based on all previous
measurements
For non-linear system optimality is qualified

Recursive?
Doesnt

need to store all previous measurements and


reprocess all data each time step

Conceptual Overview

Simple example to show workings of Kalman Filter

The essential equations you need to know

Examples: Prediction and Correction

12/14/2011

Conceptual Overview

Lost on the 1-dimensional line (imagine that you are


guessing your position by looking at the stars using
sextant)
Position y(t)
Assume Gaussian distributed measurements

Conceptual Overview
0.16

State space position


Measurement - position

0.14
0.12
0.1
0.08
0.06
0.04
0.02
0

10

20

30

40

50

60

70

80

90

100

Sextant Measurement at t1: Mean = z1 and Variance = z1 Sextant is not


perfect
Optimal estimate of position is: (t1) = z1
Variance of error in estimate: 2x (t1) = 2z1
Boat in same position at time t2 - Predicted position is z1
8

12/14/2011

Conceptual Overview
0.16
0.14

prediction -(t2)
State (by looking
at the stars at t2)

0.12

Measurement
usign GPS z(t2)

0.1
0.08
0.06
0.04
0.02
0

10

20

30

40

50

60

70

80

90

100

So we have the prediction -(t2)

GPS Measurement at t2: Mean = z2 and Variance = z2

Need to correct the prediction by Sextant due to measurement to get (t2)

Closer to more trusted measurement should we do linear interpolation?


9

Conceptual Overview
prediction -(t2)
0.16

corrected optimal
estimate (t2)

0.14

Kalman filter helps you fuse


measurement and prediction
on the basis of how much
you trust each

0.12
0.1
0.08

measurement
z(t2)

0.06
0.04
0.02
0

10

20

30

40

50

60

70

80

90

100

Corrected mean is the new optimal estimate of position (basically


youve updated the predicted position by Sextant using GPS
New variance is smaller than either of the previous two variances

10

12/14/2011

Conceptual Overview
(The Kalman Equations)

Lessons so far:
Make prediction based on previous data - -, -

Take measurement zk, z

Optimal estimate () = Prediction + (Kalman Gain) * (Measurement - Prediction)


Variance of estimate = Variance of prediction * (1 Kalman Gain)

11

Conceptual Overview

Lessons learnt from conceptual overview:


conditions (k-1 and k-1)
Prediction (-k , -k)
Initial

Use initial conditions and model to make prediction

Measurement (zk)

Take measurement

Correction (k , k)
Use measurement to correct prediction by blending
prediction and residual always a case of merging only two
Gaussians
Optimal estimate with smaller variance

12

12/14/2011

Blending Factor
If we are sure about measurements:
Measurement error covariance (R) decreases to zero
K decreases and weights residual more heavily than prediction

If we are sure about prediction


Prediction error covariance P-k decreases to zero
K increases and weights prediction more heavily than residual

13

The set of Kalman Filtering Equations in Detail

Predictor Corrector structure

The use of observations to compute a forward prediction error innovations,


The use of the innovation to update (correct) the minimum mean-square
estimate of a r.v. related linearly to the observations

14

12/14/2011

Assumptions behind Kalman Filter


The model you use to predict the state needs to
be a LINEAR function of the measurement
The model error and the measurement error
(noise) must be Gaussian with zero mean

15

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.
ALSO popular in hydrosciences, weather/oceanography/
hydrologic modeling, data assimilation
16

12/14/2011

Summary

Kalman Filters

Adaptive Signal Processing

17

Adaptive Signal Processing

18

Summary

Kalman Filters

12/14/2011

Estimation of the State

Kalman gain computer

Kalman Filters

Adaptive Signal Processing

19

Estimation of the State

Riccati equation solver

Kalman Filters

Adaptive Signal Processing

20

10

12/14/2011

Estimation of the State

One step prediction algorithm

Kalman Filters

Adaptive Signal Processing

21

Adaptive Signal Processing

22

Filtering

Kalman filter based


on one-step
prediction

Kalman Filters

11

You might also like