Professional Documents
Culture Documents
Bart Massey
Assoc. Prof. Computer Science
Portland State University
bart@cs.pdx.edu
First, Let's Talk About Me
● PSU Assoc Prof for 10 years, PhD AI UO,
MS PL impl. UO, BA Physics Reed
● Interested in technical tools for cross-
disciplinary problem solving
● ISO bright, motivated partners
– Check out http://psas.pdx.edu
– Check out http://code.google.com/soc for
Google Summer of Code info
– State-space search course, Spring 2010
What I'll Talk About
● Brief history of navigation!
● The state space tracking problem
● Brief mention of Kalman Filters
● Intro to Bayesian Particle Filters
● The weighted resampling problem
● Efficient weighted resampling
● Sketch correctness (?) and optimality
of my weighted resampling method
● The Ziggurat Method
● Efficient variate generation for my weighted resampling
method
● 1M particle updates per second!
History of Navigation
In One Slide
● Whenever people traveled, they used
– “Dead reckoning”: Navigation using a
model of where you are
– Observation: Navigation using sensory
evidence of where you are
● Accurate clocks help with both
● Observation has come to dominate
– In particular, single “reliable” sensor
– Skilled navigators are better than this
– An “AI-complete” problem?
State Space Tracking
N
N
v
v
N
v N
N
v
– hi(tn) = wi = Pr(xi|E1..n )
= Pr(xi|E1) Pr(xi|E2) ...
● Estimate state from ensemble
● Resample (m → n, usually n = m)
– for i in {1..n}
– select p'i weighted-randomly
Weighted Random Resampling
● The naïve single-sample algorithm
– μ ← u[0..1] ; normalize wi
– w ← 0; i ← 1
– while w < μ
– w ← w + wi ; i ← i + 1
– return i
● Can iterate to get n samples
Faster Resampling
● Definitive method: O(mn)
● “Obvious” improvements:
– Binary search or treeify: O(m + n lg m)
– Sort variates and merge: O(n lg n + m)
● Could give up correctness
– Regular resampling: O(m)
– Regular with shuffle: O(m)
Optimal Resampling
● Variate merge is O(m lg m) because it
requires the variates in sorted order
● Just generate them that way?
● Distribution of the leftmost of n
variates μ ← u[0..1] is
p(μ0) = (1 - μ0)n-1
● Independence also implies recursion
● So we just generate variates in
increasing order and merge!
Sampling A Distribution
Bart Massey
Assoc. Prof. Computer Science
Portland State University
bart@cs.pdx.edu
First, Let's Talk About Me
● PSU Assoc Prof for 10 years, PhD AI UO,
MS PL impl. UO, BA Physics Reed
● Interested in technical tools for cross-
disciplinary problem solving
● ISO bright, motivated partners
– Check out http://psas.pdx.edu
– Check out http://code.google.com/soc for
Google Summer of Code info
– State-space search course, Spring 2010
What I'll Talk About
● Brief history of navigation!
● The state space tracking problem
● Brief mention of Kalman Filters
● Intro to Bayesian Particle Filters
● The weighted resampling problem
● Efficient weighted resampling
● Sketch correctness (?) and optimality
of my weighted resampling method
● The Ziggurat Method
● Efficient variate generation for my weighted resampling
method
● 1M particle updates per second!
History of Navigation
In One Slide
● Whenever people traveled, they used
– “Dead reckoning”: Navigation using a
model of where you are
– Observation: Navigation using sensory
evidence of where you are
● Accurate clocks help with both
● Observation has come to dominate
– In particular, single “reliable” sensor
– Skilled navigators are better than this
– An “AI-complete” problem?
State Space Tracking
N
N
v
v
N
v N
N
v
– hi(tn) = wi = Pr(xi|E1..n )
= Pr(xi|E1) Pr(xi|E2) ...
● Estimate state from ensemble
● Resample (m → n, usually n = m)
– for i in {1..n}
– select p'i weighted-randomly
Weighted Random Resampling
● The naïve single-sample algorithm
– μ ← u[0..1] ; normalize wi
– w ← 0; i ← 1
– while w < μ
– w ← w + wi ; i ← i + 1
– return i
● Can iterate to get n samples
Faster Resampling
● Definitive method: O(mn)
● “Obvious” improvements:
– Binary search or treeify: O(m + n lg m)
– Sort variates and merge: O(n lg n + m)
● Could give up correctness
– Regular resampling: O(m)
– Regular with shuffle: O(m)
Optimal Resampling
● Variate merge is O(m lg m) because it
requires the variates in sorted order
● Just generate them that way?
● Distribution of the leftmost of n
variates μ ← u[0..1] is
p(μ0) = (1 - μ0)n-1
● Independence also implies recursion
● So we just generate variates in
increasing order and merge!
Sampling A Distribution