Markov Chains and MCMC CompSci 590.04 Instructor: - - PowerPoint PPT Presentation

markov chains and mcmc
SMART_READER_LITE
LIVE PREVIEW

Markov Chains and MCMC CompSci 590.04 Instructor: - - PowerPoint PPT Presentation

Markov Chains and MCMC CompSci 590.04 Instructor: AshwinMachanavajjhala Lecture 5 : 590.04 Fall 15 1 Recap: Monte Carlo Method If U is a


slide-1
SLIDE 1

Markov ¡Chains ¡and ¡MCMC ¡

CompSci ¡590.04 ¡ Instructor: ¡AshwinMachanavajjhala ¡

1 ¡ Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡

slide-2
SLIDE 2

Recap: ¡Monte ¡Carlo ¡Method ¡

  • If ¡U ¡is ¡a ¡universe ¡of ¡items, ¡and ¡G ¡is ¡a ¡subset ¡saEsfying ¡some ¡

property, ¡we ¡want ¡to ¡esEmate ¡|G| ¡

– Either ¡intractable ¡or ¡inefficient ¡to ¡count ¡exactly ¡ ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 2 ¡

For ¡i ¡= ¡1 ¡to ¡N

  • Choose ¡u ¡ε ¡U, ¡uniformly ¡at ¡random
  • Check ¡whether ¡u ¡ε ¡G ¡? ¡
  • Let ¡Xi ¡= ¡1 ¡if ¡u ¡ε ¡G, ¡Xi ¡= ¡0 ¡otherwise

Return Variance: ¡

slide-3
SLIDE 3

Recap: ¡Monte ¡Carlo ¡Method ¡

When ¡is ¡this ¡method ¡an ¡FPRAS? ¡ ¡

  • |U| ¡is ¡known ¡and ¡easy ¡to ¡uniformly ¡sample ¡from ¡U. ¡
  • Easy ¡to ¡check ¡whether ¡sample ¡is ¡in ¡G ¡
  • |U|/|G| ¡is ¡small ¡… ¡(polynomial ¡in ¡the ¡size ¡of ¡the ¡input) ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 3 ¡

slide-4
SLIDE 4

Recap: ¡Importance ¡Sampling ¡

  • In ¡certain ¡case ¡|G| ¡<< ¡|U|, ¡hence ¡the ¡number ¡of ¡samples ¡is ¡not ¡
  • small. ¡ ¡
  • Suppose ¡q(x) ¡is ¡the ¡density ¡of ¡interest, ¡sample ¡from ¡a ¡different ¡

approximate ¡density ¡p(x) ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 4 ¡

¡

slide-5
SLIDE 5

Recap: ¡Metropolis-­‑HasEngs ¡Algorithm ¡

  • Start ¡with ¡any ¡iniEal ¡value ¡x0, ¡such ¡that ¡p(x0) ¡> ¡0 ¡
  • Using ¡current ¡value ¡xt-­‑1, ¡sample ¡a ¡new ¡point ¡according ¡some ¡

proposal ¡distribu-on ¡q(xt ¡| ¡xt-­‑1) ¡

  • Compute ¡
  • With ¡probability ¡α ¡accept ¡the ¡move ¡to ¡xt, ¡ ¡
  • therwise ¡reject ¡xt ¡ ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 5 ¡

slide-6
SLIDE 6

Recap: ¡Why ¡does ¡Metropolis-­‑HasEngs ¡ work? ¡ ¡

  • Metropolis-­‑HasEngs ¡describes ¡a ¡Markov ¡chain ¡with ¡transiEon ¡

probabiliEes: ¡ ¡

  • SaEsfied ¡the ¡detailed ¡balance ¡condiEon ¡with ¡p(x) ¡as ¡the ¡

staEonary ¡distribuEon: ¡ ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 6 ¡

slide-7
SLIDE 7

Today’s ¡Class ¡

¡

  • Variants ¡on ¡MCMC ¡
  • Burn-­‑in ¡and ¡Convergence ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 7 ¡

slide-8
SLIDE 8

Metropolis ¡Algorithm ¡

  • The ¡proposal ¡distribuEon ¡is ¡symmetric ¡
  • TransiEon ¡probability ¡simplifies ¡to: ¡ ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 8 ¡

slide-9
SLIDE 9

Gibbs ¡Sampling ¡

  • Suppose ¡we ¡want ¡to ¡sample ¡a ¡high ¡dimensional ¡point ¡from ¡a ¡

probability ¡distribuEon ¡p(x1, ¡x2, ¡…, ¡xd) ¡ Algorithm: ¡

  • IniEalize ¡starEng ¡value ¡X0 ¡= ¡ ¡x1, ¡x2, ¡…, ¡xd ¡
  • Pick ¡some ¡ordering ¡of ¡the ¡variables ¡(say ¡1..d) ¡
  • ¡i ¡= ¡1 ¡
  • Do ¡unEl ¡convergence: ¡ ¡

– Sample ¡x ¡from ¡p(xi ¡| ¡x1, ¡x2, ¡.., ¡xi-­‑1, ¡xi+1, ¡.., ¡xd) ¡ – Set ¡xi ¡= ¡x ¡ – i ¡= ¡i ¡+ ¡1 ¡mod ¡d ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 9 ¡

slide-10
SLIDE 10

Gibbs ¡Sampling ¡is ¡a ¡special ¡case ¡of ¡MCMC ¡

  • Sampling ¡from ¡condiEonal ¡is ¡precisely ¡the ¡transiEon ¡probability ¡
  • Accept ¡move ¡with ¡probability ¡1 ¡ ¡

¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 10 ¡

slide-11
SLIDE 11

Today’s ¡Class ¡

¡

  • Variants ¡on ¡MCMC ¡
  • Burn-­‑in ¡and ¡Convergence ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 11 ¡

slide-12
SLIDE 12

Burn-­‑in ¡& ¡Convergence ¡

  • MCMC ¡eventually ¡converges ¡to ¡the ¡staEonary ¡distribuEon ¡
  • Period ¡Ell ¡it ¡reaches ¡converges ¡is ¡burn-­‑in ¡

– Those ¡samples ¡are ¡discarded. ¡ ¡

  • EsEmaEng ¡convergence ¡

– Run ¡mulEple ¡chains ¡in ¡parallel ¡and ¡check ¡whether ¡their ¡distribuEons ¡are ¡

  • similar. ¡

Lecture ¡5 ¡: ¡590.04 ¡Fall ¡15 ¡ 12 ¡