Chapter 14. Bayesian Filtering for State Estimation of - - PowerPoint PPT Presentation

chapter 14 bayesian filtering for state estimation of
SMART_READER_LITE
LIVE PREVIEW

Chapter 14. Bayesian Filtering for State Estimation of - - PowerPoint PPT Presentation

Chapter 14. Bayesian Filtering for State Estimation of Dynamic Systems Neural Networks and Learning Machines (Haykin) 2019 Lecture Notes on Self-learning Neural


slide-1
SLIDE 1

Chapter ¡14. ¡ Bayesian ¡Filtering ¡for ¡State ¡ Estimation ¡of ¡Dynamic ¡Systems

Neural ¡Networks ¡and ¡Learning ¡Machines ¡(Haykin)

2019 Lecture ¡Notes ¡on ¡

Self-­‑learning ¡Neural ¡Algorithms

Byoung-­‑Tak ¡Zhang School ¡of ¡Computer ¡Science ¡and ¡Engineering Seoul ¡National ¡University

Version ¡20171115/20191105

slide-2
SLIDE 2

Contents

14.1 ¡Introduction ¡ ¡……………………………………………….…………………………….... ¡ 3 14.2 ¡State-­‑Space ¡Models ¡ ¡ ¡………………………………….……..……………………..…. ¡ 4 14.3 ¡Kalman Filters ¡ ¡…………………….…….………………………………………..…….... ¡ 6 14.6 ¡The ¡Bayesian ¡Filter ………………………………...…….…………………….…...…. ¡ 9 14.7 ¡Particle ¡Filters ….…………….…….…………….……..……..……………………….. ¡ 15 14.9 ¡Computer ¡Experiment ¡ ¡……………………………………………………………….. ¡ 24 Summary ¡ ¡ . ………………………………….……….…….………………………….………... ¡ 26

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 2

slide-3
SLIDE 3

14.1 Introduction

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 3

  • Estimation ¡of ¡the ¡state ¡of ¡a ¡dynamic ¡system, ¡given ¡a ¡sequence ¡of ¡
  • bservations ¡dependent ¡on ¡the ¡state.
  • The ¡observations ¡take ¡place ¡in ¡discrete ¡time. ¡The ¡state ¡is ¡not ¡only ¡

unknown, ¡but ¡also ¡hidden from ¡the ¡observer ¡(inverse ¡problem). ¡

  • The ¡first ¡rigorous ¡treatment ¡of ¡sequential ¡state-­‑estimation ¡theory ¡

appeared ¡in ¡Kalman’s classic ¡paper ¡(1960). ¡Kalman derived ¡a ¡ recursive ¡formula ¡to ¡find ¡the ¡optimal ¡estimate ¡of ¡the ¡unknown ¡ state ¡with ¡two ¡simplifying ¡assumptions ¡

– The ¡dynamic ¡system ¡is ¡entirely ¡linear

– The ¡noise ¡processes ¡perturbing ¡the ¡state ¡of ¡the ¡dynamic ¡system ¡and ¡the ¡

  • bservables ¡are ¡additive ¡and ¡Gaussian
  • State-­‑estimation ¡theory ¡remains ¡an ¡active ¡area, ¡for ¡nonlinear ¡and ¡

non-­‑Gaussian ¡situations. ¡Instead ¡of ¡finding ¡the ¡optimal ¡estimate, ¡

  • ne ¡has ¡to ¡settle ¡on ¡an ¡approximate ¡estimator
slide-4
SLIDE 4

14.2 ¡State-­‑Space ¡Models ¡(1/2)

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 4

1. System ¡(state) ¡model 2. Measurement ¡(observation) ¡ model

1

( , )

n n n n

x a x w

+ =

( , )

n n n n

y b x v =

Figure ¡14.1 Generic ¡state-­‑space ¡model ¡of ¡a ¡time-­‑varying, ¡nonlinear ¡dynamic ¡system, ¡ where ¡z–1I ¡denotes ¡a ¡block ¡of ¡unit-­‑time ¡delays.

