CSE291D_5

© All Rights Reserved

2 views

CSE291D_5

© All Rights Reserved

- Tutorial 1
- Population Sampling 4th
- 13423956 Project Finance Modelling in the Angolan Oil Industry 2001
- The International Dictionary Of Artificial Intelligence - William Raynor
- re_reportf
- stats_s5
- Statistics
- Todini - Hydrological Catchment Modelling- Past-present and Future
- lsuf_20100519_forbes
- Smart Decision-Making in the New Era of Financial Challenges-tws-068279
- Output
- Simulation
- Rawling - 'Reasonable Doubt and the Presumption of Innocence; The Case of the Bayesian Juror'
- Face and Hand Gesture Recognition for Physical Impairment Peoples.pdf
- multiple target tracking
- Homework 2 Solution
- Test for New Mediation Effect Multiple IV.docx
- SPE-89983-MS
- Table of Contents Bioethics
- A Bayesian Approach EVM

You are on page 1of 60

Importance Sampling,

Rejection Sampling,

Particle filters

1

Project

• Project details have been uploaded to Piazza,

and are in the handout

via email

your project.

You can use Piazza to search for teammates

2

Probability and Inference

Probability

Data generating

Observed data

process

Inference

3

Figure based on one by Larry Wasserman, "All of Statistics"

Approximate Inference

• In principle, Bayesian inference is a simple

application of Bayes’ rule. This has been easy to do

for most of the simple models we’ve studied so far.

intractable, motivating approximation techniques

4

Approximate Inference

• Optimization approaches

Maximize or find a fixed point

• EM

• Variational inference

– Variational Bayes, mean field

– Message passing: loopy BP, TRW, expectation propagation

• Laplace approximation

5

Approximate Inference

• Simulation approaches

(Monte Carlo methods)

• Particle filtering

• Markov chain Monte Carlo

– Gibbs sampling, Metropolis-Hastings, Hamiltonian Monte

Carlo…

6

Monte Carlo Methods

• Suppose we want to approximately compute

large S,

7

Monte Carlo Methods

– Compute f(x) for each of the samples

– Approximate E[f(x)] by the sample average

8

Monte Carlo Methods: Example

9

Monte Carlo Methods

need to resort to approximate algorithms

lessons

10

Learning outcomes

By the end of the lesson, you should be able to:

expectations under distributions, including

importance sampling and rejection sampling.

might be expected to perform well or not.

11

12

13

Bayesian Inference:

One Computer Scientist’s Perspective

• In theory, the posterior is simply given by Bayes’ rule.

prior, and normalizing, for every single possible value

typically couldn’t even store the result of this computation (at

least naïvely).

14

Bayesian Inference:

One Computer Scientist’s Perspective

• So, what do we actually mean when we say

we are doing Bayesian inference?

– Answering specific queries with respect to the

distribution?

(MAP, marginals, posterior predictive,…)

answer such queries?

• Posterior samples could be understood as a convenient

data structure summarizing the posterior distribution

15

Sampling: An analogy

come from anywhere in the lake

16

Exhaustive approach

whole lake into equally-sized jars. Pick one at random

the “surface of the lake” increases exponentially

17

Sampling: Challenges

make sure you don’t miss them?

18

Uniform sampling

their relative probability

19

Uniform sampling

bad.

• In higher dimensions, it’s more likely you’ll

miss the “canyons”

20

Uniform sampling

• E.g. suppose you have a very good model for documents:

The quick brown fox jumps over the sly lazy dog

[5 6 37 1 4 30 5 22 570 12]

smaller, the longer the document is.

21

Importance sampling

• Same idea, but pick from a better “proposal”

distribution than uniform.

• Reweight samples to correct for sampling from the

wrong distribution.

22

Importance sampling

23

Importance sampling

24

Importance sampling

25

Importance sampling

26

Importance sampling

without normalization constants

27

Importance sampling

without normalization constants

28

