Kalman Filters

Download Report

Transcript Kalman Filters

Kalman Filters
DHARMIN MAJMUDAR
What is Filtering?
 Filtering is the task of computing the belief state –
the posterior distribution over the most recent state
– given all evidence to date.
 Filtering is also called state estimation.

Umbrella example
 Filtering is what a rational agent does to keep track
of the current state so that rational decisions can be
made.
Filtering
 A useful filtering algorithm needs to maintain a
current state estimate and update it, rather than
going back over the entire history of percepts for
each update.

Cost (Money, Time, Battery charge, etc.)
 In other words, given the result of filtering up to time
t, the agent needs to compute the result for t+1 from
the new evidence et+1, for some function f,
P(Xt+1|e1:t+1) = f(et+1,P(Xt|e1:t))
 This process is called recursive estimation.
Covariance Matrix
 Covariance of two random variables is a measure of how much they
change together, i.e. it is the expectation of the product of their
differences from their means.
 If the entries in the column vector
are random variables, each with finite variance, then the covariance
matrix Σ is the matrix whose (i, j) entry is the covariance
∑ij = cov(Xi,Xj) = E[(Xi – μi)(Xj – μj)]
where μi = E(Xi) is the expected value of the ith entry in the vector X.
Kalman Filters
 Its purpose is to use measurements that are observed
over time that contain noise (random variations) and
other inaccuracies, and produce values that tend to
be closer to the true values of the measurements.
 It produces estimates of the true values of
measurements and their associated calculated values
by predicting a value, estimating the uncertainty of
the predicted value, and computing a weighted
average of the predicted value and the measured
value.
What does a Kalman Filter do, anyway?
 Given the linear dynamical system:
x(k+1) = F(k)x(k) + G(k)u(k) + v(k)
y(k) = H(k)x(k) + w(k)
 where,
 x(k) is the n - dimensional state vector
 u(k) is the m – dimensional input vector
 y(k) is the p – dimensional output vector
 F(k), G(k), H(k) are State-transition model, control-input model and
observation-model respectively.
 v(k), w(k) are zero-mean, white Gaussian noise with covariance
matrices Q(k), R(k)
 The Kalman Filter is a recursive estimator that provides the
“best” estimate of the state vector x.
Adapted from: George Kantor’s presentation at Carnegie Mellon University
What’s so great about that!!
x(k+1) = F(k)x(k) + G(k)u(k) + v(k)
y(k) = H(k)x(k) + w(k)
 noise smoothing (improve noisy measurements)
 state estimation
 recursive (computes next estimate using only most recent
measurement)
Adapted from: George Kantor’s presentation at Carnegie Mellon University
How does it work?
x(k+1) = F(k)x(k) + G(k)u(k) + v(k)
y(k) = H(k)x(k) + w(k)
1. Prediction based on last estimate:
2. Calculate correction based on prediction and
current measurement:
3. Update Prediction:
Adapted from: George Kantor’s presentation at Carnegie Mellon University
Truck Example
 Truck equipped with GPS.
 Position can be estimated by 2 ways:
 Current Co-ordinates given by GPS.
 Integrate speed and direction over time (Dead Reckoning)
 Problems:
 GPS: Reading “jumps around” within few meters.
 Dead Reckoning: Smalls errors accumulate over time leading
to improper readings.

Additionally, the truck is expected to follow the laws of physics, so
its position should be expected to change proportionally to its
velocity.
Kalman Filter with Truck Location Problem
 In this example, the Kalman filter can be thought of as
operating in two distinct phases: predict and update.
 In the prediction phase, the truck's old position will be
modified according to the physical laws of motion (the
dynamic or "state transition" model) plus any changes
produced by the accelerator pedal and steering wheel.
 Not only will a new position estimate be calculated, but a
new covariance will be calculated as well. Perhaps the
covariance is proportional to the speed of the truck
because we are more uncertain about the accuracy of the
dead reckoning estimate at high speeds but very certain
about the position when moving slowly.
Kalman Filter with Truck Location Problem
 Next, in the update phase, a measurement of the
truck's position is taken from the GPS unit. Along with
this measurement comes some amount of uncertainty,
and its covariance relative to that of the prediction from
the previous phase determines how much the new
measurement will affect the updated prediction.
 Ideally, if the dead reckoning estimates tend to drift away
from the real position, the GPS measurement should pull
the position estimate back towards the real position but
not disturb it to the point of becoming rapidly changing
and noisy.