An introduction to particle filters Andreas Svensson Department of - - PowerPoint PPT Presentation

an introduction to particle filters
SMART_READER_LITE
LIVE PREVIEW

An introduction to particle filters Andreas Svensson Department of - - PowerPoint PPT Presentation

An introduction to particle filters Andreas Svensson Department of Information Technology Uppsala University June 10, 2014 June 10, 2014, 1 / 16 Andreas Svensson - An introduction to particle filters Outline Motivation and ideas Algorithm


slide-1
SLIDE 1

An introduction to particle filters

Andreas Svensson

Department of Information Technology Uppsala University

June 10, 2014

June 10, 2014, 1 / 16 Andreas Svensson - An introduction to particle filters

slide-2
SLIDE 2

Outline

Motivation and ideas Algorithm High-level Matlab code Practical aspects Resampling Computational complexity Software Terminology Advanced topics Convergence Extensions References

June 10, 2014, 2 / 16 Andreas Svensson - An introduction to particle filters

slide-3
SLIDE 3

State Space Models

Linear Gaussian state space model xt Axt But wt yt Cxt Dut et with wt and et Gaussian and wtwT

t

Q eteT

t

R. A more general state space model in different notation xt f xt xt ut yt g yt xt ut

June 10, 2014, 3 / 16 Andreas Svensson - An introduction to particle filters

slide-4
SLIDE 4

State Space Models

◮ Linear Gaussian state space model

xt+1 = Axt + But + wt yt = Cxt + Dut + et with wt and et Gaussian and E

  • wtwT

t

  • = Q, E
  • eteT

t

  • = R.

A more general state space model in different notation xt f xt xt ut yt g yt xt ut

June 10, 2014, 3 / 16 Andreas Svensson - An introduction to particle filters

slide-5
SLIDE 5

State Space Models

◮ Linear Gaussian state space model

xt+1 = Axt + But + wt yt = Cxt + Dut + et with wt and et Gaussian and E

  • wtwT

t

  • = Q, E
  • eteT

t

  • = R.

◮ A more general state space model in different notation

xt+1 ∼ f (xt+1|xt, ut) yt ∼ g(yt|xt, ut)

June 10, 2014, 3 / 16 Andreas Svensson - An introduction to particle filters

slide-6
SLIDE 6

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

Kalman filter! ''Exact solution to the right problem''

Nonlinear problems:

EKF, UKF, … ''Exact solution to the wrong problem'' Particle filter ''Approximate solution to the right problem''

June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-7
SLIDE 7

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

Kalman filter! ''Exact solution to the right problem''

Nonlinear problems:

EKF, UKF, … ''Exact solution to the wrong problem'' Particle filter ''Approximate solution to the right problem''

June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-8
SLIDE 8

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

◮ Kalman filter!

''Exact solution to the right problem''

Nonlinear problems:

EKF, UKF, … ''Exact solution to the wrong problem'' Particle filter ''Approximate solution to the right problem''

June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-9
SLIDE 9

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

◮ Kalman filter!

''Exact solution to the right problem''

Nonlinear problems:

EKF, UKF, … ''Exact solution to the wrong problem'' Particle filter ''Approximate solution to the right problem''

June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-10
SLIDE 10

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

◮ Kalman filter!

''Exact solution to the right problem''

Nonlinear problems:

◮ EKF, UKF, …

''Exact solution to the wrong problem''

◮ Particle filter

''Approximate solution to the right problem''

June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-11
SLIDE 11

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

◮ Kalman filter! ''Exact solution to the right problem''

Nonlinear problems:

◮ EKF, UKF, …

''Exact solution to the wrong problem''

◮ Particle filter

''Approximate solution to the right problem''

June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-12
SLIDE 12

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

◮ Kalman filter! ''Exact solution to the right problem''

Nonlinear problems:

◮ EKF, UKF, … ''Exact solution to the wrong problem'' ◮ Particle filter

''Approximate solution to the right problem''

June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-13
SLIDE 13

Filtering - Find p(xt|y1:t)

Linear Gaussian problems:

◮ Kalman filter! ''Exact solution to the right problem''

Nonlinear problems:

