39
Temporal probability models Chapter 15, Sections 1–5 Chapter 15, Sections 1–5 1

1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Temporalprobabilitymodels

Chapter15,Sections1–5

Chapter15,Sections1–51

Page 2: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Outline

♦Timeanduncertainty

♦Inference:filtering,prediction,smoothing

♦HiddenMarkovmodels

♦Kalmanfilters(abriefmention)

♦DynamicBayesiannetworks

♦Particlefiltering

Chapter15,Sections1–52

Page 3: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Timeanduncertainty

Theworldchanges;weneedtotrackandpredictit

Diabetesmanagementvsvehiclediagnosis

Basicidea:copystateandevidencevariablesforeachtimestep

Xt=setofunobservablestatevariablesattimete.g.,BloodSugart,StomachContentst,etc.

Et=setofobservableevidencevariablesattimete.g.,MeasuredBloodSugart,PulseRatet,FoodEatent

Thisassumesdiscretetime;stepsizedependsonproblem

Notation:Xa:b=Xa,Xa+1,...,Xb−1,Xb

Chapter15,Sections1–53

Page 4: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Markovprocesses(Markovchains)

ConstructaBayesnetfromthesevariables:parents?

Markovassumption:XtdependsonboundedsubsetofX0:t−1

First-orderMarkovprocess:P(Xt|X0:t−1)=P(Xt|Xt−1)Second-orderMarkovprocess:P(Xt|X0:t−1)=P(Xt|Xt−2,Xt−1)

Xt−1Xt Xt−2Xt+1Xt+2

Xt−1Xt Xt−2Xt+1Xt+2 First−order

Second−order

SensorMarkovassumption:P(Et|X0:t,E0:t−1)=P(Et|Xt)

Stationaryprocess:transitionmodelP(Xt|Xt−1)andsensormodelP(Et|Xt)fixedforallt

Chapter15,Sections1–54

Page 5: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Example

t Rain

t Umbrella

Raint−1

Umbrellat−1

Raint+1

Umbrellat+1

Rt−1t P(R )

0.3 f0.7 t

t Rt P(U )

0.9 t0.2 f

First-orderMarkovassumptionnotexactlytrueinrealworld!

Possiblefixes:1.IncreaseorderofMarkovprocess2.Augmentstate,e.g.,addTempt,Pressuret

Example:robotmotion.AugmentpositionandvelocitywithBatteryt

Chapter15,Sections1–55

Page 6: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Inferencetasks

Filtering:P(Xt|e1:t)beliefstate—inputtothedecisionprocessofarationalagent

Prediction:P(Xt+k|e1:t)fork>0evaluationofpossibleactionsequences;likefilteringwithouttheevidence

Smoothing:P(Xk|e1:t)for0≤k<tbetterestimateofpaststates,essentialforlearning

Mostlikelyexplanation:argmaxx1:tP(x1:t|e1:t)speechrecognition,decodingwithanoisychannel

Chapter15,Sections1–56

Page 7: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Filtering

Aim:devisearecursivestateestimationalgorithm:

P(Xt+1|e1:t+1)=f(et+1,P(Xt|e1:t))

P(Xt+1|e1:t+1)=P(Xt+1|e1:t,et+1)

=αP(et+1|Xt+1,e1:t)P(Xt+1|e1:t)

=αP(et+1|Xt+1)P(Xt+1|e1:t)

I.e.,prediction+estimation.PredictionbysummingoutXt:

P(Xt+1|e1:t+1)=αP(et+1|Xt+1)ΣxtP(Xt+1|xt,e1:t)P(xt|e1:t)

=αP(et+1|Xt+1)ΣxtP(Xt+1|xt)P(xt|e1:t)

f1:t+1=Forward(f1:t,et+1)wheref1:t=P(Xt|e1:t)Timeandspaceconstant(independentoft)

Chapter15,Sections1–57

Page 8: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Filteringexample

Rain1

Umbrella1

Rain2

Umbrella2

Rain0

0.8180.182

0.6270.373

0.8830.117

TrueFalse

0.5000.500

0.5000.500

Chapter15,Sections1–58

Page 9: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Smoothing

X0X1

1 EEkt E

t X Xk

Divideevidencee1:tintoe1:k,ek+1:t:

P(Xk|e1:t)=P(Xk|e1:k,ek+1:t)

=αP(Xk|e1:k)P(ek+1:t|Xk,e1:k)

