Markov Random Fields and Sampling Techniques: Monte Carlo Markov Chains and Gibbs Sampling, Assignments of Computer Science

Various methods for sampling from distributions, focusing on markov random fields (mrfs) and techniques such as monte carlo markov chains (mcmc) and gibbs sampling. The concepts of generating samples from uniform distributions, rejection methods, and mcmc algorithms for generating samples from complex probability distributions. Gibbs sampling is introduced as a method for updating one parameter at a time in mrfs, and the document also touches on the concept of gibbs potential and its use in simplifying high-dimensional conditional distributions.

Typology: Assignments

Pre 2010

Uploaded on 07/23/2009

koofers-user-021
koofers-user-021 🇺🇸

10 documents

1 / 30

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Joe Kniss
CS 530
Probabilistic and Geometric Methods
Markov Random Fields
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e

Partial preview of the text

Download Markov Random Fields and Sampling Techniques: Monte Carlo Markov Chains and Gibbs Sampling and more Assignments Computer Science in PDF only on Docsity!

Joe Kniss

CS 530

Probabilistic and Geometric Methods Markov Random Fields

Sampling from a distribution

  • Problem 8 on homework:
    • Generate N samples from a distribution.
      1. Generate N samples from Uniform Dist.
      1. Map through inv CDF of desired dist.

Other ways to Sample

  • Discrete PMFs:
    • Make sure # of samples for each bin matches PMF, then shuffle
  • Continuous PDFs?

Rejection Method

    1. determine max prob/density d
    1. determine min-max domain m,M
    1. Draw sample from Uniform: x
    1. Scale & Bias x to [ m,M ]
    1. Draw sample from Uniform: t
    1. Scale t by d: t=t*d
    1. Keep x if t>p(x)

MCMC Example

  • Generate N samples from:

P ( x " [ 0 : 255]) = e # x^^2 /1000^ / $ i^255 = 0 e # i^2 /

MCMC

  • Choose an initial xt
    • According to some “candidate” dist
  • Choose “next” xt+
    • xt jumps to xt+1 according to:

xt + 1 =

xt + 1 P ( xt + 1 ) > P ( xt ) xt + 1 P ( xt + 1 ) / P ( xt ) > rand() Draw new xt + 1 & start over

#^ $

%^ $

MCMC

  • Samples form a markov chain
  • We are sampling this conditional
    • But we never need the inv CDF!
    • Does P(x) need to be “normalized”?
    • Works for complicated PMFs and PDFs

P (xt + 1 | xt ) " min( P ( xt + 1 ) / P ( xt ), 1 )

MCMC

  • What about the multidimensional case?
    • Not so easy to come up with inv CDF!

Gibbs Sampling

  • Conditional distribution:
  • Update each xi independently
  • This is a 1D PMF
  • Maybe you can go back to inv CDF! …

P ( x i^ t^ | x^ ( jt "# i 1))

Convergence, Stopping Criteria

  • The first many samples may not be a good sampling of distribution.
  • For complicated PMFs/PDFs may take some time to “settle down”

Markov Random Fields

  • Remember joint to conditional:

s !

t 1

!

t 2

!

t 3

t 4

!

t 5 t 6 t 7 t 8

P ( xs | xt , t " Ns )

= P P ( x ( sx ,^ tx , tt^ , t "^ " N^ Ns ) s )

Markov Random Fields

  • It can be difficult to manage high- dimensional joint/conditional distributions

s !

t 1

!

t 2

!

t 3

t 4

!

t 5 ! t 6 t 7 t 8

P ( xs | xt 1 , xt 2 , xt 3 , xt 4 , xt 5 , xt 6 , xt 7 , xt 8 )

Gibbs Sampler for MRFs

  • Made easy if we apply the Gibbs method: - Update one site at a time - Pick one site (s) at random - Draw new xs from conditional - … and repeat, repeat, repeat !

P ( xs | xt , t " Ns )

Gibbs Potential

  • Still difficult to deal with conditional:
  • Gibbs potential
    • Compose conditional using “easier” functions ! – Operate on subsets of neighborhood

P ( xs | xt 1 , xt 2 , xt 3 , xt 4 , xt 5 , xt 6 , xt 7 , xt 8 )