◮ EKF, UKF, … ''Exact solution to the wrong problem'' ◮ Particle filter ''Approximate solution to the right problem'' June 10, 2014, 4 / 16 Andreas Svensson - An introduction to particle filters

slide-14
SLIDE 14

Idea

Time State True state tracejctory

A linear system - Find p(xt|y1:t) (true xt shown)!

June 10, 2014, 5 / 16 Andreas Svensson - An introduction to particle filters

slide-15
SLIDE 15

Idea

Time State True state tracejctory Kalman filter mean

Kalman filter mean

June 10, 2014, 5 / 16 Andreas Svensson - An introduction to particle filters

slide-16
SLIDE 16

Idea

Time State True state tracejctory Kalman filter mean Kalman filter covariance

Kalman filter mean and covariance

June 10, 2014, 5 / 16 Andreas Svensson - An introduction to particle filters

slide-17
SLIDE 17

Idea

Time State True state tracejctory Kalman filter mean Kalman filter covariance

Kalman filter mean and covariance defines a Gaussian distribution at each t

June 10, 2014, 5 / 16 Andreas Svensson - An introduction to particle filters

slide-18
SLIDE 18

Idea

Time State True state tracejctory

A numerical approximation can be used to describe the distribution - Particle Filter

June 10, 2014, 5 / 16 Andreas Svensson - An introduction to particle filters

slide-19
SLIDE 19

Idea

Time State True state tracejctory

The Particle Filter can easily handle, e.g., non-gaussian multimodal hypotheses

June 10, 2014, 5 / 16 Andreas Svensson - An introduction to particle filters

slide-20
SLIDE 20

Idea

Generate a lot of hypotheses about xt, keep the most likely ones and propagate them further to xt+1. Keep the likely hypotheses about xt+1, propagate them again to xt+2, etc.

June 10, 2014, 6 / 16 Andreas Svensson - An introduction to particle filters

slide-21
SLIDE 21

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

xi

t+1 from f (·|xi t, ut)

for i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights

0 x(:,1) = random(i_dist,N,1); w(:,1) = ones(N,1)/N; for t = 1:T 1 w(:,t) = pdf(m_dist,y(t)-g(x(:,t))); w(:,t) = w(:,t)/sum(w(:,t)); 2 Resample x(:,t) 3 x(:,t+1) = f(x(:,t),u(t)) + random(t_dist,N,1); end

June 10, 2014, 7 / 16 Andreas Svensson - An introduction to particle filters

slide-22
SLIDE 22

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

xi

t+1 from f (·|xi t, ut)

for i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights

0 x(:,1) = random(i_dist,N,1); w(:,1) = ones(N,1)/N; for t = 1:T 1 w(:,t) = pdf(m_dist,y(t)-g(x(:,t))); w(:,t) = w(:,t)/sum(w(:,t)); 2 Resample x(:,t) 3 x(:,t+1) = f(x(:,t),u(t)) + random(t_dist,N,1); end

June 10, 2014, 7 / 16 Andreas Svensson - An introduction to particle filters

slide-23
SLIDE 23

Algorithm

→0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-24
SLIDE 24

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T →1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-25
SLIDE 25

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N →2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-26
SLIDE 26

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

→3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-27
SLIDE 27

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T →1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-28
SLIDE 28

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N →2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-29
SLIDE 29

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

→3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-30
SLIDE 30

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T →1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-31
SLIDE 31

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N →2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-32
SLIDE 32

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

→3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-33
SLIDE 33

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T →1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-34
SLIDE 34

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N →2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-35
SLIDE 35

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

→3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-36
SLIDE 36

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T →1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-37
SLIDE 37

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N →2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-38
SLIDE 38

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

→3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights 5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x

June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-39
SLIDE 39

Algorithm

0 Initialize xi

1 ∼ p(x1) and

wi = 1

N for i = 1, . . . , N

for t = 1 to T 1 Evaluate wi

t = g(yt|xi t, ut)

for i = 1, . . . , N 2 Resample {xi

t}N i=1 from

{xi

t, wi t}N i=1

3 Propagate xi

t by sampling

