METULecture 1
METULecture 1
1 / 41 2 / 41
y1:k , {y1 , y1 , . . . , yk }.
3 / 41 4 / 41
Solution: Bayesian Density Recursion Solution: Bayesian Density Recursion
Bayesian Recursion
Start with p(x0 ), set k = 1.
For each k
Prediction Update
Terminology
Z
p(xk |y1:k−1 ) = p(xk |xk−1 )p(xk−1 |y1:k−1 ) dxk−1 p(xk |y1:k−1 ): Predicted state density
p(yk |y1:k−1 ): Predicted measurement density
Measurement Update p(xk |y1:k ): Estimated state density/ posterior state density
p(yk |xk )p(xk |y1:k−1 ) p(yk |xk ): Measurement likelihood
p(xk |y1:k ) =
p(yk |y1:k−1 ) p(xk |xk−1 ): State transition density
where
Z
p(yk |y1:k−1 ) = p(yk |xk )p(xk |y1:k−1 ) dxk
MMSE criterion
Define the estimates as MMSE is the most common criterion to obtain point
estimates.
x̂MMSE 2
k|k−1 = arg min E kxk − x̂k k2 |y1:k−1 The second common point estimate is called maximum a
x̂k
MMSE posteriori (MAP) estimate.
= arg min E kxk − x̂k k22 |y1:k
x̂k|k
x̂k
MAP criterion
which minimize the mean square (estimation or prediction) The estimates are given as
error.
The estimates are given as x̂MAP
k|k−1 = arg max p(xk |y1:k−1 )
xk
x̂MMSE
k|k−1 =E [xk |y1:k−1 ] x̂MAP
k|k = arg max p(xk |y1:k )
xk
x̂MMSE
k|k =E [xk |y1:k ]
which are the global maxima for the predicted and estimated state
which are the means for the predicted and estimated state densities.
densities.
7 / 41 8 / 41
Point Estimates Most Important Special Case
Original Problem
Uncertainty Measures
xk+1 =f (xk ) + wk
Every point estimate must be accompanied by an uncertainty
measure describing how trustable it is. yk =h(xk ) + vk
The most common uncertainty measure is the covariance. with wk ∼ p(wk ), vk ∼ p(vk ) and x0 ∼ p(x0 ).
9 / 41 10 / 41
Special Problem
Since the density p(xk |y1:k ) is always Gaussian, it is possible
xk+1 =Axk + wk to keep only its sufficient statistics x̂k|k and Pk|k
yk =Cxk + vk In other words, instead of propagating densities as
prediction update
with wk ∼ N (wk ; 0, Q), vk ∼ N (vk ; 0, R) and p(xk−1 |y1:k−1 ) −→ p(xk |y1:k−1 ) −→ p(xk |y1:k )
x0 ∼ N (x0 ; x̂0|0 , P0|0 ).
we propagate only the means and the covariances as
In this case it can be shown that all densities are Gaussian:
prediction update
p(xk |y1:k−1 ) = N (xk ; x̂k|k−1 , Pk|k−1 ) x̂k−1|k−1 , Pk−1|k−1 −→ x̂k|k−1 , Pk|k−1 −→ x̂k|k , Pk|k .
p(yk |y1:k−1 ) = N (yk ; ŷk|k−1 , Sk|k−1 )
As a result, the infinite dimensional estimation problem
p(xk |y1:k ) = N (xk ; x̂k|k , Pk|k ) reduces to a finite dimensional estimation problem.
p(yk |xk ) = N (yk ; Cxk , R)
p(xk |xk−1 ) = N (xk ; Axk−1 , Q)
11 / 41 12 / 41
Kalman Filter Kalman Filter
The equations of propagation for the means and the covariances
are called Kalman filter.
Kalman Filter Terminology
Start with x̂0|0 , P0|0 , set k = 1. x̂k|k−1 : Predicted state
For each k: Pk|k−1 : Covariance of the predicted state
Prediction Update x̂k|k : Estimated state
x̂k|k−1 =Ax̂k−1|k−1
Pk|k : Covariance of the estimated state
Pk|k−1 =APk−1|k−1 AT + Q
ŷk|k−1 : Predicted measurement
Measurement Update νk , yk − ŷk|k−1 : Measurement prediction error / innovation
x̂k|k =x̂k|k−1 + Kk (yk − ŷk|k−1 )
Sk|k−1 : Covariance of the predicted measurements /
Pk|k =Pk|k−1 − Kk Sk|k−1 KkT innovation covariance
where Kk : Kalman gain
ŷk|k−1 =C x̂k|k−1
Sk|k−1 =CPk|k−1 C T + R
−1
Kk =Pk|k−1 C T Sk|k−1
13 / 41 14 / 41
Original Problem
We are going to consider two main type of solutions to the
Bayesian state estimation problem for nonlinear non-Gaussian
xk+1 =f (xk ) + wk systems.
yk =h(xk ) + vk The posterior p(xk |y1:k ) can be approximated in two different
ways:
with wk ∼ p(wk ), vk ∼ p(vk ) and x0 ∼ p(x0 ).
p(xk |y1:k ) ≈N (xk ; x̂k|k , Pk|k ) Gaussian Approximation
In general assuming that the functions f (·) and g(·) are linear N
is far too restrictive. (i)
X
p(xk |y1:k ) ≈ πk|k δx(i) (xk ) Particle Approximation
k|k
Similarly the noise terms cannot be assumed to be Gaussian in i=1
many cases.
(i) PN (i)
The exact posterior density p(xk |y1:k ) is no longer Gaussian where πk|k ≥ 0 and i=1 πk|k = 1.
for the general case.
15 / 41 16 / 41
Nonlinear Transformations of Gaussian Random Variables Linearization
is the Jacobian.
17 / 41 18 / 41
19 / 41 20 / 41
Linearization Illustration Linearization Illustration
√ √
φ̄ =2 Φ =0.1 exact ψ̄ =4.01 linearized ψ̄ =4 φ̄ =2 Φ =0.2 exact ψ̄ =4.04 linearized ψ̄ =4
80 1 80 1
10 × p(φ) p(ψ) 10 × p(φ) p(ψ)
70 g(φ) Linearization 70 g(φ) Linearization
0.8 0.8
60 60
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
21 / 41 21 / 41
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
21 / 41 21 / 41
Linearization Illustration Linearization Illustration
√ √
φ̄ =2 Φ =0.5 exact ψ̄ =4.25 linearized ψ̄ =4 φ̄ =2 Φ =0.6 exact ψ̄ =4.36 linearized ψ̄ =4
80 1 80 1
10 × p(φ) p(ψ) 10 × p(φ) p(ψ)
70 g(φ) Linearization 70 g(φ) Linearization
0.8 0.8
60 60
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
21 / 41 21 / 41
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
21 / 41 21 / 41
Linearization Illustration Linearization Illustration
√ √
φ̄ =2 Φ =0.9 exact ψ̄ =4.81 linearized ψ̄ =4 φ̄ =2 Φ =1 exact ψ̄ =5 linearized ψ̄ =4
80 1 80 1
10 × p(φ) p(ψ) 10 × p(φ) p(ψ)
70 g(φ) Linearization 70 g(φ) Linearization
0.8 0.8
60 60
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
21 / 41 21 / 41
22 / 41 23 / 41
Unscented Transform Unscented Transform
Finding the Sigma-Points Finding the Sigma-Points
We set the sigma-points and their weights for φ ∼ N (φ, φ̄, Φ) as We set the sigma-points and their weights for φ ∼ N (φ, φ̄, Φ) as
for i = 1, . . . , nφ . for i = 1, . . . , nφ .
24 / 41 24 / 41
2nφ 2nφ
X X 20
ψ̄ = π (i) ψ (i) Ψ= π (i) (ψ (i) − ψ̄)(ψ (i) − ψ̄)T 0.2
i=0 i=0 10
0 0
0 5 10 0 5 10
φ ψ
25 / 41 26 / 41
Unscented Transform Illustration Unscented Transform Illustration
√ √
φ̄ =2 Φ =0.2 ex. ψ̄ =4.04 lin. ψ̄ =4 UT ψ̄ =4.04 φ̄ =2 Φ =0.3 ex. ψ̄ =4.09 lin. ψ̄ =4 UT ψ̄ =4.09
80 1 80 1
10 × p(φ) p(ψ) 10 × p(φ) p(ψ)
70 g(φ) Linearization 70 g(φ) Linearization
UT UT
0.8 0.8
60 60
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
26 / 41 26 / 41
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
26 / 41 26 / 41
Unscented Transform Illustration Unscented Transform Illustration
√ √
φ̄ =2 Φ =0.6 ex. ψ̄ =4.36 lin. ψ̄ =4 UT ψ̄ =4.36 φ̄ =2 Φ =0.7 ex. ψ̄ =4.49 lin. ψ̄ =4 UT ψ̄ =4.49
80 1 80 1
10 × p(φ) p(ψ) 10 × p(φ) p(ψ)
70 g(φ) Linearization 70 g(φ) Linearization
UT UT
0.8 0.8
60 60
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
26 / 41 26 / 41
50 0.6 50 0.6
40 40
30 0.4 30 0.4
20 20
0.2 0.2
10 10
0 0 0 0
0 5 10 0 5 10 0 5 10 0 5 10
φ ψ φ ψ
26 / 41 26 / 41
Unscented Transform Illustration Back to Nonlinear and Non-Gaussian Bayesian State
√ Estimation
φ̄ =2 Φ =1 ex. ψ̄ =5 lin. ψ̄ =4 UT ψ̄ =5
80 1 Bayesian State Estimation
10 × p(φ) p(ψ)
70 g(φ) Linearization xk+1 =f (xk ) + wk
UT
0.8 yk =h(xk ) + vk
60
with wk ∼ p(wk ), vk ∼ p(vk ) and x0 ∼ p(x0 ).
50 0.6
40 We can obtain a solution for the nonlinear non-Gaussian
Bayesian state estimation problem using both linearization
30 0.4 and unscented transform.
These solutions are called extended Kalman filter (EKF) and
20 unscented Kalman filter (UKF).
0.2
For both approaches, we have to assume
10
p(wk ) ≈N (wk ; 0, Q) p(x0 ) ≈ N (x0 ; x̂0|0 , P0|0 )
0 0
0 5 10 0 5 10 p(vk ) ≈N (vk ; 0, R)
φ ψ
26 / 41 27 / 41
0
−10 −5 0 5 10
32 / 41
x 33 / 41
Example: Representation with Particles Particle Filter
0.35
In general, both the p(x) Instead of propagating densities as
weights and the 0.3 samples
proximity of the prediction update
p(xk−1 |y1:k−1 ) −→ p(xk |y1:k−1 ) −→ p(xk |y1:k )
particles carry 0.25
information. 0.2 a particle filter propagates only the particles and the weights
If the weight of a prediction update
(i) (i) (i) (i) (i) (i)
particle is high, one 0.15 {πk−1|k−1 , xk−1|k−1 }N
i=1 −→ {πk|k−1 , xk|k−1 }N N
i=1 −→ {πk|k , xk|k }i=1 .
cannot directly 0.1
conclude that density according to Bayesian density recursion.
value is high there if 0.05 In some sense, a particle filter is a generalization of unscented
the particle is in Kalman filter to random particles instead of sigma-points.
0
isolation. −10 −5 0 5 10
x
34 / 41 35 / 41
36 / 41 37 / 41
Particle Filtering Particle Filtering: Resampling
Particle Filter
Resampling
A particle filter is useless
without this step.
Without this step, all
weights go to zero except
one of them which
becomes one.
This step removes the
particles with negligible
weights and replicates the
particles with high
weights.
Particle weights become
all equal at the end of
resampling.
Figure taken from P.M. Djuric, J.H. Kotecha, J. Zhang; Y.
Huang; T. Ghirmai, M.F. Bugallo, J. Miguez, “Particle Figure taken from P.M. Djuric, J.H. Kotecha, J. Zhang; Y. Huang; T. Ghirmai, M.F. Bugallo, J. Miguez, “Particle
filtering,” IEEE Signal Processing Magazine, vol.20, no.5, pp. filtering,” IEEE Signal Processing Magazine, vol.20, no.5, pp. 19–38, Sep. 2003.
19–38, Sep. 2003.
38 / 41 39 / 41
References References
PF
KF and EKF M. S. Arulampalam, S. Maskell, N. Gordon and T. Clapp, “A tutorial on
B. D. O. Anderson and J. B. Moore, Optimal Filtering, Prentice Hall, 1979. particle filters for online nonlinear/non-Gaussian Bayesian tracking,” IEEE
Transactions on Signal Processing, vol.50, no.2, pp.174–188, Feb. 2002.
A. Gelb, Applied Optimal Estimation, MIT Press, 1974.
F. Gustafsson, F. Gunnarsson, N. Bergman, U. Forssell, J. Jansson, R. Karlsson,
A. H. Jazwinski, Stochastic Processes and Filtering Theory, Academic Press, P.-J. Nordlund, “Particle filters for positioning, navigation, and tracking,” IEEE
1970. Transactions on Signal Processing, vol.50, no.2, pp.425–437, Feb. 2002.
Y. Bar-Shalom, X. R. Li, and T. Kirubarajan, Estimation with Applications to
P. M. Djuric, J. H. Kotecha, J. Zhang; Y. Huang; T. Ghirmai, M. F. Bugallo, J.
Tracking and Navigation, Wiley, 2001.
Miguez, “Particle filtering,” IEEE Signal Processing Magazine, vol.20, no.5, pp.
UKF 19–38, Sep. 2003.
S.J. Julier, J.K. Uhlmann, “Unscented filtering and nonlinear estimation,”
A. Doucet and X. Wang, “Monte Carlo methods for signal processing: a review
Proceedings of the IEEE, vol.92, no.3, pp. 401–422, Mar. 2004.
in the statistical signal processing context,” IEEE Signal Processing Magazine,
S.J. Julier, J.K. Uhlmann, “Data Fusion in Nonlinear Systems”, Ch. 15, in vol.22, no.6, pp. 152–170, Nov. 2005.
Handbook of Multisensor Data Fusion: Theory and Practice, M. E. Liggins, D.
F. Gustafsson, “Particle filter theory and practice with positioning
Hall, J. Llinas (Editors), Taylor & Francis, 2009.
applications,” IEEE Aerospace and Electronic Systems Magazine, vol.25, no.7,
pp.53–82, July 2010.
40 / 41 41 / 41