Importance sampling

without normalization constants

29

Importance sampling

without normalization constants

30

Importance sampling

without normalization constants

31

Importance sampling

without normalization constants

32

Importance sampling

without normalization constants

33

34

Importance sampling

• Can be used to estimate the ratio of

partition functions between p(x) and q(x)

35

Importance sampling

• Can be used to estimate the ratio of

partition functions between p(x) and q(x)

36

Importance sampling

• Can be used to estimate the ratio of

partition functions between p(x) and q(x)

37

Importance sampling

• Can be used to estimate the ratio of

partition functions between p(x) and q(x)

38

39

Heavy tails

• If q(x) goes towards zero faster than p(x), importance

weights of rare events will become extremely large

Importance sampling

in high dimensions

• As the dimensionality of the space increases, it becomes

harder to reliably construct a good proposal distribution

Spherical Gaussian:

41

42

Sampling Importance Resampling

• We can convert a set of importance-weighted

samples to a set of unweighted samples

replacement, proportional to their importance weights

43

Rejection Sampling

• Sample uniformly under the curve cQ*(x) (with auxiliary “height” u)

• Reject samples that do not fall under the curve of P*(x)

44

Rejection Sampling

• Sample uniformly under the curve cQ*(x) (with auxiliary “height” u)

• Reject samples that do not fall under the curve of P*(x)

45

Rejection sampling

in high dimensions

• As the dimensionality of the space increases, the constant c

gets exponentially larger in general

46

Particle Filters

• Dynamical systems (cf. Kalman filters)

Latent

states Z1 Z2 Z3 Z4 Z5

…

Observations Y1 Y2 Y3 Y4 Y5

forecasting,…

47

Particle Filters

• Dynamical systems (cf. Kalman filters)

Latent

states Z1 Z2 Z3 Z4 Z5

…

Observations Y1 Y2 Y3 Y4 Y5

Zt = ?

current state zt

48

Particle Filters

• Particle filters, a.k.a. sequential Monte Carlo,

a.k.a. sequential importance sampling

• Basic idea:

– Perform importance sampling to estimate z,

include zt and update the weights recursively

49

Updating importance weights

50

Degeneracy

• As we add more timesteps, the z vector

becomes higher dimensional

– Importance weights select only a few samples

– When “effective sample size” is low, resample new

particles proportional to the weights

51

Illustration of particle filtering

52

Application: visual object tracking

• Goal: track an object (in this case, a remote

controlled helicopter) in a video sequence

• Likelihood based on color histogram features

• Proposal distribution: sample from the prior

(dynamics model)

• S = 250 samples

53

54

55

56

57

58

59

Think-pair-share: helicopter tracker

as part of a mobile phone app in 3 months, but needs it to be

more reliable.

performance?

60

- Tutorial 1Uploaded byneeta
- Population Sampling 4thUploaded byKhudadad Nabizada
- 13423956 Project Finance Modelling in the Angolan Oil Industry 2001Uploaded byArmando_Neto
- The International Dictionary Of Artificial Intelligence - William RaynorUploaded bypahlavani_parham
- re_reportfUploaded bykhoamai
- stats_s5Uploaded byAlok Rustagi
- StatisticsUploaded bymihirpatil123456789
- Todini - Hydrological Catchment Modelling- Past-present and FutureUploaded byrutitassi
- lsuf_20100519_forbesUploaded byGrant Atoyan
- Smart Decision-Making in the New Era of Financial Challenges-tws-068279Uploaded byegrodrig20082275
- OutputUploaded byZhoelly Grethonxers Sedjati
- SimulationUploaded byakshata1
- Rawling - 'Reasonable Doubt and the Presumption of Innocence; The Case of the Bayesian Juror'Uploaded byKam Ho M. Wong
- Face and Hand Gesture Recognition for Physical Impairment Peoples.pdfUploaded byiaetsdiaetsd
- multiple target trackingUploaded byRodney Miller
- Homework 2 SolutionUploaded byJung Yoon Song
- Test for New Mediation Effect Multiple IV.docxUploaded byShatesh Kumar Chandrahasan
- SPE-89983-MSUploaded byCursi Ocho
- Table of Contents BioethicsUploaded byRoey Rubian
- A Bayesian Approach EVMUploaded byTadala Paul Maluwa
- Particle filter an overview--printed.pdfUploaded byVanessa A. Godoy
- Wade.xlsxUploaded byLucky Lucky
- Qualitative Risk AnalysisUploaded bydrsuresh26
- CSP-06Uploaded byCharlieDepp
- 173Uploaded byNazim Uddin
- a1Uploaded byprakash
- Perhitungan.xlsxUploaded bydiky aulia
- Makesens_temperatuur2 (Mann Kendall Test)Uploaded byVinay Chandwani
- Stevenson Chapter 3 - ForecastingUploaded bySium Adnan Khan 1511153030
- Statistics[1]Uploaded byArmanel R. Libunao