from f (·|xi

t−1, ut−1) for

i = 1, . . . , N end N Number of particles, xi

t Particles,

wi

t Particle weights

5 10 15 20 −30 −25 −20 −15 −10 −5 5 10 15 Time State x June 10, 2014, 8 / 16 Andreas Svensson - An introduction to particle filters

slide-40
SLIDE 40

Resampling

Represent the information contained in the N black dots (of different sizes) … with the N red dots (of equal sizes) Can be seen as sampling from a cathegorical distribution To avoid particle depletion (''a lot of 0-weights particles'') Some Matlab code:

v = rand(N,1); wc = cumsum(w(:,t)); [ ,ind1] = sort([v;wc]); ind=find(ind1<=N)-(0:N-1)'; x(:,t)=x(ind,t); w(:,t)=ones(N,1)./N;

June 10, 2014, 9 / 16 Andreas Svensson - An introduction to particle filters

slide-41
SLIDE 41

Resampling

◮ Represent the information contained in the N black dots (of

different sizes) … with the N red dots (of equal sizes)

state

Can be seen as sampling from a cathegorical distribution To avoid particle depletion (''a lot of 0-weights particles'') Some Matlab code:

v = rand(N,1); wc = cumsum(w(:,t)); [ ,ind1] = sort([v;wc]); ind=find(ind1<=N)-(0:N-1)'; x(:,t)=x(ind,t); w(:,t)=ones(N,1)./N;

June 10, 2014, 9 / 16 Andreas Svensson - An introduction to particle filters

slide-42
SLIDE 42

Resampling

◮ Represent the information contained in the N black dots (of

different sizes) … with the N red dots (of equal sizes)

state

Can be seen as sampling from a cathegorical distribution To avoid particle depletion (''a lot of 0-weights particles'') Some Matlab code:

v = rand(N,1); wc = cumsum(w(:,t)); [ ,ind1] = sort([v;wc]); ind=find(ind1<=N)-(0:N-1)'; x(:,t)=x(ind,t); w(:,t)=ones(N,1)./N;

June 10, 2014, 9 / 16 Andreas Svensson - An introduction to particle filters

slide-43
SLIDE 43

Resampling

◮ Represent the information contained in the N black dots (of

different sizes) … with the N red dots (of equal sizes)

state

◮ Can be seen as sampling from a cathegorical distribution

To avoid particle depletion (''a lot of 0-weights particles'') Some Matlab code:

v = rand(N,1); wc = cumsum(w(:,t)); [ ,ind1] = sort([v;wc]); ind=find(ind1<=N)-(0:N-1)'; x(:,t)=x(ind,t); w(:,t)=ones(N,1)./N;

June 10, 2014, 9 / 16 Andreas Svensson - An introduction to particle filters

slide-44
SLIDE 44

Resampling

◮ Represent the information contained in the N black dots (of

different sizes) … with the N red dots (of equal sizes)

state

◮ Can be seen as sampling from a cathegorical distribution ◮ To avoid particle depletion (''a lot of 0-weights particles'')

Some Matlab code:

v = rand(N,1); wc = cumsum(w(:,t)); [ ,ind1] = sort([v;wc]); ind=find(ind1<=N)-(0:N-1)'; x(:,t)=x(ind,t); w(:,t)=ones(N,1)./N;

June 10, 2014, 9 / 16 Andreas Svensson - An introduction to particle filters

slide-45
SLIDE 45

Resampling

◮ Represent the information contained in the N black dots (of

different sizes) … with the N red dots (of equal sizes)

state

◮ Can be seen as sampling from a cathegorical distribution ◮ To avoid particle depletion (''a lot of 0-weights particles'') ◮ Some Matlab code:

v = rand(N,1); wc = cumsum(w(:,t)); [ ,ind1] = sort([v;wc]); ind=find(ind1<=N)-(0:N-1)'; x(:,t)=x(ind,t); w(:,t)=ones(N,1)./N;

June 10, 2014, 9 / 16 Andreas Svensson - An introduction to particle filters

slide-46
SLIDE 46

Resampling cont'd

