Professional Documents
Culture Documents
Bayesian filtering
Martin Magnusson
April 3, 2012
Agenda
Bayes filters
Outro
Bayes filters
Outro
Bayes filters
Important relations
Conditional probability
(the prob that X = x if we know, or assume, that Y = y)
p(x | y) =
p(x, y) = p(x | y)
| {z }
p(y)
|{z}
= p(y | x)p(x)
Outro
Bayes filters
p(y | open)p(open)
p(y)
Outro
Bayes filters
Bayes formula
p(x | y) =
p(y | x)p(x)
p(y)
p(y | x)p(x)
p(y)
p(y | x)p(x)
0
0
x0 p(y | x )p(x )
Outro
Bayes filters
decreases with
the prior prob of finding y (i.e., prob of getting test result y
without knowing the state of x)
Outro
Bayes filters
Prior probabilities
p(X = open) = 0.5
p(X = closed) = 0.5
Outro
Bayes filters
Outro
Bayes filters
X
y
p(x | y)p(y) =
p(x, y)
Outro
Bayes filters
p(x) =
n
X
p(x, yi )=
i=1
n
X
p(x | yi )p(yi )
i=1
y2
y1
y6
y4
y7
y3
y5
Outro
Bayes filters
p(y)
axiom 1
p(x) = ni=1 (x yi )
axiom 3
n
X
p(x, yi )
i=1
n
def. of joint prob. X
p(x)
=
p(x | yi )p(yi )
i=1
Outro
Bayes filters
Outro
State
State
Description of what the robot needs
to know.
State at time t is denoted xt .
State transitions over time:
x0 x1 . . .
The set of all states from time t1 to
time t2 :
xt1 :t2 = xt1 , xt1 +1 , xt1 +1 , . . . , xt2
Internal state Typically the pose [x, y, ].
External state Map, other agents, etc.
x, y
Bayes filters
State
Markov state
Outro
Bayes filters
State
Outro
Interaction
Measurements
Bayes filters
Outro
Bayes filters
Interaction
Actions
Note that
actions are never carried out with absolute certainty,
actions generally increase uncertainty.
Outro
Bayes filters
Interaction
Modelling actions
The outcome of an action u is modelled by the conditional
probability distribution
p(x | u, x0 )
That is, the probability that, when in state x0 , executing action u,
changes the state to x.
1
state x0 = [10 m, 5 m, 0 ]
Outro
Bayes filters
Belief
Belief
We never know the true state of the robot.
All we have is the belief.
Represent belief through conditional probability
distribution:
bel(xt ) = p(xt | z1:t , u1:t )
A belief distribution assigns a probability density (or mass)
to each possible outcome, (given a sequence of actions and
measurements).
Belief distributions are posterior probabilities over state
variables, conditioned on the available data.
Outro
Bayes filters
Belief
Outro
Bayes filters
The algorithm
2
3
4
Wanted:
estimate of the state x (the belief)
bel(xt ) = p(xt | z1:t , u1:t )
Outro
Bayes filters
Outro
The algorithm
x0
...
ut2
ut1
ut
xt2
xt1
xt
zt2
zt1
zt
...
Example
Bayes filters
Outro
Bayes filters
Outro
Example
= 0.2
= 0.8
easy to sense closed door
Bayes filters
Outro
Example
=1
=0
= 0.8
= 0.2
Bayes filters
Outro
Example
bel(X1 = closed) =
0.2 0.5
= 0.25 = 1 bel(X1 = open)
0.6 0.5 + 0.2 0.5
Bayes filters
Example
State transisions
p(x | u, x0 ) for u = push
0
X = closed
X = open
0.2
0.8
Outro
Bayes filters
Example
discrete case
x0
Z
p(x | u) =
continuous case
Outro
Bayes filters
Example
x0
p(X = closed | u2 )
=
x0
Outro
Bayes filters
Example
Combining evidence
Outro
Bayes filters
Example
p(x | y) =
p(y | x)p(x)
p(y)
p(y | x, z)p(x | z)
p(y | z)
Outro
Bayes filters
Example
p(x | z1 , . . . , zt ) =
prior
}|
{
z }| { z
p(zt | x) p(x | z1 , . . . , zt1 )
p(x | z1 , . . . , zt ) =
p(zt | z1 , . . . , zt1 )
|
{z
}
normaliser
Outro
Bayes filters
Example
bel(X2 = closed) =
0.2 0.25
= 0.10 = 1 bel(X2 = open)
0.6 0.75 + 0.2 0.25
Outro
Bayes filters
Example
function BayesFilter(bel(Xt1 ), ut , zt )
for all xt do R
bel(xt ) = p(xt | ut , xt1 ) bel(xt1 ) dxt1 . control update
bel(xt ) = p(zt | xt ) bel(xt ) p(zt )1
. measurement update
end for
return bel(Xt )
end function
Outro
Bayes filters
Example
Outro
Bayes filters
Example
Outro
Bayes filters
Summary
Markov assumptions: we dont need history of all previous
states.
Sensor measurements Z decrease uncertainty, robot actions
U increase uncertainty.
Belief is represented as posterior PDF over possible state
outcomes, conditioned on sensor data and actions.
Bayes rule allows us to compute probabilities that are hard
to assess otherwise.
Under the Markov assumption, recursive Bayesian updating
can be used to efficiently combine evidence.
Bayes filters are a probabilistic tool for estimating the state
of dynamic systems.
The Bayes filter cannot be implemented for realistic,
continuous, state spaces. (The remainder of the course will
discuss approximations.)
Outro
Next lecture
Bayes filters
Outro