stochastic filtering - a brief tutorialrmcastro/publications/stochastic_filtering.pdf · stochastic...

31
Stochastic Filtering Stochastic Filtering A brief tutorial Rui Castro © 2006 - Rui Castro

Upload: dinhquynh

Post on 26-May-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Stochastic FilteringStochastic Filtering

A brief tutorial

Rui Castro

© 2006 - Rui Castro

Page 2: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

MotivationIn many applications one wants to track time-varying processes

Example: tracking temperature in a museum room with a inaccurate thermometer with large error.

How can we accurately estimate the room temperature???

© 2006 - Rui Castro

Page 3: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Motivation

Some kind of windowed estimate should do the trick... (low pass filtering)

Key fact: Knowledge of the process dynamics (i.e., temperature changes sloooooowly...

© 2006 - Rui Castro

Page 4: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Modeling - Dynamics

The distribution of depends only on the value of .Together with the knowledge of this completely defines the random process

Dynamics Kernel

This random process is the quantity we are interested in estimating (e.g., temperature of the room)

© 2006 - Rui Castro

Page 5: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Dynamics - Example

Position-Velocity (PV) Model:

Discrete counterpart:

Velocity is modeled as Brownian motion

© 2006 - Rui Castro

Page 6: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Observation Model

In general we cannot observe the process directly

Model Assumptions:

• Observation at time n depends only on state at that time

• Observations do not affect the physical process

Observation Likelihood

© 2006 - Rui Castro

Page 7: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Main Goal

Given a set of observations up to time n,

we want to estimate .

We follow a Bayesian approach, therefore all the information about is provided by the density

Filtering Density

How do we do it???© 2006 - Rui Castro

Page 8: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Can we estimate ?

After we observe we can use Bayes rule

Density Propagation – First Observation

Prior Density

© 2006 - Rui Castro

Page 9: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Density Propagation – Prediction

Can we predict ?

© 2006 - Rui Castro

Page 10: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Our prediction is then given by

Prediction Density

Density Propagation – Prediction

© 2006 - Rui Castro

Page 11: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Density Propagation – General

Start with a prediction based on previous observations

Prediction Density

After we observe we can compute

© 2006 - Rui Castro

Page 12: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Density Propagation – General

We can now predict

© 2006 - Rui Castro

Page 13: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Density Propagation – Graphically

© 2006 - Rui Castro

Page 14: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Density Propagation – Filtering

© 2006 - Rui Castro

Page 15: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Density Propagation – Prediction

© 2006 - Rui Castro

Page 16: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Main Goal

Now that we have

what do we do with it? That is, how do we construct an estimate

Many possibilities, for example if we want to minimize

the optimal choice is

© 2006 - Rui Castro

Page 17: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

A Particular Case: The Kalman Filter

And, very important

In other words, we assume that

© 2006 - Rui Castro

Page 18: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

A Particular Case: The Kalman Filter

Since

are all Gaussian it follows that

and

are also Gaussian (because the product of two Gaussians is a Gaussian and the convolution of two Gaussians is also a Gaussian).

Therefore we need only to propagate means and covariance matrices (a nice closed form solution)

© 2006 - Rui Castro

Page 19: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

A Particular Case: The Kalman Filter

Start with the prediction density

After we observe compute

Compute the updated prediction

© 2006 - Rui Castro

Page 20: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

A Particular Case: The Kalman Filter

Taking

yields the Kalman Filter

Numerous applications, but restricted to linear models

What if models are non-linear???

© 2006 - Rui Castro

Page 21: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

The Extended Kalman Filter

Suppose is normal

If our prediction density is “accurate” then

Idea: Linearize around the prediction mean

© 2006 - Rui Castro

Page 22: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

The Extended Kalman Filter

Similarly, if

© 2006 - Rui Castro

Page 23: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

The Extended Kalman Filter

This procedure is widely used in practice, for example in the

Global Positioning System – GPS

The Extended Kalman filter works is you have an accurate clock and know where you are... If not the linearization is poor and there’s not much you can do

Distance measured using an

accurate clock

© 2006 - Rui Castro

Page 24: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Other Non-Linear Model Procedures

Approximation of non-linearities by Gaussian Mixture models

Evaluate the densities only at a finite (fixed) set of points – the Point-Mass Filter

Effective only in small state spaces!!!© 2006 - Rui Castro

Page 25: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Particle Filters

Same idea as in the point-mass filter, but dynamically allocate the location of the point masses.

In other words, describe the densities in a empirical way, though a set of samples:

The samples can be used to compute almost

anything interesting about the density

© 2006 - Rui Castro

Page 26: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Condensation Algorithm (Blake et al)

Start with samples from

Importance Sampled

Filtering Density

© 2006 - Rui Castro

Page 27: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Condensation Algorithm

Sample according to these importance samples and simulate the dynamics model

Keep repeating these two steps as you collect more observations

© 2006 - Rui Castro

Page 28: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Condensation Algorithm

This procedure is asymptotically optimal as the number of particles grows

Many “tricks of the trade” can be used to improve performance and reduce computational cost, namely:

• Choose the number of particles dynamically• Augment/reduce the size of the dynamical model to allow multi-target tracking

Key Fact: For computationally feasible procedures the model of the dynamics must be easily simulated.

Recently, non-asymptotic guarantees for these procedures became available.

© 2006 - Rui Castro

Page 29: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

A Tracking Example

Tracking an orange (clementine), in clutter (including other oranges). Movie taken with a handheld camera (no camera motion registration).

© 2006 - Rui Castro

Page 30: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

A Tracking Example

A particle filter tracking the left-most orange, using a PV dynamics model and 1000 particles.

© 2006 - Rui Castro

Page 31: Stochastic Filtering - A brief tutorialrmcastro/publications/stochastic_filtering.pdf · Stochastic Filtering A brief tutorial RuiCastro ©2006 -RuiCastro. ... A particle filter tracking

Final Remarks

Stochastic Filtering is a very general (Bayesian) framework for sequential estimation in a model-based setting.

For linear and Gaussian models the densities being propagated have a closed-form solution and the result is simply the well known Kalman filter.

When using non-linear models closed-form solutions are generally not possible, and so approximate methods need to be used.

© 2006 - Rui Castro