§ Linear, ¡Gaussian § Nonlinear, ¡Gaussian

1 1, n n n n

x A x w

+ +

= +

n n n n

y B x v = +

1

( )

n n n n

x a x w

+ =

+ ( )

n n n n

y b x v = +

1

( ) , ( , )

N i i i i

p x c x

=

= ℵ Σ

slide-5
SLIDE 5

Figure ¡14.2 Evolution ¡of ¡the ¡state ¡across ¡time, ¡viewed ¡as ¡a ¡first-­‑order ¡Markov ¡chain.

14.2 ¡State-­‑Space ¡Models (2/2)

slide-6
SLIDE 6

Figure ¡14.3 Signal-­‑flow ¡graph ¡of ¡the ¡Kalman filter, ¡depicting ¡it ¡as ¡a ¡double-­‑loop ¡ feedback ¡system.

14.3 ¡Kalman Filters ¡(1/3)

slide-7
SLIDE 7

14.3 ¡Kalman Filters ¡(2/3)

slide-8
SLIDE 8

14.3 ¡Kalman Filters (3/3)

slide-9
SLIDE 9

14.6 ¡The ¡Bayesian ¡Filter ¡(1/6)

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 9

slide-10
SLIDE 10

14.6 ¡The ¡Bayesian ¡Filter ¡(2/6)

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 10

1 1

sequence of observations, denoting { } ( | )= predictive distribution of the state at the current time n, given the entire sequence of observations up to and includin

= −

=

n n i i n n n

p Y y x Y x

1

g . ( | )= posterior distribution of the current state , given the entire sequence of observations up to and including the current time n; this distribution is

− n n n n

p y x Y x

1 1

commonly referred to simply as the "posterior" ( | )= transition-state distribution of the current state , given the immediate past state ; this distrubution is commonly re

− − n n n n

p x x x x ferred to as the "transition prior"

  • r simply "prior"

( | )= likelihood function of the current observation , given the current state

n n n n

l y x y x

slide-11
SLIDE 11

14.6 ¡The ¡Bayesian ¡Filter ¡(3/6)

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 11

Assumptions Update ¡formulas

  • 1. ¡Time ¡update
  • 2. ¡Measurement ¡update

1 2 1 2 1

( | ) ( ) ( , ,..., | , ,..., ) ( | )

=

= = ∏

n n n i i i

p p l l x y x y y y x x x y x

1 1 1 1 1

Prior Old posterior Predictive distribution

( | ) ( | ) ( | )d

− − − − −

= ∫ 1 4 2 4 3 1 4 2 4 3 1 4 4 2 4 4 3

n n n n n n n

p p p x Y x x x Y x

1 1

Updated Predictive Likelihood distribution function posterior

1 ( | ) ( | ) ( | ) where Z ( | ) ( | )

− −

= = ∫ 1 4 2 43 1 4 2 4 3 1 4 2 4 3

n n n n n n n n n n n n n

p p l l p d Z x Y x Y y x y x x Y x

slide-12
SLIDE 12

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 12

The Bayesian filter of Fig. 14.4 is optimal in a conceptual sense, with two interesting properties:

  • 1. The model operates in a recursive manner by propagating the posterior distribution

( | .

  • 2. Knowl

)

n n

p x Y edge of the model about the state , extracted from the entire observations process , is completely contained in the posterior distribution ( | . )

n n n n

p x Y x Y

14.6 ¡The ¡Bayesian ¡Filter ¡(4/6)

Optimality ¡of ¡the ¡Bayesian ¡filter

slide-13
SLIDE 13

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 13

[ ( )] | ( ) ( )

p n n n n n n

h h h p d = = ∫ x x x Y x E

Bayes ¡estimator

Given the entire observations sequence at time n pertaining to the nonlinear state-space model of Eqs. (14.7) and (14.8), derive an approximate realization of the Bayes estimator ( ), defined in Eq

