EKF, ¡UKF ¡
¡ ¡ Pieter ¡Abbeel ¡ UC ¡Berkeley ¡EECS ¡ ¡ ¡ ¡ ¡
Many ¡slides ¡adapted ¡from ¡Thrun, ¡Burgard ¡and ¡Fox, ¡ProbabilisAc ¡RoboAcs ¡
¡
EKF, UKF Pieter Abbeel UC Berkeley EECS - - PowerPoint PPT Presentation
EKF, UKF Pieter Abbeel UC Berkeley EECS Many slides adapted from Thrun, Burgard and Fox, ProbabilisAc RoboAcs Kalman Filter Kalman
¡ ¡ Pieter ¡Abbeel ¡ UC ¡Berkeley ¡EECS ¡ ¡ ¡ ¡ ¡
Many ¡slides ¡adapted ¡from ¡Thrun, ¡Burgard ¡and ¡Fox, ¡ProbabilisAc ¡RoboAcs ¡
¡
n
Kalman ¡Filter ¡= ¡special ¡case ¡of ¡a ¡Bayes’ ¡filter ¡with ¡dynamics ¡and ¡sensory ¡models ¡linear ¡Gaussians: ¡
2
n At time 0: n For t = 1, 2, …
n Dynamics update: n Measurement update:
n Most ¡realisAc ¡roboAc ¡problems ¡involve ¡nonlinear ¡funcAons: ¡
n Versus ¡linear ¡seOng: ¡
“Gaussian ¡of ¡p(y)” ¡has ¡ mean ¡and ¡variance ¡of ¡y ¡ under ¡p(y) ¡ ¡
p(x) ¡has ¡high ¡variance ¡relaAve ¡to ¡region ¡in ¡which ¡linearizaAon ¡is ¡accurate. ¡ ¡
p(x) ¡has ¡small ¡variance ¡relaAve ¡to ¡region ¡in ¡ which ¡linearizaAon ¡is ¡accurate. ¡ ¡
n Dynamics ¡model: ¡for ¡xt ¡“close ¡to” ¡μt ¡we ¡have: ¡ n Measurement ¡model: ¡for ¡xt ¡“close ¡to” ¡μt ¡we ¡have: ¡
n
n Here ¡ei ¡is ¡the ¡basis ¡vector ¡with ¡all ¡entries ¡equal ¡to ¡zero, ¡except ¡for ¡the ¡
n If ¡wanAng ¡to ¡approximate ¡Ft ¡as ¡closely ¡as ¡possible ¡then ¡ε ¡is ¡chosen ¡to ¡
n
n
n
n
n ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
¡ ¡ ¡ ¡à ¡ ¡
n
(See the Matrix Cookbook for matrix identities, including derivatives.)
n For ¡our ¡example ¡problem ¡we ¡obtain ¡a ¡= ¡[4.75; ¡2.00] ¡
a0 + a1 x
n
n
n
¡ ¡ ¡ ¡ ¡ ¡ ¡à ¡ ¡
n
0 10 20 30 40 10 20 30 20 22 24 26
n
n
n
n
n
n
n
¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡{( ¡xt(1), ¡y(1)=ft(xt(1),ut), ¡( ¡xt(2), ¡y(2)=ft(xt(2),ut), ¡…, ¡( ¡xt(m), ¡y(m)=ft(xt(m),ut)} ¡
n
¡
n
traditional (tangent) OLS
n Perhaps ¡most ¡natural ¡choice: ¡ ¡
n ¡ ¡ ¡ n ¡reasonable ¡way ¡to ¡cover ¡region ¡with ¡high ¡probability ¡mass ¡
n
n
n AnalyAcal ¡derivaAves ¡can ¡be ¡cheaper ¡or ¡more ¡expensive ¡than ¡funcAon ¡
evaluaAons ¡
n
n Numerical ¡derivaAves ¡tend ¡to ¡be ¡easier ¡to ¡implement ¡ n If ¡deciding ¡to ¡use ¡analyAcal ¡derivaAves, ¡implemenAng ¡finite ¡difference ¡
derivaAve ¡and ¡comparing ¡with ¡analyAcal ¡results ¡can ¡help ¡debugging ¡the ¡ analyAcal ¡derivaAves ¡
n
n
n Dynamics update: n Measurement update:
n Highly ¡efficient: ¡Polynomial ¡in ¡measurement ¡
n Not ¡opAmal! ¡ n Can ¡diverge ¡if ¡nonlineariAes ¡are ¡large! ¡ n Works ¡surprisingly ¡well ¡even ¡when ¡all ¡assumpAons ¡are ¡
EKF UKF
EKF UKF
EKF UKF
n
Assume ¡we ¡know ¡the ¡distribuAon ¡over ¡X ¡and ¡it ¡has ¡a ¡mean ¡\bar{x} ¡
n
Y ¡= ¡f(X) ¡
n
EKF ¡approximates ¡f ¡by ¡first ¡order ¡and ¡ignores ¡higher-‑order ¡terms ¡
n
UKF ¡uses ¡f ¡exactly, ¡but ¡approximates ¡p(x). ¡ ¡
[Julier and Uhlmann, 1997]
n
Picks ¡a ¡minimal ¡set ¡of ¡sample ¡points ¡that ¡match ¡1st, ¡2nd ¡and ¡3rd ¡moments ¡of ¡a ¡Gaussian: ¡
n
\bar{x} ¡= ¡mean, ¡Pxx ¡= ¡covariance, ¡i ¡à ¡i’th ¡column, ¡x ¡in ¡Rn
n
κ ¡: ¡extra ¡degree ¡of ¡freedom ¡to ¡fine-‑tune ¡the ¡higher ¡order ¡moments ¡of ¡the ¡approximaAon; ¡when ¡x ¡is ¡ Gaussian, ¡n+κ ¡= ¡3 ¡is ¡a ¡suggested ¡heurisAc ¡
n
L ¡= ¡\sqrt{P_{xx}} ¡can ¡be ¡chosen ¡to ¡be ¡any ¡matrix ¡saAsfying: ¡
n
L ¡LT ¡= ¡Pxx
[Julier and Uhlmann, 1997]
Beyond scope of course, just including for completeness.
n When ¡would ¡the ¡UKF ¡significantly ¡outperform ¡the ¡EKF? ¡
n
AnalyAcal ¡derivaAves, ¡finite-‑difference ¡derivaAves, ¡and ¡least ¡squares ¡will ¡all ¡end ¡up ¡with ¡a ¡ horizontal ¡linearizaAon ¡ à ¡they’d ¡predict ¡zero ¡variance ¡in ¡Y ¡= ¡f(X) ¡
x y
n Dynamics ¡update: ¡
n Can ¡simply ¡use ¡unscented ¡transform ¡and ¡esAmate ¡the ¡mean ¡and ¡
n ObservaAon ¡update: ¡
n Use ¡sigma-‑points ¡from ¡unscented ¡transform ¡to ¡compute ¡the ¡covariance ¡
[Table 3.4 in Probabilistic Robotics]
n Highly ¡efficient: ¡Same ¡complexity ¡as ¡EKF, ¡with ¡a ¡
n Beter ¡linearizaAon ¡than ¡EKF: ¡Accurate ¡in ¡first ¡two ¡
n DerivaAve-‑free: ¡No ¡Jacobians ¡needed ¡ n SAll ¡not ¡opAmal! ¡