=αP(Xk|e1:k)P(ek+1:t|Xk)

=αf1:kbk+1:t

Backwardmessagecomputedbyabackwardsrecursion:

P(ek+1:t|Xk)=Σxk+1P(ek+1:t|Xk,xk+1)P(xk+1|Xk)

=Σxk+1P(ek+1:t|xk+1)P(xk+1|Xk)

=Σxk+1P(ek+1|xk+1)P(ek+2:t|xk+1)P(xk+1|Xk)

Chapter15,Sections1–59

Page 10: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Smoothingexample

Rain1

Umbrella1

Rain2

Umbrella2

Rain0

TrueFalse

0.8180.182

0.6270.373

0.8830.117

0.5000.500

0.5000.500

1.0001.000

0.6900.410

0.8830.117

forward

backward

smoothed0.8830.117

Forward–backwardalgorithm:cacheforwardmessagesalongthewayTimelinearint(polytreeinference),spaceO(t|f|)

Chapter15,Sections1–510

Page 11: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Mostlikelyexplanation

Mostlikelysequence6=sequenceofmostlikelystates!!!!

Mostlikelypathtoeachxt+1

=mostlikelypathtosomextplusonemorestep

max x1...xtP(x1,...,xt,Xt+1|e1:t+1)

=P(et+1|Xt+1)max xt

P(Xt+1|xt)max x1...xt−1

P(x1,...,xt−1,xt|e1:t)

Identicaltofiltering,exceptf1:treplacedby

m1:t=max x1...xt−1

P(x1,...,xt−1,Xt|e1:t),

I.e.,m1:t(i)givestheprobabilityofthemostlikelypathtostatei.Updatehassumreplacedbymax,givingtheViterbialgorithm:

m1:t+1=P(et+1|Xt+1)max xt(P(Xt+1|xt)m1:t)

Chapter15,Sections1–511

Page 12: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Viterbiexample

Rain1Rain2Rain3Rain4Rain5

true

false

true

false

true

false

true

false

true

false

.8182.5155.0361.0334.0210

.1818.0491.1237.0173.0024

m1:1m1:5 m1:4 m1:3 m1:2

statespacepaths

mostlikelypaths

umbrellatruetrue true false true

Chapter15,Sections1–512

Page 13: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

HiddenMarkovmodels

Xtisasingle,discretevariable(usuallyEtistoo)DomainofXtis{1,...,S}

TransitionmatrixTij=P(Xt=j|Xt−1=i),e.g.,

0.70.30.30.7

SensormatrixOtforeachtimestep,diagonalelementsP(et|Xt=i)

e.g.,withU1=true,O1=

0.9000.2

Forwardandbackwardmessagesascolumnvectors:

f1:t+1=αOt+1T>f1:t

bk+1:t=TOk+1bk+2:t

Forward-backwardalgorithmneedstimeO(S2t)andspaceO(St)

Chapter15,Sections1–513

Page 14: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–514

Page 15: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–515

Page 16: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–516

Page 17: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–517

Page 18: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–518

Page 19: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–519

Page 20: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–520

Page 21: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–521

Page 22: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–522

Page 23: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Countrydancealgorithm

Canavoidstoringallforwardmessagesinsmoothingbyrunningforwardalgorithmbackwards:

f1:t+1=αOt+1T>f1:t

O−1

t+1f1:t+1=αT>f1:t

α′(T

>)−1

O−1

t+1f1:t+1=f1:t

Algorithm:forwardpasscomputesft,backwardpassdoesfi,bi

Chapter15,Sections1–523

Page 24: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Kalmanfilters

Modellingsystemsdescribedbyasetofcontinuousvariables,e.g.,trackingabirdflying—Xt=X,Y,Z,X,Y,Z.Airplanes,robots,ecosystems,economies,chemicalplants,planets,...

t Zt+1 Z

t Xt+1 X

t Xt+1 X

Gaussianprior,linearGaussiantransitionmodelandsensormodel

Chapter15,Sections1–524

Page 25: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

UpdatingGaussiandistributions

Predictionstep:ifP(Xt|e1:t)isGaussian,thenprediction

P(Xt+1|e1:t)=∫

xtP(Xt+1|xt)P(xt|e1:t)dxt

isGaussian.IfP(Xt+1|e1:t)isGaussian,thentheupdateddistribution