- CSE291D_10aUploaded byballechase
- CSE291D_18Uploaded byballechase
- CSE291D_19Uploaded byballechase
- CSE291D_20Uploaded byballechase
- CSE291D_9Uploaded byballechase
- CSE291D_8Uploaded byballechase
- CSE291D_7Uploaded byballechase
- CSE291D_6Uploaded byballechase
- CSE291D_4Uploaded byballechase
- CSE291D_3Uploaded byballechase
- CSE291D_2.pdfUploaded byballechase
- CSE291D_1.pdfUploaded byballechase
- Revised_FV_2014.pdfUploaded byballechase
- stereotype_threat.pdfUploaded byballechase
- SimonUploaded byballechase
- Peer Instruction Crouch MazurUploaded byphomet
- Icer Final PubUploaded byballechase
- DRAFTCOPY--PIFailRateUploaded byballechase
- How Can Encouragement Increase Persistence in ComputingUploaded byballechase
- howdoyouretainwomenthroughinclusivepedagogy_0Uploaded byballechase
- hw2_pUploaded byballechase
- hw3_pUploaded byballechase
- hw3_pUploaded byballechase
- hw3_sUploaded byballechase
- Practice Apx pUploaded byballechase
- Practice Apx pUploaded byballechase
- rec1Uploaded byballechase
- rec1Uploaded byballechase

- LESSON 7Uploaded bygsaoulias
- Stochastic SimulationsUploaded byLeynard Natividad Marin
- Types of SimulationUploaded byMani Kandan
- Mid Exam Analisis AlgoritmaUploaded bySofy Fitriani
- 205C_oldUploaded bygreenday3
- random variable generationUploaded byapi-285777244
- AdvancedMatlab.pdfUploaded by6doit
- Unit 4 Uncertain Knowledge CompleteUploaded bysssttt1993
- monte-carlo.pptUploaded byadiraju07
- Bayesian Econometric MethodsUploaded byAlex Din
- MonteCarlo+QuasiMC 2010Uploaded byc_mc2
- Andrieu 2003 Intro MCMC Machine LearningUploaded byNicko Matzko
- Bayes Notes2Uploaded byAlecia Suarez
- Lecture _10 -- Part 1Uploaded byAhmad Shdifat
- MonteCarlo.pdfUploaded byNuur Ahmed
- r Lecture 08Uploaded byThrilling Mahedi
- simulationUploaded byWellWisher
- computational statistics with matlabUploaded byTing Luo
- CSE291D_5Uploaded byballechase
- Random Variate GenerationUploaded bykimble9t
- 1.Computational Statistics Using MatlabUploaded byKarthik V Kalyani
- Lecture Week 8Uploaded bysykim657
- Chapter 2 - SimulationUploaded byMuhammed Amin
- TR18-128Uploaded bydasds
- Monte.carlo.methods.(Pengelly.2002)Uploaded byinsightsx

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.