# Difference between revisions of "Eleisha's Segment 39: MCMC and Gibbs Sampling"

To Calculate 1. Suppose the domain of a model are the five integers $\displaystyle x = \{1,2,3,4,5\}$ , and that your proposal distribution is: "When $\displaystyle x_1 = 2,3,4$ , choose with equal probability $\displaystyle x_2 = x_1 \pm 1$ . For $\displaystyle x_1=1$ always choose $\displaystyle x_2 =2$ . For $\displaystyle x_1=5$ always choose $\displaystyle x_2 =4$ . What is the ratio of $\displaystyle q$ 's that goes into the acceptance probability $\displaystyle \alpha(x_1,x_2)$ for all the possible values of $\displaystyle x_1$ and $\displaystyle x_2$ ?

2. Suppose the domain of a model is $\displaystyle -\infty < x < \infty$ and your proposal distribution is (perversely),

$\displaystyle q(x_2|x_1) = \begin{cases}\tfrac{7}{2}\exp[-7(x_2-x_1)],\quad & x_2 \ge x_1 \\ \tfrac{5}{2}\exp[-5(x_1-x_2)],\quad & x_2 < x_1 \end{cases}$

Sketch this distribution as a function of $\displaystyle x_2-x_1$ . Then, write down an expression for the ratio of $\displaystyle q$ 's that goes into the acceptance probability $\displaystyle \alpha(x_1,x_2)$ .