Crucial step in the development in the 90's for making particle filters useful in practice Many different techniques exists with different properties and effiency (the Matlab code shown was only one way of doing it) Computationally heavy. Not necessary to do in every iteration - a ''depletion measure'' can be introduced, and the resampling

  • nly performed when it reaches a certain threshold.

It is sometimes preferred to use the logarithms of the weights for numerical reasons.

June 10, 2014, 10 / 16 Andreas Svensson - An introduction to particle filters

slide-47
SLIDE 47

Resampling cont'd

◮ Crucial step in the development in the 90's for making particle

filters useful in practice Many different techniques exists with different properties and effiency (the Matlab code shown was only one way of doing it) Computationally heavy. Not necessary to do in every iteration - a ''depletion measure'' can be introduced, and the resampling

  • nly performed when it reaches a certain threshold.

It is sometimes preferred to use the logarithms of the weights for numerical reasons.

June 10, 2014, 10 / 16 Andreas Svensson - An introduction to particle filters

slide-48
SLIDE 48

Resampling cont'd

◮ Crucial step in the development in the 90's for making particle

filters useful in practice

◮ Many different techniques exists with different properties and

effiency (the Matlab code shown was only one way of doing it) Computationally heavy. Not necessary to do in every iteration - a ''depletion measure'' can be introduced, and the resampling

  • nly performed when it reaches a certain threshold.

It is sometimes preferred to use the logarithms of the weights for numerical reasons.

June 10, 2014, 10 / 16 Andreas Svensson - An introduction to particle filters

slide-49
SLIDE 49

Resampling cont'd

◮ Crucial step in the development in the 90's for making particle

filters useful in practice

◮ Many different techniques exists with different properties and

effiency (the Matlab code shown was only one way of doing it)

◮ Computationally heavy. Not necessary to do in every iteration -

a ''depletion measure'' can be introduced, and the resampling

  • nly performed when it reaches a certain threshold.

It is sometimes preferred to use the logarithms of the weights for numerical reasons.

June 10, 2014, 10 / 16 Andreas Svensson - An introduction to particle filters

slide-50
SLIDE 50

Resampling cont'd

◮ Crucial step in the development in the 90's for making particle

filters useful in practice

◮ Many different techniques exists with different properties and

effiency (the Matlab code shown was only one way of doing it)

◮ Computationally heavy. Not necessary to do in every iteration -

a ''depletion measure'' can be introduced, and the resampling

  • nly performed when it reaches a certain threshold.

◮ It is sometimes preferred to use the logarithms of the weights

for numerical reasons.

June 10, 2014, 10 / 16 Andreas Svensson - An introduction to particle filters

slide-51
SLIDE 51

Computational complexity

In theory NTnx (nx is the number of states) (Kalman filter is approx. of order Tnx ) Possible bottlenecks:

Resampling step Likelihood evaluation (for the weight evaluation) Sampling from f for the propagation (trick: use proposal distributions!)

June 10, 2014, 11 / 16 Andreas Svensson - An introduction to particle filters

slide-52
SLIDE 52

Computational complexity

In theory O(NTn2

x)

(nx is the number of states) (Kalman filter is approx. of order Tnx ) Possible bottlenecks:

Resampling step Likelihood evaluation (for the weight evaluation) Sampling from f for the propagation (trick: use proposal distributions!)

June 10, 2014, 11 / 16 Andreas Svensson - An introduction to particle filters

slide-53
SLIDE 53

Computational complexity

In theory O(NTn2

x)

(nx is the number of states) (Kalman filter is approx. of order O(Tn3

x))

Possible bottlenecks:

Resampling step Likelihood evaluation (for the weight evaluation) Sampling from f for the propagation (trick: use proposal distributions!)

June 10, 2014, 11 / 16 Andreas Svensson - An introduction to particle filters

slide-54
SLIDE 54

Computational complexity

In theory O(NTn2

x)

(nx is the number of states) (Kalman filter is approx. of order O(Tn3

x))

Possible bottlenecks:

◮ Resampling step ◮ Likelihood evaluation (for the weight evaluation) ◮ Sampling from f for the propagation (trick: use proposal

distributions!)

June 10, 2014, 11 / 16 Andreas Svensson - An introduction to particle filters