P(Xt+1|e1:t+1)=αP(et+1|Xt+1)P(Xt+1|e1:t)

isGaussian

HenceP(Xt|e1:t)ismultivariateGaussianN(µt,Σt)forallt

General(nonlinear,non-Gaussian)process:descriptionofposteriorgrowsunboundedlyast→∞

Chapter15,Sections1–525

Page 26: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Simple1-Dexample

GaussianrandomwalkonX–axis,s.d.σx,sensors.d.σz

µt+1=(σ

2t+σ

2x)zt+1+σ

2zµt

σ2t+σ

2x+σ

2z

σ2

t+1=(σ

2t+σ

2x)σ

2z

σ2t+σ

2x+σ

2z

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

-8-6-4-202468

P(X)

X position

P(x0)

P(x1)

P(x1 | z1=2.5)

*z1

Chapter15,Sections1–526

Page 27: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

GeneralKalmanupdate

Transitionandsensormodels:

P(xt+1|xt)=N(Fxt,Σx)(xt+1)P(zt|xt)=N(Hxt,Σz)(zt)

Fisthematrixforthetransition;ΣxthetransitionnoisecovarianceHisthematrixforthesensors;Σzthesensornoisecovariance

Filtercomputesthefollowingupdate:

µt+1=Fµt+Kt+1(zt+1−HFµt)

Σt+1=(I−Kt+1)(FΣtF>

+Σx)

whereKt+1=(FΣtF>

+Σx)H>(H(FΣtF

>+Σx)H

>+Σz)

−1

istheKalmangainmatrix

ΣtandKtareindependentofobservationsequence,socomputeoffline

Chapter15,Sections1–527

Page 28: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

2-Dtrackingexample:filtering

81012141618202224266

7

8

9

10

11

12

X

Y

2D filtering

trueobservedfiltered

Chapter15,Sections1–528

Page 29: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

2-Dtrackingexample:smoothing

81012141618202224266

7

8

9

10

11

12

X

Y

2D smoothing

trueobservedsmoothed

Chapter15,Sections1–529

Page 30: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Whereitbreaks

Cannotbeappliedifthetransitionmodelisnonlinear

ExtendedKalmanFiltermodelstransitionaslocallylineararoundxt=µt

Failsifsystemsislocallyunsmooth

Chapter15,Sections1–530

Page 31: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

DynamicBayesiannetworks

Xt,EtcontainarbitrarilymanyvariablesinareplicatedBayesnet

0.3 f0.7 t

0.9 t0.2 f

Rain0Rain1

Umbrella1

P(U ) 1 R1

P(R )1 R0

0.7

P(R )0

Z1

X1

X1 tXX0

X0

1 Battery Battery0

1 BMeter

Chapter15,Sections1–531

Page 32: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

DBNsvs.HMMs

EveryHMMisasingle-variableDBN;everydiscreteDBNisanHMM

XtXt+1

t Yt+1 Y

t Zt+1 Z

Sparsedependencies⇒exponentiallyfewerparameters;e.g.,20statevariables,threeparentseachDBNhas20×2

3=160parameters,HMMhas2

20×2

20≈10

12

Chapter15,Sections1–532

Page 33: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

DBNsvsKalmanfilters

EveryKalmanfiltermodelisaDBN,butfewDBNsareKFs;realworldrequiresnon-Gaussianposteriors

E.g.,wherearebinLadenandmykeys?What’sthebatterycharge?

Z1

X1

X1 tXX0

X0

1 Battery Battery0

1 BMeter

0 BMBroken1 BMBroken

-1

0

1

2

3

4

5

15202530

E(B

attery)

Time step

E(Battery|...5555005555...)

E(Battery|...5555000000...)

P(BMBroken|...5555000000...)

P(BMBroken|...5555005555...)

Chapter15,Sections1–533

Page 34: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

ExactinferenceinDBNs

Naivemethod:unrollthenetworkandrunanyexactalgorithm

0.3 f0.7 t

0.9 t0.2 f

Rain1

Umbrella1

P(U ) 1 R1

P(R )1 R0

Rain0

0.7

P(R )0

0.3 f0.7 t

0.9 t0.2 f

Rain1

Umbrella1

P(U ) 1 R1

P(R )1 R0

0.3 f0.7 t

0.9 t0.2 f

P(U ) 1 R1

P(R )1 R0

0.3 f0.7 t

0.9 t0.2 f

