Markov Chain Monte Carlo Gibbs Sampler
Recall: To compute the expectation h(Y ) we use the approximation Let Y = (Y1, . . . , Yd) be d dimensional with d 2 and distribution f(y).
n 1 ¡ ¢ (h(Y )) h(Y (t)) with Y (1), . . . , Y (n) h(y). The full conditional distribution of Yi is given by n t=1 f(y , . . . , y , y , y , . . . , y ) P 1 i 1 i i+1 d (1) (n) f(yi|y1, . . . , yi 1, yi+1, . . . , yd) = Thus our aim is to sample Y , . . . , Y from f(y). f(y1, . . . , yi 1, yi, yi+1, . . . , yd) dyi Problem: Independent sampling from f(y) may be di cult. R Gibbs sampling Markov chain Monte Carlo (MCMC) approach Sample or update in turn: Generate Markov chain {Y (t)} with stationary distribution f(y). Y (t+1) f(y |Y (t), Y (t), . . . , Y (t)) Early iterations Y (1), . . . , Y (m) re ect starting value Y (0). 1 1 2 3 d (t+1) (t+1) (t) (t) Y f(y2|Y , Y , . . . , Y ) These iterations are called burn-in. 2 1 3 d (t+1) (t+1) (t+1) (t) (t) Y3 f(y3|Y1 , Y2 , Y4 , . . . , Yd ) After the burn-in, we say the chain has “converged”...... Omit the burn-in from averages: (t+1) (t+1) (t+1) (t+1) Y f(yd|Y , Y , . . . , Y ) 1 n d 1 2 d 1 h(Y (t)) n m t=m+1 Always use most recent values. P 2 Burn−in Stationarity In two dimensions, the sample path of the Gibbs sampler looks like this:
1 0.30
) t=1 t ( 0 Y t=2
−1 0.25 t=4 −2 0 100 200 300 400 500 600 700 800 900 1000 Iteration t=3 0.20 ) t ( 2 Y
(t) 0.15 t=7 How do we construct a Markov chain {Y } which has stationary distri- t=6 bution f(y)? t=5 0.10