Metropolis- Hastings Algorithm
-
Upload
sybill-stout -
Category
Documents
-
view
102 -
download
4
description
Transcript of Metropolis- Hastings Algorithm
![Page 1: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/1.jpg)
Daphne Koller
Sampling Methods
Metropolis-HastingsAlgorithm
ProbabilisticGraphicalModels
Inference
![Page 2: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/2.jpg)
Daphne Koller
Reversible Chains
Theorem: If detailed balance holds, and T is regular, then T has a unique stationary distribution
Proof:
![Page 3: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/3.jpg)
Daphne Koller
Metropolis Hastings Chain
• At each state x, sample x’ from Q(x x’)• Accept proposal with probability A(x x’)
– If proposal accepted, move to x’– Otherwise stay at x
Proposal distribution Q(x x’)
Acceptance probability: A(x x’)
T(x x’) = Q(x x’) A(x x’)
Q(x x) + x’x Q(x x’) (1-A(x x’))
if x’x
T(x x) =
![Page 4: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/4.jpg)
Daphne Koller
Acceptance Probability
![Page 5: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/5.jpg)
Daphne Koller
Choice of Q
• Q must be reversible:– Q(x x’) > 0 Q(x’ x) > 0
• Opposing forces– Q should try to spread out, to improve mixing– But then acceptance probability often low
![Page 6: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/6.jpg)
Daphne Koller
MCMC for MatchingXi = j if i matched to j
if every Xi has different value
otherwise
![Page 7: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/7.jpg)
Daphne Koller
MH for Matching:Augmenting Path
1) randomly pick one variable Xi
2) sample Xi, pretending that all values are available
3) pick the variable whose assignment was taken (conflict), and return to step 2
• When step 2 creates no conflict, modify assignment to flip augmenting path
![Page 8: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/8.jpg)
Daphne Koller
Example ResultsMH proposal 1 MH proposal 2Gibbs
![Page 9: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/9.jpg)
Daphne Koller
Summary• MH is a general framework for building Markov
chains with a particular stationary distribution– Requires a proposal distribution– Acceptance computed via detailed balance
• Tremendous flexibility in designing proposal distributions that explore the space quickly– But proposal distribution makes a big difference– and finding a good one is not always easy
![Page 10: Metropolis- Hastings Algorithm](https://reader035.fdocuments.in/reader035/viewer/2022081418/56812ce4550346895d91aac5/html5/thumbnails/10.jpg)
Daphne Koller
END END END