Introduction to Bayesian Estimation
McGill COMP 765 Sept 12th, 2017
Introduction to Bayesian Estimation McGill COMP 765 Sept 12 th , - - PowerPoint PPT Presentation
Introduction to Bayesian Estimation McGill COMP 765 Sept 12 th , 2017 Where am I? our first core problem Last class: W e can model a robots motions and the world as spatial quantities These are not perfect and therefore
McGill COMP 765 Sept 12th, 2017
noise (+/- 5m): appears as jitter around path
unknown yaw drift: diverges over time
intelligently and recover a path which best explains both:
Source: Dave Ferguson “Solve for X” talk, July 2013 http://www.youtube.com/watch?v=KA_C6OpL_Ao
7
Measured distances for expected distance of 300 cm. It is crucial that we measure the noise well to integrate.
Sonar Laser
8
Probabilistic Robotics
Key idea: Explicit representation of uncertainty using the calculus of probability theory
= utility optimization
9
Discrete Random Variables
in {x1, x2, …, xn}.
random variable X takes on value xi.
02 . , 08 . , 2 . , 7 . ) ( Room P
.
10
Continuous Random Variables
function.
b a
dx x p b a x ) ( )) , ( Pr(
x p(x)
11
Joint and Conditional Probability
P(x,y) = P(x) P(y)
P(x | y) = P(x,y) / P(y) P(x,y) = P(x | y) P(y)
P(x | y) = P(x)
12
Law of Total Probability, Marginals
y
y x P x P ) , ( ) (
y
y P y x P x P ) ( ) | ( ) (
x
x P 1 ) (
Discrete case
1 ) ( dx x p
Continuous case
dy y p y x p x p ) ( ) | ( ) (
dy y x p x p ) , ( ) (
13
Bayes Formula evidence prior likelihood ) ( ) ( ) | ( ) ( ) ( ) | ( ) ( ) | ( ) , ( y P x P x y P y x P x P x y P y P y x P y x P
14
Normalization
) ( ) | ( 1 ) ( ) ( ) | ( ) ( ) ( ) | ( ) (
1
x P x y P y P x P x y P y P x P x y P y x P
x
y x x y x y x
y x P x x P x y P x
| | |
aux ) | ( : aux 1 ) ( ) | ( aux :
Algorithm:
15
Conditioning
dz y z P z y x P y x P dz z P z x P x P dz z x P x P ) | ( ) , | ( ) ( ) ( ) | ( ) ( ) , ( ) (
16
Bayes Rule with Background Knowledge
) | ( ) | ( ) , | ( ) , | ( z y P z x P z x y P z y x P
17
Conditioning
dz z P z y x P y x P dz z P z x P x P dz z x P x P ) ( ) , | ( ) ( ) ( ) | ( ) ( ) , ( ) (
18
Conditional Independence
) | ( ) | ( ) , ( z y P z x P z y x P ) , | ( ) ( y z x P z x P ) , | ( ) ( x z y P z y P
equivalent to and
19
Simple Example of State Estimation
20
Causal vs. Diagnostic Reasoning
) ( ) ( ) | ( ) | ( z P
P
z P z
P
count frequencies!
21
Example
P(z|open) = 0.3
67 . 3 2 5 . 3 . 5 . 6 . 5 . 6 . ) | ( ) ( ) | ( ) ( ) | ( ) ( ) | ( ) | (
z
P
p
z P
p
z P
P
z P z
P
22
Combining Evidence
P(x| z1...zn )?
23
Recursive Bayesian Updating
) , , | ( ) , , | ( ) , , , | ( ) , , | (
1 1 1 1 1 1 1
n n n n n n
z z z P z z x P z z x z P z z x P
Assumption: zn is independent of z1,...,zn-1 if we know x.
) ( ) | ( ) , , | ( ) | ( ) , , | ( ) , , | ( ) | ( ) , , | (
... 1 ... 1 1 1 1 1 1 1 1
x P x z P z z x P x z P z z z P z z x P x z P z z x P
n i i n n n n n n n n
24
Example: Second Measurement
P(z2|open) = 0.6
625 . 8 5 3 1 5 3 3 2 2 1 3 2 2 1 ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) , | (
1 2 1 2 1 2 1 2
z
P
z P z
P
z P z
P
z P z z
P
25
A Typical Pitfall
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 5 10 15 20 25 30 35 40 45 50 p( x | d) Number of integrations p(x2 | d) p(x1 | d)
26
Actions
change the world.
27
Typical Actions
increase the uncertainty.
28
Modeling Actions
action u into the current “belief”, we use the conditional pdf P(x|u,x’)
executing u changes the state from x’ to x.
29
Example: Closing the door
30
State Transitions P(x|u,x’) for u = “close door”: If the door is open, the action “close door” succeeds in 90% of all cases.
closed 0.1 1 0.9
31
Integrating the Outcome of Actions
Continuous case: Discrete case:
32
Example: The Resulting Belief
) | ( 1 16 1 8 3 1 8 5 10 1 ) ( ) , | ( ) ( ) , | ( ) ' ( ) ' , | ( ) | ( 16 15 8 3 1 1 8 5 10 9 ) ( ) , | ( ) ( ) , | ( ) ' ( ) ' , | ( ) | ( u closed P closed P closed u
P
P
u
P x P x u
P u
P closed P closed u closed P
P
u closed P x P x u closed P u closed P
33
Bayes Filters: Framework
) , , , | ( ) (
1 1 t t t t
z u z u x P x Bel } , , , {
1 1 t t t
z u z u d
34
Markov Assumption
Underlying Assumptions
) , | ( ) , , | (
1 : 1 : 1 1 : 1 t t t t t t t
u x x p u z x x p
) | ( ) , , | (
: 1 : 1 : t t t t t t
x z p u z x z p
1 1 1
) ( ) , | ( ) | (
t t t t t t t
dx x Bel x u x P x z P
Bayes Filters
) , , , | ( ) , , , , | (
1 1 1 1 t t t t t
u z u x P u z u x z P
Bayes z = observation u = action x = state
) , , , | ( ) (
1 1 t t t t
z u z u x P x Bel
Markov
) , , , | ( ) | (
1 1 t t t t
u z u x P x z P
Markov
1 1 1 1 1
) , , , | ( ) , | ( ) | (
t t t t t t t t
dx u z u x P x u x P x z P
1 1 1 1 1 1 1
) , , , | ( ) , , , , | ( ) | (
t t t t t t t t
dx u z u x P x u z u x P x z P
Total prob. Markov
1 1 1 1 1 1
) , , , | ( ) , | ( ) | (
t t t t t t t t
dx z z u x P x u x P x z P
36
Bayes Filter Algorithm
1.
Algorithm Bayes_filter( Bel(x),d ): 2. 0 3. If d is a perceptual data item z then 4. For all x do 5. 6. 7. For all x do 8. 9. Else if d is an action data item u then 10. For all x do 11. 12. Return Bel’(x)
) ( ) | ( ) ( ' x Bel x z P x Bel ) ( ' x Bel ) ( ' ) ( '
1
x Bel x Bel
' ) ' ( ) ' , | ( ) ( ' dx x Bel x u x P x Bel
1 1 1
) ( ) , | ( ) | ( ) (
t t t t t t t t
dx x Bel x u x P x z P x Bel
methods that roughly fall within this framework. First examples:
Discrete Bayes Filter Algorithm
1.
Algorithm Discrete_Bayes_filter( Bel(x),d ): 2. 0 3. If d is a perceptual data item z then 4. For all x do 5. 6. 7. For all x do 8. 9. Else if d is an action data item u then 10. For all x do 11. 12. Return Bel’(x)
) ( ) | ( ) ( ' x Bel x z P x Bel ) ( ' x Bel ) ( ' ) ( '
1
x Bel x Bel
'
) ' ( ) ' , | ( ) ( '
x
x Bel x u x P x Bel
Piecewise Constant Bel(x)
Piecewise Constant – What about Angle?
) , , ( y x x Bel
t
Implementation (1)
the normalization one has to iterate over all cells of the grid.
case during position tracking), one wants to avoid updating irrelevant aspects of the state space.
state space.
localized or not.
space.
Implementation (2)
assumes a bounded Gaussian model for the motion uncertainty.
number of states.
according to the measured motion.
Gaussian Kernel.
1/4 1/4 1/2 1/4 1/2 1/4
+
1/16 1/16 1/8 1/8 1/8 1/4 1/16 1/16 1/8
43
Grid-based Localization
44
Sonars and Occupancy Grid Map
assuming only local knowledge.
properly representing the posterior distribution
to represent our distributions and to compute updates (next time!)