importance sampling & markov chain monte carlo (mcmc)nando/540-2013/lectures/l14.pdf ·...

33
CPSC540 Nando de Freitas March, 2013 University of British Columbia Importance sampling & Markov chain Monte Carlo (MCMC)

Upload: others

Post on 10-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

CPSC540

Nando de FreitasMarch, 2013University of British Columbia

Importance sampling &

Markov chain Monte Carlo (MCMC)

Page 2: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Outline of the lecture

This is about Monte Carlo methods.

� We will revise importance sampling.� Revise how Google works (Markov chains).� Introduce Markov chain Monte Carlo (MCMC)

Page 3: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Bayesian logistic regressionThe logistic regression model specifies the probability of a binary outputyi ∈ {0, 1} given the input xi as follows:

p(y|X, θ) =

n∏

i=1

Ber(yi|sigm(xiθ))

=n∏

i=1

[1

1 + e−xiθ

]yi [1−

1

1 + e−xiθ

]1−yi∏

i=1

[

] [

]

Page 4: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Importance sampling

Page 5: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Importance sampling

Page 6: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about
Page 7: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Importance sampling

Page 8: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Example: Logistic Regression

Page 9: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Un-normalized importance sampling

Page 10: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 11: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 12: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 13: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 14: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 15: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 16: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 17: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Markov Chain Monte Carlo

Page 18: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Metropolis-Hastings for logistic regression

Page 19: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

MCMC: Metropolis-Hastings

Page 20: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

MCMC: Metropolis-Hastings

Page 21: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

MCMC: Choosing the Right Proposal

Page 22: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

MCMC: Theory

Page 23: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

MCMC: Theory

Page 24: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Variations of Metropolis-Hastings

Page 25: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Extending MH to directed probabilistic graphical models

MINVOLSET

PCWP CO

HRBP

HREKG HRSAT

ERRCAUTERHRHISTORY

CATECHOL

SAO2 EXPCO2

ARTCO2

VENTALV

VENTLUNG VENITUBE

DISCONNECTVENTMACHKINKEDTUBEINTUBATIONPULMEMBOLUS

PAP SHUNT

ANAPHYLAXIS

MINOVL

PVSAT

FIO2PRESS

INSUFFANESTHTPR

LVFAILURE

ERRBLOWOUTPUTSTROEVOLUMELVEDVOLUME

HYPOVOLEMIA

CVP

BP

Page 26: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Bayesian graphical models and Gibbs

Page 27: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Gibbs Sampling

Page 28: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Gibbs Sampling

Page 29: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Gibbs Sampling For Graphical models

Page 30: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Auxiliary Variable Samplers

Page 31: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Hybrid (Hamiltonian) Monte Carlo

Page 32: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Hybrid Monte Carlo

Page 33: Importance sampling & Markov chain Monte Carlo (MCMC)nando/540-2013/lectures/l14.pdf · University of British Columbia Importance sampling & ... Outline of the lecture This is about

Next lecture

In the next lecture, we look at constrained optimization and sparse methods in learning.