slide-55
SLIDE 55

Software

Lot of software packages exists. However, to my knowledge, no package that ''everybody'' uses. (In our research, we write our own code.) A few relevant existing packages: Python: pyParticleEst Matlab: PFToolbox, PFLib C++: Particle++ Disclaimer: I have not used any of these packages myself

June 10, 2014, 12 / 16 Andreas Svensson - An introduction to particle filters

slide-56
SLIDE 56

Software

Lot of software packages exists. However, to my knowledge, no package that ''everybody'' uses. (In our research, we write our own code.) A few relevant existing packages: Python: pyParticleEst Matlab: PFToolbox, PFLib C++: Particle++ Disclaimer: I have not used any of these packages myself

June 10, 2014, 12 / 16 Andreas Svensson - An introduction to particle filters

slide-57
SLIDE 57

Software

Lot of software packages exists. However, to my knowledge, no package that ''everybody'' uses. (In our research, we write our own code.) A few relevant existing packages:

◮ Python: pyParticleEst ◮ Matlab: PFToolbox, PFLib ◮ C++: Particle++

Disclaimer: I have not used any of these packages myself

June 10, 2014, 12 / 16 Andreas Svensson - An introduction to particle filters

slide-58
SLIDE 58

Terminology

Bootstrap particle filter ''Standard'' particle filter Sequential Monte Carlo (SMC) Particle filter

June 10, 2014, 13 / 16 Andreas Svensson - An introduction to particle filters

slide-59
SLIDE 59

Terminology

Bootstrap particle filter ≈ ''Standard'' particle filter Sequential Monte Carlo (SMC) Particle filter

June 10, 2014, 13 / 16 Andreas Svensson - An introduction to particle filters

slide-60
SLIDE 60

Terminology

Bootstrap particle filter ≈ ''Standard'' particle filter Sequential Monte Carlo (SMC) ≈ Particle filter

June 10, 2014, 13 / 16 Andreas Svensson - An introduction to particle filters

slide-61
SLIDE 61

Convergence

The particle filter is ''exact for N '' Consider a function g xt of interest. How well can it be approximated as g xt when xt is estimated in a particle filter? g xt g xt

pt g xt

sup

N

If the system ''forgets exponentially fast'' (e.g. linear systems), and some additional weak assumptions, pt p , i.e., g xt g xt

C N

June 10, 2014, 14 / 16 Andreas Svensson - An introduction to particle filters

slide-62
SLIDE 62

Convergence

The particle filter is ''exact for N = ∞'' Consider a function g xt of interest. How well can it be approximated as g xt when xt is estimated in a particle filter? g xt g xt

pt g xt

sup

N

If the system ''forgets exponentially fast'' (e.g. linear systems), and some additional weak assumptions, pt p , i.e., g xt g xt

C N

June 10, 2014, 14 / 16 Andreas Svensson - An introduction to particle filters

slide-63
SLIDE 63

Convergence

The particle filter is ''exact for N = ∞'' Consider a function g(xt) of interest. How well can it be approximated as ˆ g(xt) when xt is estimated in a particle filter? g xt g xt

pt g xt

sup

N

If the system ''forgets exponentially fast'' (e.g. linear systems), and some additional weak assumptions, pt p , i.e., g xt g xt

C N

June 10, 2014, 14 / 16 Andreas Svensson - An introduction to particle filters

slide-64
SLIDE 64

Convergence

The particle filter is ''exact for N = ∞'' Consider a function g(xt) of interest. How well can it be approximated as ˆ g(xt) when xt is estimated in a particle filter? E [ˆ g(xt) − E [g(xt)]]2 ≤ ptg(xt)sup

N

If the system ''forgets exponentially fast'' (e.g. linear systems), and some additional weak assumptions, pt p , i.e., g xt g xt

C N

June 10, 2014, 14 / 16 Andreas Svensson - An introduction to particle filters

slide-65
SLIDE 65

Convergence

The particle filter is ''exact for N = ∞'' Consider a function g(xt) of interest. How well can it be approximated as ˆ g(xt) when xt is estimated in a particle filter? E [ˆ g(xt) − E [g(xt)]]2 ≤ ptg(xt)sup

