gibbs sampling qianji zheng oct. 5 th, 2010. outline motivation & basic idea algorithm ...

13
Gibbs Sampling Qianji Zheng Oct. 5 th , 2010

Upload: silvester-hudson

Post on 15-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Gibbs Sampling

Qianji Zheng

Oct. 5th, 2010

Page 2: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Outline

Motivation & Basic Idea

Algorithm

Example

Applications

Why Gibbs Works

Page 3: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Gibbs Sampling: Motivation

Gibbs sampling is a particular form of Markov chain Monte Carlo (MCMC) algorithm for approximating joint and marginal distribution by sampling from conditional distributions.

Page 4: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Gibbs Sampling: Basic Idea

If the joint distribution is not known explicitly or is difficult to sample from directly, but the conditional distribution is known or easy to sample from. Even if the joint distribution is known, the computational burden needed to calculate it may be huge.

Gibbs Sampling algorithm could generate a sequence of samples from conditional individual distributions, which constitutes a Markov chain, to approximate the joint distribution.

Page 5: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Characteristics of Gibbs Sampling Algorithm

A particular Markov Chain Monte Carlo (MCMC) algorithm

Sample from conditional distribution while other parameters are fixed

Update a single parameter at a time

Page 6: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Gibbs Sampling Algorithm

Let be the conditional distribution of the element given all the other parameters minus the , then Gibbs Sampling for an m-component variable is given by the transition from to generated as:

)|( )(),...,1(),1(),...,1()()( mjjjj xxxxXf

thj

thj

),...,( )()1(tm

tt xxX 1tX

),...,,(f~.2

),...,(f~.1

)()3(1)1(

1)2((2)

1)2(

)()2(1

)1((1)1

)1(

tm

tttt

tm

ttt

xxxXX

xxXX

),...,,(f~. 1)1(

1)2(

1)1(

1)((m)

1)(

tm

tttm

tm xxxXXm

Given an arbitrary initial value ).x,...,x,(xX 0m

02

01

0

Page 7: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Gibbs Sampling Algorithm Contd…

1. Steps 1 through m can be iterated J times to get

, j = 1, 2, … , J.

2. The joint and marginal distributions of generated

converge at an exponential rate to joint

and marginal distribution of , as .

3. Then the joint and marginal distributions of

can be approximated by the empirical distributions of M

simulated values (j=L+1,…, L+M).

4. The mean of the marginal distribution of may be approximated by

),...,,( 21j

mjj XXX

),...,,( 21j

mjj XXX

),...,,( 21 mXXX

),...,,( 21 mXXX

J

),...,,( 21 mXXX

iX

M

XM

j

jLi

1

Page 8: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Gibbs Sampling Algorithm In BN

Page 9: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Example

Page 10: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Example

Example refer to

Gibbs Sampling for Approximate Inference in Bayesian Networks

http://www-users.cselabs.umn.edu/classes/Spring-2010/csci5512/notes/gibbs.pdf

Page 11: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Gibbs Sampling: Applications

Gibbs Sampling algorithm has been widely used on a broad class of areas, e.g. , Bayesian networks,

statistical inference, bioinformatics, econometrics.

The power of Gibbs Sampling is:

1. Approximate joint and marginal distribution

2. Estimate unknown parameters

3. Compute an integral (e.g. mean, median, etc)

Page 12: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Why Gibbs Works

The Gibbs sampling can simulate the target distribution by constructing a Gibbs sequence which converges to a stationary distribution that is independent of the starting value.

The stationary distribution is the target distribution.

Page 13: Gibbs Sampling Qianji Zheng Oct. 5 th, 2010. Outline  Motivation & Basic Idea  Algorithm  Example  Applications  Why Gibbs Works

Online Resources

Gibbs Sampling for Approximate Inference in Bayesian Networks

http://www-users.cselabs.umn.edu/classes/Spring-2010/csci5512/notes/gibbs.pdf

Markov Chain Monte Carlo and Gibbs Sampling

http://membres-timc.imag.fr/Olivier.Francois/mcmc_gibbs_sampling.pdf

Markov Chains, the Gibbs Sampler and Data Augmentation

http://athens.src.uchicago.edu/jenni/econ350/Salvador/h4.pdf

Reference

Kim, C. J. and Nelson, C. R. (1999), State-Space Models with Regime Switching, Cambridge, Massachusetts: MIT Press.