P(U ) 1 R1

P(R )1 R0

0.3 f0.7 t

0.9 t0.2 f

P(U ) 1 R1

P(R )1 R0

0.3 f0.7 t

0.9 t0.2 f

P(U ) 1 R1

P(R )1 R0

0.9 t0.2 f

P(U ) 1 R1

0.3 f0.7 t

P(R )1 R0

0.9 t0.2 f

P(U ) 1 R1

0.3 f0.7 t

P(R )1 R0

Rain0

0.7

P(R )0

Umbrella2

Rain3

Umbrella3

Rain4

Umbrella4

Rain5

Umbrella5

Rain6

Umbrella6

Rain7

Umbrella7

Rain2

Problem:inferencecostforeachupdategrowswitht

Rollupfiltering:addslicet+1,“sumout”slicetusingvariableelimination

LargestfactorisO(dn+1

),updatecostO(dn+2

)(cf.HMMupdatecostO(d

2n))

Chapter15,Sections1–534

Page 35: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

LikelihoodweightingforDBNs

Setofweightedsamplesapproximatesthebeliefstate

Rain1

Umbrella1

Rain0

Umbrella2

Rain3

Umbrella3

Rain4

Umbrella4

Rain5

Umbrella5

Rain2

LWsamplespaynoattentiontotheevidence!⇒fraction“agreeing”fallsexponentiallywitht⇒numberofsamplesrequiredgrowsexponentiallywitht

0

0.2

0.4

0.6

0.8

1

05101520253035404550

RM

S error

Time step

LW(10)LW(100)

LW(1000)LW(10000)

Chapter15,Sections1–535

Page 36: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Particlefiltering

Basicidea:ensurethatthepopulationofsamples(“particles”)tracksthehigh-likelihoodregionsofthestate-space

Replicateparticlesproportionaltolikelihoodforet

true

false

(a) Propagate(b) Weight(c) Resample

RaintRaint+1 Raint+1 Raint+1

Widelyusedfortrackingnonlinearsystems,esp.invision

Alsousedforsimultaneouslocalizationandmappinginmobilerobots10

5-dimensionalstatespace

Chapter15,Sections1–536

Page 37: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Particlefilteringcontd.

Assumeconsistentattimet:N(xt|e1:t)/N=P(xt|e1:t)

Propagateforward:populationsofxt+1are

N(xt+1|e1:t)=ΣxtP(xt+1|xt)N(xt|e1:t)

Weightsamplesbytheirlikelihoodforet+1:

W(xt+1|e1:t+1)=P(et+1|xt+1)N(xt+1|e1:t)

ResampletoobtainpopulationsproportionaltoW:

N(xt+1|e1:t+1)/N=αW(xt+1|e1:t+1)=αP(et+1|xt+1)N(xt+1|e1:t)

=αP(et+1|xt+1)ΣxtP(xt+1|xt)N(xt|e1:t)

=α′P(et+1|xt+1)ΣxtP(xt+1|xt)P(xt|e1:t)

=P(xt+1|e1:t+1)

Chapter15,Sections1–537

Page 38: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Particlefilteringperformance

Approximationerrorofparticlefilteringremainsboundedovertime,atleastempirically—theoreticalanalysisisdifficult

0

0.2

0.4

0.6

0.8

1

05101520253035404550

Avg absolute error

Time step

LW(25)LW(100)

LW(1000)LW(10000)

ER/SOF(25)

Chapter15,Sections1–538

Page 39: 1{5 Sections 15, Chapter - University of Minnesotavision.psych.umn.edu › ... › courses › AI2 › chapter15a.pdf · Ba y esian net w o rks} P a ... rticle ltering Chapter 15,

Summary

Temporalmodelsusestateandsensorvariablesreplicatedovertime

Markovassumptionsandstationarityassumption,soweneed–transitionmodelP(Xt|Xt−1)–sensormodelP(Et|Xt)

Tasksarefiltering,prediction,smoothing,mostlikelysequence;alldonerecursivelywithconstantcostpertimestep

HiddenMarkovmodelshaveasinglediscretestatevariable;usedforspeechrecognition

Kalmanfiltersallownstatevariables,linearGaussian,O(n3)update

DynamicBayesnetssubsumeHMMs,Kalmanfilters;exactupdateintractable

ParticlefilteringisagoodapproximatefilteringalgorithmforDBNs

Chapter15,Sections1–539