N

If the system ''forgets exponentially fast'' (e.g. linear systems), and some additional weak assumptions, pt = p < ∞, i.e., E [ˆ g(xt) − E [g(xt)]]2 ≤ C

N

June 10, 2014, 14 / 16 Andreas Svensson - An introduction to particle filters

slide-66
SLIDE 66

Extensions

Smoothing: Finding p xt y

T (marginal smoothing) or

p x

t y T (joint smoothing) instead of p xt y t (filtering).

Offline (y

T has to be available). Increased computational load.

If f xt xt ut is not suitable to sample from, proposal distributions can be used. In fact, an optimal proposal (w.r.t. reduced variance) exists. Rao-Blackwellization for mixed linear/nonlinear models. System identification: PMCMC, SMC .

June 10, 2014, 15 / 16 Andreas Svensson - An introduction to particle filters

slide-67
SLIDE 67

Extensions

◮ Smoothing: Finding p(xt|y1:T) (marginal smoothing) or

p(x1:t|y1:T) (joint smoothing) instead of p(xt|y1:t) (filtering). Offline (y1:T has to be available). Increased computational load. If f xt xt ut is not suitable to sample from, proposal distributions can be used. In fact, an optimal proposal (w.r.t. reduced variance) exists. Rao-Blackwellization for mixed linear/nonlinear models. System identification: PMCMC, SMC .

June 10, 2014, 15 / 16 Andreas Svensson - An introduction to particle filters

slide-68
SLIDE 68

Extensions

◮ Smoothing: Finding p(xt|y1:T) (marginal smoothing) or

p(x1:t|y1:T) (joint smoothing) instead of p(xt|y1:t) (filtering). Offline (y1:T has to be available). Increased computational load.

◮ If f (xt+1|xt, ut) is not suitable to sample from, proposal

distributions can be used. In fact, an optimal proposal (w.r.t. reduced variance) exists. Rao-Blackwellization for mixed linear/nonlinear models. System identification: PMCMC, SMC .

June 10, 2014, 15 / 16 Andreas Svensson - An introduction to particle filters

slide-69
SLIDE 69

Extensions

◮ Smoothing: Finding p(xt|y1:T) (marginal smoothing) or

p(x1:t|y1:T) (joint smoothing) instead of p(xt|y1:t) (filtering). Offline (y1:T has to be available). Increased computational load.

◮ If f (xt+1|xt, ut) is not suitable to sample from, proposal

distributions can be used. In fact, an optimal proposal (w.r.t. reduced variance) exists.

◮ Rao-Blackwellization for mixed linear/nonlinear models.

System identification: PMCMC, SMC .

June 10, 2014, 15 / 16 Andreas Svensson - An introduction to particle filters

slide-70
SLIDE 70

Extensions

◮ Smoothing: Finding p(xt|y1:T) (marginal smoothing) or

p(x1:t|y1:T) (joint smoothing) instead of p(xt|y1:t) (filtering). Offline (y1:T has to be available). Increased computational load.

◮ If f (xt+1|xt, ut) is not suitable to sample from, proposal

distributions can be used. In fact, an optimal proposal (w.r.t. reduced variance) exists.

◮ Rao-Blackwellization for mixed linear/nonlinear models. ◮ System identification: PMCMC, SMC2.

June 10, 2014, 15 / 16 Andreas Svensson - An introduction to particle filters

slide-71
SLIDE 71

References

◮ Gustafsson, F. (2010). Particle filter theory and practice with

positioning applications. Aerospace and Electronic Systems Magazine, IEEE, 25(7), 53-82.

◮ Schön, T.B., & Lindsten, F. Learning of dynamical systems - Particle

Filters and Markov chain methods. Draft available.

◮ Doucet, A., & Johansen, A. M. (2009). A tutorial on particle filtering and

smoothing: Fifteen years later. Handbook of Nonlinear Filtering, 12, 656-704. Homework: Implement your own Particle Filter for any (simple) problem of your choice!

June 10, 2014, 16 / 16 Andreas Svensson - An introduction to particle filters