Q4. Gibbs sampling from full conditionals

Let X\in\{0,1,\ldots,10\} and 0<\theta<1 have joint density/mass function \pi(x,\theta) \propto \binom{10}{x}\theta^{x+1}(1-\theta)^{12-x}.

(a) [2 marks] Find and identify the conditional distribution of X\mid\theta.

(b) [2 marks] Find and identify the conditional distribution of \theta\mid X=x.

(c) [3 marks] Hence write pseudocode for a Gibbs sampler that generates a Markov chain with equilibrium distribution \pi(x,\theta). Begin from an arbitrary valid starting value (x^{(0)},\theta^{(0)}).

(d) [2 marks] Explain why there is no accept-reject step in this Gibbs sampler.

(e) [1 mark] Are the resulting pairs \bigl(X^{(1)},\theta^{(1)}\bigr), \bigl(X^{(2)},\theta^{(2)}\bigr),\ldots independent? Briefly explain.

Definitions. A full conditional is obtained by normalising the joint in the variable being updated; the other variable is fixed. The relevant kernels are \operatorname{Bin}(n,p):\ \binom nx p^x(1-p)^{n-x},\quad x=0,\ldots,n, \operatorname{Beta}(a,b):\ u^{a-1}(1-u)^{b-1},\quad 0<u<1,\quad a,b>0. Here n=10; superscript (t) denotes a completed Gibbs iteration.

(a) Conditional distribution of X\mid\theta

Holding \theta fixed and retaining the terms that depend on x, \begin{aligned} \pi(x\mid\theta) &\propto \binom{10}{x}\theta^{x+1}(1-\theta)^{12-x}\\ &=\theta(1-\theta)^2 \binom{10}{x}\theta^x(1-\theta)^{10-x}\\ &\propto \binom{10}{x}\theta^x(1-\theta)^{10-x}. \end{aligned} The discarded factor \theta(1-\theta)^2 is constant with respect to x. Therefore, \boxed{X\mid\theta\sim\operatorname{Bin}(10,\theta)}.

(b) Conditional distribution of \theta\mid X=x

Holding x fixed, \pi(\theta\mid x) \propto \theta^{x+1}(1-\theta)^{12-x}, \qquad 0<\theta<1. The kernel of a \operatorname{Beta}(\alpha,\beta) distribution is \theta^{\alpha-1}(1-\theta)^{\beta-1}. Matching powers gives \alpha=x+2, \qquad \beta=13-x. Hence, \boxed{ \theta\mid X=x \sim\operatorname{Beta}(x+2,13-x) }.

(c) Gibbs-sampler pseudocode

Choose any valid starting values x^{(0)}\in\{0,1,\ldots,10\}, \qquad \theta^{(0)}\in(0,1). For t=1,2,\ldots,T:

1. Generate X^{(t)} \sim\operatorname{Bin}\bigl(10,\theta^{(t-1)}\bigr).

2. Using the newly generated X^{(t)}, generate \theta^{(t)} \sim\operatorname{Beta}\bigl(X^{(t)}+2,13-X^{(t)}\bigr).

3. Store \bigl(X^{(t)},\theta^{(t)}\bigr).

After a suitable burn-in, the stored states have approximately the target equilibrium distribution \pi(x,\theta).

(d) Why there is no accept-reject step

Each update is sampled directly from its exact full conditional distribution. The generated value therefore already has the required conditional distribution and is always accepted. Equivalently, Gibbs sampling is a special case of Metropolis-Hastings whose acceptance probability is 1.

(e) Independence of the sampled pairs

No. The update X^{(t)} depends on \theta^{(t-1)}, and \theta^{(t)} then depends on X^{(t)}. Successive states therefore form a Markov chain and are generally serially dependent. Once the chain is in equilibrium, each individual state has marginal distribution \pi(x,\theta), but this does not make the states independent.

Key result. The two full conditionals are \boxed{ X\mid\theta\sim\operatorname{Bin}(10,\theta), \qquad \theta\mid X=x\sim\operatorname{Beta}(x+2,13-x) }. At each iteration, sample from these in order using the newest available value. Exact full-conditional draws require no rejection, but successive Gibbs states are not independent.