n n

h Y x . (14.84), that is subject to two practical requirements:

  • 1. computational plausibility;
  • 2. recursive implementability.

Nonlinear ¡filtering ¡objective

Approximate ¡Bayesian ¡Filtering

14.6 ¡The ¡Bayesian ¡Filter ¡(5/6)

slide-14
SLIDE 14

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 14

  • 1. Direct Numerical Approximation of the Posterior. The rationale behind this direct

approach to nonlinear filtering is summed up as follows: In general, it is easier to approximate the posterior distribution ( | ) directly and in a local sense than it is to approximate the nonlinear function characterizing the system (state) model

  • f the filter.

n n

p x Y

  • 2. Indirect Numerical Approximation of the Posterior. The rationale behind this second

approach to nonlinear filtering is summed up as follows: The posterior distribution ( | ) is approximated indire

n n

p x Y ctly and in a global sense through the use of Monte Carlo simulation, so as to make the Bayesian framework for nonlinear filtering computationally tractable.

Two ¡methods ¡for ¡approximate ¡Bayesian ¡filtering

14.6 ¡The ¡Bayesian ¡Filter ¡(6/6)

slide-15
SLIDE 15

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 15

( ) ( ) 1 ( ) ( ) ( ) ( ) ( ) ( 1

( | ) | ) ( | ) ( | ) ( ) ( | ) ( ) ( ) ( | ) ( | ) 1 ˆ ( ) ( | ) | ) , 1,2, ..., ( | ) ˆ ( ) ( | ( ) ( (

= =

= = ⎛ ⎞ = ⎜ ⎟ ⎝ ⎠ ≈ = = ≈ =

∫ ∫ ∑ ∑

% %

n n n n n n n n n n n n n n n n n n n n n N i i n n n i i i i n n n n n i n n N i i n n n i

p q p h h q d h r q d q h N w N p w i N q h N r h r w h X Y X Y X Y X Y X X Y x X X Y X Y x X Y X X Y X Y X Y X

) ( ) ( ) ( ) 1

, 1,2, ..., ˆ l ) im ( )

= → ∞

= = →

% %

i i n n N j n j N n n

w i N w h N h w

Monte ¡Carlo ¡Integration

14.8 ¡Particle Filters ¡(1/9)

slide-16
SLIDE 16

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 16

( ) 1 ( ) 1

| )

  • 1. Sampling. Randomly draw an iid set of

samples { } from the importance distribution ( .

  • 2. Weighting. Using Eq. (14.110), compute the corresponding set of normalized

weights {w } . 3.

= = i N i i N i

N q X X Y

(1) (2) ( ) (1) (2) ( )

Resampling. Given the intermediate samples , ..., , conditionally and independently dr ( ) aw a set of discrete random variables { , ..., } that take values in the set {1, 2 , , , ..

N L

I L I I i X X X

(1) (2) ( ) (1) ( ) (2) ( ) ( ) ( )

., } with probabilities ( , , ..., ) as shown by, for example, (I for 1,2, ..., and so on for , ..., ; typicall ) ( ) y, we have . Set for 1,2, ..., = = ≤ = = =

N j L i L

N w w w P j N I I w L N i j L ii X X

14.8 ¡Particle ¡Filters (2/9)

slide-17
SLIDE 17

17

  • 1. Resampling limits the scope of parallel implementation of particle filters, due to

the very nature of the process.

  • 2. Particles associated with large importance weights are selected several times in

the course of resampling, which results in a loss of diversity among the particles; this phenomenon is referred to as sample improvishment or weight degeneracy. When, for example, the dynamic noise in the state-space model is relatively small, all the particles may end up collapsing to a single one in a matter of few iterations, which is obviously undesirable.

  • 3. Invariably, resampling increases the variance of the Monte Carlo estimator.

1 ( ) 2 1

( )

N i eff n i

w N

− =

⎡ ⎤ = ⎢ ⎥ ⎣ ⎦

( )

  • 1. The

weights are all uniformly distributed with w for all i, in which case .

  • 2. All the

weights are zero, except for one weight whose value is unity; in this case, 1. Recogni g 1 z / in = = =

i n eff eff

N N N N N N that the weight-degeneracy problem in sequential importance sampling is the rule rather than the exception, how do we overcome it?

Weight ¡Degeneracy ¡Problem

14.8 ¡Particle ¡Filters (3/9)

slide-18
SLIDE 18

(c) ¡2017 ¡Biointelligence ¡Lab, ¡SNU 18

1 1 1 1 1 1 1 1 ( ) ( ) ( ) ( ) ( ) 1 1 1 ( ) ( ) ( ) ( ) 1 1

1 | ( | ) ( | ) ( | ) ( | ) 1 ( | ) ( | ) ( | ) ( | ) ( | ( | ) ( | ) ( | ) ( | ) ( | ) ( | ( ) )

n n n n n n n n n n n n n n n n n n n n n n i i i i i n n n n n n n i n n i i i n n n n n n

p l p d Z p p l q d Z q p l p q q q q p w

− − − − − − − − − − − − −

= = ∝ =

∫ ∫

X Y x x y x X Y x X Y x x y x X Y x X Y x X y x X Y X Y X Y X Y x X( )

1 ( ) ( ) ( ) ( ) ( ) 1 1 1 ( ) ( ) ( ) 1 1 1 ( ) ( ) ( ) ( ) 1 1 ( ) ( ) ( ) ( ) ( ) 1 1 ( ) ( ) 1

, ) ( | ( | ( | ) ( | ) ( | ) ( | ) ( | ) for all ( | ( | ) ) , , , ) , ) ( |

i n i i i i i n n n n n n n i i i n n n n n i i i i n n n n n n i i i i i n n n n n n i i n n

p p l w q q q q i w l w p q

− − − − − − − − − − − −

∝ × = ∝ × y X Y x X y x X Y x X y x X y x x y x x y x x x y %

( ) ( ) 1

for all ) ( | ) ( )

n N i i n n n n n i

w i p δ

=

≈ −

x Y x x

Sequential ¡Importance ¡Sampling

14.8 ¡Particle ¡Filters (4/9)

slide-19
SLIDE 19

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 19

  • 1. The prior as the importance distribution. Examining the recursive formula of
  • Eq. (14.116) for updating the weights, we see that the importance distribution is

defined by how we choose the denominator

( ) ( ) 1 ( ) ( ) 1 1 1

( | , ) on the right-hand side

  • f the equation. In the SIR filter, this choice is made by setting

( | , ) ( where, on the right-hand side of the equation, | ) | ) ( is

− − − −

=

i i n n n i i n n n n n n n

q q p p x x y x x y x x x x

1

the prior, or state-transition

  • distribution. In effect, the SIR filter blindly samples from the prior (

completely ignoring the information about the state contained in the

  • bserva

| tion . ), E

− n n n n

p x x x y quation (14.119) follows from the Markovian assumption.

( ) 1

  • 2. Sampling importance resampling. In the SIR filter, resampling is applied at

every time-step of the nonlinear filtering process; consequently, in Eq. (14.116) we have w =1/ for 1, 2, ..., Bec

=

i n

N i N ause 1/ is a constant, it may be ignored.Thus, the need for an accumulation

  • ver time of the incremental correction factor in Eq. (14.116) is no longer needed.

Accordingly, the use of Eqs. (14.119) and N

( ) ( ) ( ) ( )

(14.120) in Eq. (14.116) yields the much simplified formula where is the likelihood function of the observation ( | ) for 1, 2, . , given the state for par . ticle i. ., ( | ) ∝ = %i

i n n n i i n n n n

w l i N l y x y x y x Naturally, normalization of the importance weights calculated using the proportionality equation of Eq. (14.121) is carried out after each resampling step of the SIR filtering algorithm.

Sequential ¡Importance ¡Sampling

14.8 ¡Particle ¡Filters (5/9)

slide-20
SLIDE 20

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 20

1

  • 1. The nonlinear function

in the process model of Eq. (14.1) and the nonlinear function in the measurement model of Eq. (14.2) must be both known.

  • 2. Determining the prior (

r ( , ) ( | ) e ) q ,

gg gg

n n n n

p a b x x uires knowledge of the statistics of the dynamic noise in Eq. (14.1); drawing samples (particles) from the underlying distribution

  • f the dynamic noise

must therefore be permissible.

  • 3. The likelih

ω ω

n n

  • od function (

, involved in formulating Eq. (14.121), must be known, which, in turn, means that the statistics of the measurement noise in

  • Eq. (14.2) are av

| ailabl . ) e

n n n

l y x ν

14.8 ¡Particle ¡Filters (6/9)

slide-21
SLIDE 21

14.8 ¡Particle ¡Filters (7/9)

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 21

slide-22
SLIDE 22

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 22

14.8 Particle ¡Filters (8/9)

slide-23
SLIDE 23

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 23

1 1 1 ( ) ( ) ( ) 1 1

( | ) ( | ) | , ) ( | ) ( | ) | ( | ) ( ( )

− − − − −

∝ =

∫ ∫

n n n n n n n

  • pt

n n n n n i i i n n n n n n n

p l p l q p d w w l d x x y x x x y x x y x x x x y x x

Optimal ¡Choice ¡of ¡Importance ¡Sampling

14.8 Particle ¡Filters (9/9)

slide-24
SLIDE 24

14.9 ¡Computer ¡Experiment: ¡Comparative ¡Evaluation ¡of ¡ Extended ¡Kalman ¡and ¡Particle ¡Filters

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 24

$

1 1 2 1 2 0|0

Simulated state trajectory: 50 time-steps long Number of independent Monte Carlo runs: 100 Intial value 25 0.5 8cos(1

  • f the filtered estimate:

The s .2( 1)) 1 p 1 20 ( ,2) ω ν

− − −

= + + − + + = + =

n n n n n n n n

x x n x y x x x x N ecifications of the SIR particle filter were as follows: The number of particles, , was 100. At each time-step of the filtering process, resampling was applied, followed by normalization of the i

  • mpor

N tance weights. The prior (i.e., state transition) distribution was used as the importance distribut

  • ion.

For the EKF, the averaged trajectory of the filtered estimate of the state deviates markedly from the true trajectory. On the other hand, the corresponding averaged trajectory computed by the SI

  • R

particle filter follows the true trajectory quite closely.

slide-25
SLIDE 25

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 25

slide-26
SLIDE 26

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 26

slide-27
SLIDE 27

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 27

Figure ¡14.8 Plot ¡of ¡the ¡root ¡mean-­‑square ¡error ¡(RMSE) ¡versus ¡the ¡number ¡of ¡particles ¡produced ¡by ¡the ¡SIR ¡particle ¡ filter; ¡the ¡points ¡• ¡are ¡experimentally ¡computed.

slide-28
SLIDE 28

14.11 ¡Summary ¡and ¡Discussion

  • Kalman Filter Theory

– Linear Gaussian System: Kalman Filter – Otherwise: extended Kalman filter by using first-order Taylor-series approximations

  • Bayesian Filter

– Most generic nonlinear filter (includes Kalman filter) – However, in practice, it has to be approximated as well – Direct Approximation of Posterior:

  • Extended Kalman Filter, Unscented Kalman Filter, Cubature Kalman Filter
  • The simplest to the most powerful: EKF à

à UKF à à CKF (w/ computational tradeoffs)

– Indirect Approximation of Posterior:

  • Particle Filter
  • Sequential Importance Resampling (SIS) is used to circumvent the weight degeneracy:

Weak weights à à Samples are pruned away // Strong weights à à Samples are replicated

(c) ¡2017 ¡BiointelligenceLab, ¡SNU 28