Gibbs Sampler

mcmcbayesiangibbs-samplerconvergence-diagnosticsvarauxiliary-variablenon-conjugatelatent-variable

Definition

The Gibbs sampler is a Markov Chain Monte Carlo (MCMC) algorithm that generates samples from a high-dimensional joint posterior p(θ1,,θnY)p(\theta_1, \ldots, \theta_n \mid Y) by iteratively drawing each block θi\theta_i from its full conditional p(θiθi,Y)p(\theta_i \mid \theta_{-i}, Y), cycling until the chain converges to the target distribution.

Key Ideas

How It Works

The Gibbs Sampling Algorithm

Given a joint density f(x1,,xn)f(x_1, \ldots, x_n) with known full conditional densities f(xixi)f(x_i \mid x_{-i}):

  1. Initialize x(0)=(x1(0),,xn(0))x^{(0)} = (x_1^{(0)}, \ldots, x_n^{(0)}) arbitrarily.
  2. At iteration jj, draw sequentially: x1(j)f(x1x2(j1),,xn(j1))x_1^{(j)} \sim f(x_1 \mid x_2^{(j-1)}, \ldots, x_n^{(j-1)}) x2(j)f(x2x1(j),x3(j1),,xn(j1))x_2^{(j)} \sim f(x_2 \mid x_1^{(j)}, x_3^{(j-1)}, \ldots, x_n^{(j-1)}) \vdots xn(j)f(xnx1(j),,xn1(j))x_n^{(j)} \sim f(x_n \mid x_1^{(j)}, \ldots, x_{n-1}^{(j)})
  3. Repeat for j=1,,kj = 1, \ldots, k. Discard a burn-in period; use {x(j)}\{x^{(j)}\} as approximate draws from f(x)f(x).

The resulting sequence is a Markov chain whose equilibrium distribution is f(x)f(x) under mild regularity conditions (Geman and Geman 1984; Tierney 1994).

Why the Gibbs Sampler Works: Markov Chain Foundation (Casella-George 1992)

That the Gibbs sequence converges to the target marginal is a consequence of Markov chain theory (Casella and George 1992). In the discrete 2-variable case, define:

The XX-only subsequence X0,X1,X_0, X_1, \ldots is a Markov chain with transition matrix: Axx=AxyAyxA_{xx} = A_{xy} \cdot A_{yx}

Provided all entries of AxxA_{xx} are positive (irreducibility), the chain converges to a unique stationary distribution f\mathbf{f} satisfying fAxx=f\mathbf{f}\,A_{xx} = \mathbf{f}. One verifies directly that this f\mathbf{f} is the marginal distribution of XX — the iteration has nowhere else to go. In the continuous case, the same argument extends via the integral analogue (their eq. 3.5).

Conditionals determine marginals. If the joint f(x,y)f(x,y) exists, then fX(x)f_X(x) satisfies the fixed-point integral equation: fX(x)=h(x,t)fX(t)dt,h(x,t)=f(xy)f(yt)dy(FP)f_X(x) = \int h(x,t)\, f_X(t)\, dt, \qquad h(x,t) = \int f(x|y)\, f(y|t)\, dy \tag{FP} The Gibbs iteration is the computational device for solving (FP).

Failure mode 1: improper marginals. When f(xy)f(x|y) and f(yx)f(y|x) do not correspond to any proper joint density, the Gibbs sequence fails to converge. Canonical example: f(xy)=yexyf(x|y) = ye^{-xy}, f(yx)=xexyf(y|x) = xe^{-xy} on (0,)2(0,\infty)^2. Equation (FP) yields fX(x)=1/xf_X(x) = 1/x, which is not a density. The sufficient condition for convergence is that fXf_X is proper (fXdx<\int f_X\,dx < \infty); restricting the conditionals to a compact interval guarantees this. Formal conditions are analyzed by Hobert and Casella (1996).

Failure mode 2: proper conditionals, improper joint (Besag, Scollnik). A subtler failure: a set of proper full conditional distributions need not define a proper joint. Example (Gelfand 1994, cited by Scollnik): f(x1,x2)exp((x1+x2)2/2)f(x_1, x_2) \propto \exp(-(x_1+x_2)^2/2) on R2\mathbb{R}^2 gives two valid univariate Normal conditionals — f(x1x2)=N(x2,1)f(x_1|x_2) = \mathcal{N}(-x_2,1) and f(x2x1)=N(x1,1)f(x_2|x_1) = \mathcal{N}(-x_1,1) — but the joint is improper. Running Gibbs on these conditionals will either fail to converge or converge to a state without a valid probabilistic interpretation. The Besag (1974) result guarantees uniqueness only when the joint distribution is known to be proper; it does not certify existence from conditionals alone.

Gibbs Samplers in VAR Models

The Gibbs sampler appears in several distinct vector autoregression (VAR) contexts, each exploiting different closed-form conditional structures:

Waggoner-Zha (2000, 2003b) — Structural VAR. Partitions structural parameters into equation-by-equation blocks (bi,gi)(b_i, g_i): the lag-coefficient block gig_i has a Gaussian conditional; the contemporaneous block bib_i has a conditional that decomposes into a Univariate Wishart (UW) draw and Normal draws via an orthonormal basis (LU decomposition). See Structural Identification and the detailed derivation below.

Villani (2008) — Steady state VAR. Three-block sampler over (Σ,Π,Ψ)(\Sigma, \Pi, \Psi) where all full conditionals are Inverse-Wishart or Normal. The Ψ\Psi block update stabilizes the sampler near unit roots. See Steady State VAR.

Bauwens-Giot (1997) — Cointegrated VAR. Full conditionals for the cointegrating vector elements have no closed form; the Griddy-Gibbs algorithm is used (see below). See Cointegration.

Albert-Chib (1993) — Markov-switching AR. Data augmentation: the latent state sequence STS_T is added as a Gibbs block, converting Hamilton's 2^T mixture likelihood into tractable conditionals. States drawn by a single backward binary pass; regression and variance blocks are truncated Normal and Inverse-Gamma; transition probabilities are Beta. Identified by γ>0\gamma > 0, ω>0\omega > 0. Foundational univariate Bayesian precursor to the MS-VAR literature. See Markov-Switching VAR.

Chib (1996) — Joint state sampling for Markov mixture models. Replaces the nn-block single-move sampler of Albert-Chib (1993) with a joint draw of the full state sequence Sn=(s1,,sn)S_n = (s_1, \ldots, s_n) in one Gibbs block. Forward pass: compute n×mn \times m filter matrix FF via Ft(Ft1P)dtF_t \propto (F_{t-1}P) \odot d_t (dtd_t = row of component densities at tt; \odot element-wise). Backward pass: draw sns_n from last row of FF; for t=n1,,1t = n-1, \ldots, 1 draw stp(stYt,θ)Pst,st+1s_t \propto p(s_t|Y_t,\theta) \cdot P_{s_t,s_{t+1}} (eq. 7). Transition matrix PP: Dirichlet conjugate from counts nijn_{ij} (eq. 10). Discrete-state counterpart of the Carter-Kohn (1994) simulation smoother; became the standard for Bayesian Markov-switching estimation. See Markov-Switching VAR and Chib (1996).

Albert-Chib (1993b) — Binary and polychotomous probit. Data augmentation for binary regression: introduce latent ZiN(xiβ,1)Z_i \sim \mathcal{N}(x_i'\beta, 1) with Yi=1[Zi>0]Y_i = \mathbf{1}[Z_i > 0]. Two-block Gibbs: βZNk((XX)1XZ,(XX)1)\beta|Z \sim \mathcal{N}_k((X'X)^{-1}X'Z,\,(X'X)^{-1}) (eq. 5) and Ziyi,βZ_i|y_i,\beta truncated Normal at 0 (eq. 6). Extensions: t-link via four-block scale-mixture sampler (eqs. 7–11), hierarchical shrinkage prior (eqs. 13–14), ordered multinomial with uniform threshold block (eqs. 16–18), unordered multinomial probit via accept-reject multivariate truncated Normal (eqs. 19–21). See Binary Probit.

Chib-Greenberg (1998) — Multivariate probit for correlated binary data. The JJ-variate response Yi=(Yi1,,YiJ)Y_i=(Y_{i1},\ldots,Y_{iJ})' with ZiNJ(Xiβ,Σ)Z_i \sim N_J(X_i\beta,\Sigma) and Yij=I(zij>0)Y_{ij}=I(z_{ij}>0); Σ\Sigma must be in correlation form (unit diagonal) for identifiability — p=J(J1)/2p=J(J-1)/2 free off-diagonal elements σ\sigma. Three-block Gibbs: (1) Ziyi,β,ΣZ_i|y_i,\beta,\Sigma — MVN truncated to BiB_i (product of half-lines from yiy_i), sampled by cycling through JJ univariate truncated normals (Geweke 1991); (2) βZ,Σ\beta|Z,\Sigma — conjugate Normal (eq. 6): β^=B1(B0β0+XiΣ1Zi)\hat\beta=B^{-1}(B_0\beta_0+\sum X_i'\Sigma^{-1}Z_i); (3) σy,Z,β\sigma|y,Z,\beta — Metropolis-Hastings (M-H) with tailored independence/reflection chain (eq. 7): proposal mode from Newton-Raphson on logg(σZ,β)\log g(\sigma|Z,\beta), covariance from negative inverse Hessian; for high-dimensional σ\sigma, partition into blocks applied sequentially. Likelihood evaluation via the GHK (Geweke-Hajivassiliou-Keane) method (Cholesky Σ=LL\Sigma=LL', change of variables, recursive truncated-normal draws, eq. 11). Posterior ordinate π^(σy)\hat\pi(\sigma^*|y) via kernel density (eq. 10) — this is the precursor approach that Chib-Jeliazkov (2001) superseded with the two-expectation M-H identity. See Chib-Greenberg (1998), Binary Probit, and Multinomial Probit.

Kadiyala-Karlsson (1997) — Normal-Diffuse and Extended Natural Conjugate (ENC) Bayesian VAR (BVAR). Two new Gibbs samplers derived for the Normal-Diffuse (2-block) and ENC (equation-by-equation) posteriors; compared against importance sampling across 3- and 7-variable models. Gibbs achieves relative numerical efficiency (RNE) ≈ 1 at all model sizes; importance sampling collapses for the 7-variable model. See Noninformative Prior for VAR and Vector Autoregression.

Gibbs Simulator for Restricted Structural VARs (Waggoner-Zha 2000)

Write the structural VAR as ytA=xtF+εty_t' A = x_t' F + \varepsilon_t'. Linear zero restrictions take the form Qiai=0Q_i a_i = 0 on contemporaneous coefficients and Rifi=0R_i f_i = 0 on lag coefficients, where aia_i and fif_i are the iith columns of AA and FF. The free parameters are ai=Uibia_i = U_i b_i and fi=Vigif_i = V_i g_i, where UiRn×kiU_i \in \mathbb{R}^{n \times k_i} and ViV_i are orthonormal bases for the null spaces of QiQ_i and RiR_i.

Joint posterior (Theorem 1). Under the Sims-Zha (1998) reference prior, the joint posterior factorizes as p(b1,,bn)×ip(gibi)p(b_1,\ldots,b_n) \times \prod_i p(g_i | b_i) where:

p(b1,,bn)det[U1b1Unbn]Texp ⁣(T2ibiSi1bi)p(b_1,\ldots,b_n) \propto \left|\det[U_1 b_1 \mid \cdots \mid U_n b_n]\right|^T \exp\!\left(-\frac{T}{2}\sum_i b_i' S_i^{-1} b_i\right)

The determinant factor renders the joint distribution non-Gaussian — it lies on a curved ridge in parameter space. Importance sampling with a Gaussian proposal concentrates almost all weight on a single draw (Figure 3b: single spike), making it useless for simultaneous-equations models.

Theorem 2 (Gibbs step for bib_i). Conditional on all other equations, bi=j=1kiβjwjb_i = \sum_{j=1}^{k_i} \beta_j w_j where {wj}\{w_j\} is an orthonormal basis in Rki\mathbb{R}^{k_i} computed at each step via LU decomposition of the current draw of the other equations' free parameters. The scalar coefficients distribute as:

β1UW[T1,ki+1],βjN(0,T1)(j2)\beta_1 \sim \text{UW}[T^{-1},\, k_i + 1], \qquad \beta_j \sim \mathcal{N}(0,\, T^{-1}) \quad (j \geq 2)

Univariate Wishart (UW) distribution. The density is:

f(x)x(k1)/2exp ⁣(T2x),x>0f(x) \propto x^{(k-1)/2} \exp\!\left(-\frac{T}{2} x\right), \quad x > 0

A draw is obtained as x=z2x = z^2 where zN(0,T1)z \sim \mathcal{N}(0, T^{-1}) — a one-line computation.

Lag-coefficient block. Conditional on the current bib_i, the free lag parameters gig_i have a Gaussian conditional — standard ordinary least squares (OLS) on the restricted system — and are drawn directly.

Theorem 3 / Corollary 1 (Independence conditions). The Gibbs draws across equations are exactly independent iff there exist a permutation matrix Γ\Gamma and orthogonal matrix Π\Pi such that ΓAΠ\Gamma A \Pi is upper triangular for all admissible AA. Block-recursive exclusion restrictions are sufficient: if the contemporaneous matrix AA is block-lower-triangular after permutation, all cross-block draws are independent. In this case there is no need to run long chains — effective sample size equals the number of draws.

Convergence validation. Applied to Sims's (1986) 6-variable VAR (RR, M1M1, YY, PP, UU, IDID; 1948:1–1989:3; 20 free structural parameters in AA). Five chains started from overdispersed initial draws; Gelman-Rubin R^1.00\hat{R} \to 1.00 for all parameters within ~500 sweeps. The monetary-policy and interest-rate-defense equations satisfy Corollary 1 and yield exactly independent draws.

Normal-Diffuse and ENC Gibbs for BVAR (Kadiyala-Karlsson 1997)

Normal-Diffuse 2-Block Gibbs

The prior γN(γ~,Σ~)\gamma \sim N(\tilde\gamma, \tilde\Sigma), p(Ψ)Ψ(q+1)/2p(\Psi) \propto |\Psi|^{-(q+1)/2} yields two closed-form full conditionals, enabling direct Gibbs sampling without importance functions:

Block 1 — γΨ,Y\gamma \mid \Psi, Y: Normal with precision Σ~1+Ψ1ZZ\tilde\Sigma^{-1} + \Psi^{-1} \otimes Z'Z: γΨ,YN ⁣(γˉ,  (Σ~1+Ψ1ZZ)1)\gamma|\Psi, Y \sim N\!\left(\bar\gamma,\; (\tilde\Sigma^{-1} + \Psi^{-1} \otimes Z'Z)^{-1}\right) γˉ=(Σ~1+Ψ1ZZ)1 ⁣(Σ~1γ~+(Ψ1Z)y),y=vec(Y)\bar\gamma = (\tilde\Sigma^{-1} + \Psi^{-1} \otimes Z'Z)^{-1}\!\left(\tilde\Sigma^{-1}\tilde\gamma + (\Psi^{-1} \otimes Z')y\right), \quad y = \text{vec}(Y)

Block 2 — Ψ1γ,Y\Psi^{-1} \mid \gamma, Y: Wishart with scale S(Φ)1S(\Phi)^{-1} and TT degrees of freedom: Ψ1γ,YW ⁣(S(Φ)1,  T),S(Φ)=(YZΦ)(YZΦ)\Psi^{-1}|\gamma, Y \sim W\!\left(S(\Phi)^{-1},\; T\right), \quad S(\Phi) = (Y - Z\Phi)'(Y - Z\Phi)

Both blocks are standard random-variate draws. The dominant cost is the Cholesky decomposition of the mk×mkmk \times mk precision matrix in Block 1: O((mk)3)O((mk)^3) per Gibbs step.

ENC Equation-by-Equation Gibbs

Under the Drèze-Morales (1976) ENC reparametrization (see Noninformative Prior for VAR), there is no standard-form block decomposition for the full posterior. However, each equation's full conditional γiγi,Y\gamma_i|\gamma_{\neq i}, Y is a multivariate tt by Drèze-Richard (1983) Lemma 6.4: γiγi,Ytk ⁣(di,  qiiT+αkPii1,  T+αk)\gamma_i | \gamma_{\neq i}, Y \sim t_k\!\left(\mathbf{d}_i,\; \frac{q_{ii}}{T+\alpha-k}\,\mathbf{P}_{ii}^{-1},\; T+\alpha-k\right) where di\mathbf{d}_i, qiiq_{ii}, Pii\mathbf{P}_{ii} are equation-specific quantities derived from the ENC reparametrization and the current draw of all other equations. One full cycle iterates over all mm equations at cost O(m(mk)2)O(m(mk)^2) — more efficient than the Normal-Diffuse 2-block sampler when mm and kk are both large.

Relative Numerical Efficiency and Importance Sampling Collapse

The relative numerical efficiency of method MM is: RNE(M)=Varp[g(θ)]σg,M2\text{RNE}(M) = \frac{\text{Var}_p[g(\theta)]}{\sigma^2_{g,M}} It equals the fraction of direct i.i.d. draws that would achieve the same estimator variance. Gibbs sampling achieves RNE ≈ 1 at all model sizes. Importance sampling achieves moderate RNE for small models (3 variables) but collapses to RNE ≈ 0 for the 7-variable model because condition (15) — requiring Tmk0T - mk \geq 0 so that the IS normalizing constant is numerically stable — fails severely (Tmk159T - mk \approx -159 in the reported experiment).

Antithetic variates (GAIN): Drawing z(i)=z(i)z^{*(i)} = -z^{(i)} (sign-flipped Normal variate through the posterior mode) reduces IS variance: GAIN=Var(gˉ2n)Var(gˉa,n)=11+ρ,ρ=Corr ⁣(g(θ(i)),g(θ(i)))\text{GAIN} = \frac{\text{Var}(\bar g_{2n})}{\text{Var}(\bar g_{a,n})} = \frac{1}{1+\rho}, \quad \rho = \text{Corr}\!\left(g(\theta^{(i)}),\, g(\theta^{*(i)})\right) For near-symmetric posteriors ρ1\rho \approx -1 and GAIN1\text{GAIN} \gg 1. Draws are obtained from the antithetic 2-0 poly-tt importance function via the Bauwens-Richard (1982) decomposition. See also Geweke (1988) for the general principle.

CPU scaling across methods:

Method Cost per draw/step 7-var / 3-var overhead
Normal-Wishart / Diffuse O(mk)O(mk) 4×{\approx}4\times
STFC importance function O((mk)3/2)O((mk)^{3/2}) 8×{\approx}8\times
ENC equation-by-equation Gibbs O(m(mk)2)O(m(mk)^2) 30×{\approx}30\times
Normal-Diffuse 2-block Gibbs O((mk)3)O((mk)^3) 140×{\approx}140\times

Full comparative experiment required >200 CPU hours (1997 hardware) per prior across 3- and 7-variable Canadian macro VARs.

Model-Augmented Gibbs Sampler (Carlin-Chib 1995)

When comparing KK models via MCMC, the natural approach of adding a discrete model indicator MM to the Gibbs scheme fails due to an absorbing state problem: at iteration gg, if M(g)=jM^{(g)} = j forces parameter θi\theta_i (iji \neq j) out of the active model, there is no mechanism to regenerate θi\theta_i at the next step — the chain gets trapped, violating irreducibility.

Solution: pseudo-priors. Carlin and Chib (1995) augment the joint model with linking densities p(θjMj)p(\theta_j | M \neq j) for inactive parameters. Since yθj(Mj)y \perp \theta_j | (M \neq j), these densities are computationally transparent — they don't affect p(yM=j)p(y|M=j) — but they keep every parameter vector accessible at every step. The full conditional for the model indicator is:

P(M=jθ,y)f(yθj,M=j)  p(θjM=j)  πj(CC)P(M=j \mid \theta, y) \propto f(y|\theta_j,M=j)\; p(\theta_j|M=j)\; \pi_j \tag{CC}

This is a proper discrete distribution, computable at each iteration. All other blocks alternate between the true model posterior (when active) and the pseudo-prior (when inactive). Standard regularity conditions (Roberts and Smith 1993; Tierney 1994) then guarantee convergence.

Practical implementation.

  1. Run KK individual model-specific Gibbs chains to approximate the model-specific posteriors p(θjM=j,y)p(\theta_j|M=j, y).
  2. Fit first-order normal (or parametric) approximations to these posteriors; use them as pseudo-priors.
  3. Run the combined sampler; estimate P^(M=jy)=Gj/G\hat{P}(M=j|y) = G_j/G from visit counts.

Pseudo-prior accuracy determines mixing speed: well-matched pseudo-priors produce frequent moves between models; diffuse pseudo-priors lead to high autocorrelation in the MM-chain. Prior weights πj\pi_j can be adjusted to correct imbalance (one model visited too rarely), without invalidating the Bayes factor estimate.

Relation to Marginal Data Density. The Carlin-Chib sampler targets the posterior model probabilities P(M=jy)P(M=j|y) directly; Chib (1995) instead estimates logp(yMj)\log p(y|M_j) from a single-model run via the identity logp(y)=logL(ϕ)+logp(ϕ)logp(ϕy)\log p(y) = \log L(\phi^*) + \log p(\phi^*) - \log p(\phi^*|y). Both approaches give the same Bayes factors; Carlin-Chib is more direct for small KK, Chib scales better for large KK.

Carter-Kohn Multimove Algorithm (State-Space Models)

In VAR-TVP models, the latent state path β1,,βT\beta_1, \ldots, \beta_T must be drawn jointly rather than one element at a time (single-move Gibbs has severe mixing problems). The multimove algorithm (Carter and Kohn 1994) proceeds in two passes:

Step 1 — Forward Kalman filter (t=1,,Tt = 1, \ldots, T): run the standard Kalman recursions to compute filtered means βtt\beta_{t|t} and covariances QttQ_{t|t} conditional on y1,,yty_1, \ldots, y_t and the current draw of static parameters.

Step 2 — Backward simulation smoother (t=T,T1,,1t = T, T-1, \ldots, 1): draw sequentially from Gaussians whose moments are updated using the next-period state draw: βTN(βTT,QTT)\beta_T \sim \mathcal{N}(\beta_{T|T},\, Q_{T|T}) βtβt+1N ⁣(βtt+ϕQttQt+1t1(βt+1ϕβtt(1ϕ)β0),  Qttϕ2QttQt+1t1Qtt)\beta_t \mid \beta_{t+1} \sim \mathcal{N}\!\left(\beta_{t|t} + \phi Q_{t|t} Q_{t+1|t}^{-1}(\beta_{t+1} - \phi\beta_{t|t} - (1-\phi)\beta_0),\; Q_{t|t} - \phi^2 Q_{t|t} Q_{t+1|t}^{-1} Q_{t|t}\right)

The draws from this pass are exact samples from the joint posterior p(β1,,βTyT,θ)p(\beta_1, \ldots, \beta_T \mid y_T, \theta). The bottleneck is the K×KK \times K matrix inversion Qt+1t1Q_{t+1|t}^{-1} at each step, which collapses to k×kk \times k under a Kronecker covariance structure (see Time-Varying Parameter VAR). See State-Space Representation for the underlying Kalman filter.

Hit-and-Run Algorithm for Non-Conjugate Covariance Priors (Sun-Ni 2005)

When the prior on Σ\Sigma is the Yang-Berger (1994) reference prior πR(Σ)Σ1i<j(didj)1\pi_R(\Sigma) \propto |\Sigma|^{-1}\prod_{i<j}(d_i - d_j)^{-1} rather than the standard Jeffreys prior Σ(p+1)/2|\Sigma|^{-(p+1)/2}, the conditional posterior π(Σϕ,Y)\pi(\Sigma|\phi, Y) has no inverse-Wishart form. Sun and Ni (2005) sample Σ\Sigma within the Gibbs sampler using a Metropolis hit-and-run step in the log-eigenvalue space:

  1. Log-transform the current draw: decompose Σk1=ODO\Sigma_{k-1} = OD O' (eigen) and form Σ=ODO\Sigma^* = O D^* O' where di=log(di)d^*_i = \log(d_i).
  2. Select a random symmetric p×pp \times p direction matrix VV by drawing elements zijN(0,1)z_{ij} \sim N(0,1) and normalizing: vij=zij/(lmzlm2)1/2v_{ij} = z_{ij}/(\sum_{l \le m} z_{lm}^2)^{1/2}.
  3. Propose a new log-covariance Ψ=Σk1+λV\Psi = \Sigma^*_{k-1} + \lambda V, λN(0,1)\lambda \sim N(0,1); decompose Ψ=QCQ\Psi = QC^*Q'.
  4. Compute the log Metropolis ratio: αk=T2i(dici)+12tr ⁣[(expΣk1)1(expΨ)1]Sk+i<j ⁣[log(didj)log(cicj)]\alpha_k = \frac{T}{2}\sum_i(d^*_i - c^*_i) + \frac{1}{2}\text{tr}\!\left[(\exp\Sigma^*_{k-1})^{-1} - (\exp\Psi)^{-1}\right]S_k + \sum_{i<j}\!\left[\log(d^*_i - d^*_j) - \log(c^*_i - c^*_j)\right]
  5. Accept ΣΨ\Sigma^* \leftarrow \Psi with probability min(1,eαk)\min(1, e^{\alpha_k}); recover Σk=Qdiag(ec1,,ecp)Q\Sigma_k = Q\,\text{diag}(e^{c^*_1},\ldots,e^{c^*_p})Q'.

The log-transform ensures Σ\Sigma remains positive definite throughout. Acceptance rate is ~32% in practice. The algorithm is nested as one block within a larger Gibbs loop over (ϕ,Σ)(\phi, \Sigma). See Noninformative Prior for VAR.

Griddy-Gibbs Sampler

When a full conditional f(xixi)f(x_i \mid x_{-i}) has no standard analytical form, the Griddy-Gibbs algorithm (Gelfand and Smith 1990) proceeds as follows:

  1. Evaluate f(xixi(j))f(x_i \mid x_{-i}^{(j)}) over a grid of GG points {xi(1),,xi(G)}\{x_i^{(1)}, \ldots, x_i^{(G)}\} spanning the support.
  2. Numerically integrate (e.g., trapezoidal rule) to compute the cumulative distribution function (CDF) F(xixi(j))F(x_i \mid x_{-i}^{(j)}) over the grid.
  3. Draw uUniform(0,1)u \sim \mathrm{Uniform}(0,1) and invert the CDF by linear interpolation: xi(j)=F1(uxi(j))x_i^{(j)} = F^{-1}(u \mid x_{-i}^{(j)}).

The grid must cover the region of non-negligible probability; G40G \approx 40 is typically sufficient for unimodal conditionals. The key limitation is slow convergence if the conditional is multimodal — runs with different starting values help diagnose this.

Adaptive Rejection Sampling for Conjugate Hierarchical Hyperparameters (George-Makov-Smith 1993)

Griddy-Gibbs evaluates the log-conditional density on a numerical grid. When the conditional is known to be log-concave, Gilks-Wild (1992) adaptive rejection sampling (ARS) offers an exact alternative: it constructs a piecewise-exponential envelope using function evaluations and their derivatives, samples from the envelope by inversion, and accepts/rejects — adapting the envelope at each rejection, so the acceptance probability rises to 1 without tuning.

The hyperparameter bottleneck in conjugate hierarchical models. Consider an exponential-family hierarchy:

Data layer:xiθif(xθi)(exponential family)\text{Data layer:} \quad x_i|\theta_i \sim f(x|\theta_i) \quad \text{(exponential family)} Prior layer:θiα,βπ(θα,β)(natural conjugate, parameterized by (x0,n0))\text{Prior layer:} \quad \theta_i|\alpha,\beta \sim \pi(\theta|\alpha,\beta) \quad \text{(natural conjugate, parameterized by }(x_0,n_0)\text{)} Hyperprior:π(α,β)\text{Hyperprior:} \quad \pi(\alpha,\beta)

The θi\theta_i blocks draw conjugately. The hyperparameter block has full conditional:

π(α,βθ1,,θp)L(α,βθ1,,θp)π(α,β)\pi(\alpha,\beta|\theta_1,\ldots,\theta_p) \propto L(\alpha,\beta|\theta_1,\ldots,\theta_p)\cdot\pi(\alpha,\beta)

where LL is the conjugate likelihood distribution — the likelihood of (α,β)(\alpha,\beta) treating θ1,,θp\theta_1,\ldots,\theta_p as i.i.d. draws from the conjugate prior:

L(x0,n0θ1,,θp)exp ⁣[x0iθin0iψ(θi)pφ(x0,n0)](GMS eq. 21)L(x_0,n_0|\theta_1,\ldots,\theta_p) \propto \exp\!\left[x_0\sum_i\theta_i - n_0\sum_i\psi(\theta_i) - p\varphi(x_0,n_0)\right] \tag{GMS eq. 21}

Theorem 3.3 (George-Makov-Smith 1993): LL is log-concave in (x0,n0)(x_0,n_0); proper marginally for all p1p\geq 1; proper jointly iff p2p\geq 2.

Gamma-Poisson case (Corollary 3.5): For θiα,βGamma(α,β)\theta_i|\alpha,\beta\sim\text{Gamma}(\alpha,\beta):

LG(α,βθ1,,θp)(βαΓ(α))p ⁣(iθi)α1exp ⁣(βiθi)L^G(\alpha,\beta|\theta_1,\ldots,\theta_p) \propto \left(\frac{\beta^\alpha}{\Gamma(\alpha)}\right)^p\!\left(\prod_i\theta_i\right)^{\alpha-1}\exp\!\left(-\beta\sum_i\theta_i\right)

Complete exact Gibbs cycle (pump failure, p=10p=10):

  1. θiα,β,xiGamma(α+xi,β+ti)\theta_i|\alpha,\beta,x_i \sim \text{Gamma}(\alpha+x_i,\, \beta+t_i) — closed-form conjugate
  2. αβ,θ1:10\alpha|\beta,\theta_{1:10} — ARS from LG(α,)L^G(\alpha,\cdot)
  3. βα,θ1:10Gamma\beta|\alpha,\theta_{1:10} \sim \text{Gamma} — closed-form conjugate

Every step is exact. No grid approximation or Metropolis acceptance/rejection step required. This is more efficient than Griddy-Gibbs when log-concavity holds, since ARS needs only the log-density and its gradient rather than a CDF computed on a fixed grid.

Contrast with Griddy-Gibbs: Griddy-Gibbs applies universally (any proper conditional) but approximates via CDF inversion on a finite grid. ARS applies only to log-concave conditionals but is exact and self-adapting. For the conjugate hierarchical hyperparameter problem, ARS is the preferred method when the conditional is one of the standard families (Gamma, Beta).

Rao-Blackwell Variance Reduction

Replacing the direct estimator of E(Xi)E(X_i): μ^i=1kj=1kxi(j)\hat\mu_i = \frac{1}{k}\sum_{j=1}^k x_i^{(j)}

with the Rao-Blackwellized estimator: μ^ic=1kj=1kE(Xixi(j))(RB)\hat\mu_i^c = \frac{1}{k}\sum_{j=1}^k E(X_i \mid x_{-i}^{(j)}) \tag{RB}

always reduces variance: Var(μ^ic)Var(μ^i)\mathrm{Var}(\hat\mu_i^c) \leq \mathrm{Var}(\hat\mu_i). With the Griddy-Gibbs sampler, E(Xixi(j))E(X_i \mid x_{-i}^{(j)}) is the conditional mean over the grid — computed at each step anyway, so the RB estimator comes nearly for free.

The same principle extends to second moments: the within-group conditional variance Var(xixi)\mathrm{Var}(x_i \mid x_{-i}) (known analytically from the conditional pdf) is averaged alongside the conditional mean to obtain a lower-variance estimate of Var(Xi)\mathrm{Var}(X_i).

The principle extends equally to density estimation: instead of histogramming the sampled values, estimate f(x)f(x) by averaging the conditional densities at the simulated companion values: f^(x)=1mj=1mf(xyj)(RB-density)\hat{f}(x) = \frac{1}{m}\sum_{j=1}^m f(x \mid y_j) \tag{RB-density} Since E[f(xY)]=f(xy)f(y)dy=f(x)E[f(x|Y)] = \int f(x|y)f(y)\,dy = f(x), equation (RB-density) is unbiased whenever y1,,ymf(y)y_1,\ldots,y_m \sim f(y). Casella and George (1992, eq. 2.9) demonstrate it on both continuous and discrete examples; the analytic justification is provided by Liu, Wong, and Kong (1994).

Extension to Accept-Reject and Metropolis (Casella-Robert 1996). The same ancillary-variable argument extends beyond Gibbs. In the Accept-Reject algorithm, the uniform variables UiUnif[0,1]U_i \sim \text{Unif}[0,1] that decide whether to accept candidate YiY_i are ancillary. Rather than discarding rejected draws, one can compute Rao-Blackwellised weights: pi=P(Yi acceptedN,Y1,,YN)p_i = P(Y_i \text{ accepted} \mid N, Y_1,\ldots,Y_N) via an O(n2)O(n^2) recurrence on wi=f(Yi)/Mg(Yi)w_i = f(Y_i)/Mg(Y_i), yielding estimator μ^RB=ipih(Yi)\hat{\mu}^{RB} = \sum_i p_i h(Y_i). mean squared error (MSE) reduction: 15–20% at acceptance rate 0.9, up to 60% at rate 0.3 — permanently, regardless of sample size. For the Metropolis algorithm, the analogous weights ϑi\vartheta_i = expected number of times YiY_i appears in the chain (computed via a similar recursion) yield ~40–50% MSE reduction in the independent case and 7–25% in the random-walk case. A key empirical finding: a Rao-Blackwellised importance sampling estimator built on the Metropolis chain achieves 70–95% MSE reduction — substantially better than RB Metropolis itself — suggesting that the Metropolis mean is a poor estimation device (though the algorithm remains valuable as a sampler).

Blocked Gibbs Sampler

When two or more parameters (θi,θj)(\theta_i, \theta_j) have high posterior correlation, their marginal chains exhibit high autocorrelation and the effective sample size per draw drops sharply. The solution is to draw the correlated block jointly from the multivariate conditional f(θi,θjθij,Y)f(\theta_i, \theta_j \mid \theta_{-ij}, Y):

  1. Marginalize: compute f(θiθij,Y)=f(θi,θjθij,Y)dθjf(\theta_i \mid \theta_{-ij}, Y) = \int f(\theta_i, \theta_j \mid \theta_{-ij}, Y)\, d\theta_j numerically.
  2. Draw θi\theta_i from this marginal by Griddy-Gibbs.
  3. Draw θj\theta_j from the (now one-dimensional) full conditional f(θjθi,θij,Y)f(\theta_j \mid \theta_i, \theta_{-ij}, Y).

Bauwens-Giot (1997) report 5–7× reduction in estimator variance for the price elasticity parameters (δf\delta_f, δd\delta_d, posterior correlation 0.8\approx -0.8), with comparable CPU cost per unit of accuracy. The general principle is formalized in Liu, Wong, and Kong (1994).

Chib-Carlin (1999) — Blocked Gibbs for hierarchical longitudinal models. The Gaussian linear mixed model yi=Xiβ+Wibi+εiy_i = X_i\beta + W_i b_i + \varepsilon_i has the standard 4-block Gibbs (β,{bi},D1,σ2)(\beta, \{b_i\}, D^{-1}, \sigma^2) with severe mixing when variance components DD and σ2\sigma^2 are both vague. Three progressively blocked algorithms address this: (1) Algorithm 2 — draw β\beta marginalized over {bi}\{b_i\} using yiβ,σ2,DN(Xiβ,Vi)y_i|\beta,\sigma^2,D\sim\mathcal{N}(X_i\beta, V_i), Vi=σ2I+WiDWiV_i=\sigma^2I+W_iDW_i'; produces essentially iid β\beta draws (autocorrelation time κ\kappa drops from 20 to 1 in the HIV CD4 example). (2) Algorithm 3 — evaluate the integrated likelihood f(yσ2,D)f(y|\sigma^2,D) via the Chib (1995) identity as a ratio of three Normal densities evaluated at the posterior mean β\beta^*: f(yσ2,D)=ϕ(ββ0,B0)iϕ(yiXiβ,Vi)/ϕ(ββ^,B)f(y|\sigma^2,D)=\phi(\beta^*|\beta_0,B_0)\prod_i\phi(y_i|X_i\beta^*,V_i)/\phi(\beta^*|\hat\beta,B); update (σ2,D)(\sigma^2,D) jointly by M-H with multivariate-tt proposal; reduces κ(D21)\kappa(D_{21}) from 60 to 11. For binary longitudinal probit, marginalizing ZiZ_i over bib_i connects to the Chib-Greenberg (1998) multivariate probit; Algorithm 7 fully marginalizes over bib_i and ZZ via the GHK likelihood to achieve near-iid β\beta draws at lag 10 (0.009 vs 0.934). Universal rule: always marginalize fixed effects over random effects before sampling. See Chib-Carlin (1999) and Bayesian Hierarchical Model.

Marginal Gibbs Sampler for Cointegrated VARs (Warne 2006)

When the VECM has a Kronecker-structured prior — ΓiΩN(0,ΣΓiΩ)\Gamma_i|\Omega \sim \mathcal{N}(0,\Sigma_{\Gamma_i}\otimes\Omega) and vec(α)β,ΩN(0,(ββ)1λα2Ω)\mathrm{vec}(\alpha)|\beta,\Omega \sim \mathcal{N}(0,(\beta'\beta)^{-1}\otimes\lambda_\alpha^2\Omega) — the deterministic blocks (Φ,Γ)(\Phi,\Gamma) can be integrated out of the joint posterior analytically. This yields a marginal Gibbs sampler (Warne 2006, Proposition 5) that cycles over only three blocks:

  1. Ωα,ψ,YIW\Omega | \alpha, \psi, Y \sim \mathrm{IW} — the integration reduces the effective dimension of the Wishart posterior by d+n(k1)d + n(k-1) degrees of freedom (where dd = columns of DtD_t, nn = VAR dimension, kk = lag order), producing a tighter posterior.
  2. αψ,Ω,YN\alpha | \psi, \Omega, Y \sim \mathcal{N} — closed-form conditional regression of loading matrix on cointegrating space.
  3. ψα,Ω,Y\psi | \alpha, \Omega, Y \sim matrix-tt — the Grassmann manifold parametrization Ψ\Psi of the cointegrating space retains a matrix-tt full conditional (see Cointegration).

The cost is a d+n(k1)d + n(k-1) reduction in the Wishart degrees of freedom — an increase in posterior precision — because the integration over (Φ,Γ)(\Phi,\Gamma) concentrates mass. The full six-block sampler (Proposition 1) and the marginal three-block sampler yield the same marginal posterior for (α,ψ,Ω)(\alpha, \psi, \Omega) but the marginal sampler has lower autocorrelation per draw.

Rao-Blackwellization for the marginal likelihood. The marginal Gibbs output {Ψ(i)}\{\Psi^{(i)}\} is used to estimate p(α~Y,r)p(\tilde\alpha|Y,r) by averaging analytic Gaussian conditionals: p^(α~Y,r)=G1i=1Gp(α~Ψ(i),Y,r)\hat{p}(\tilde\alpha|Y,r) = G^{-1}\sum_{i=1}^G p(\tilde\alpha|\Psi^{(i)},Y,r). This is a Rao-Blackwell estimator for the posterior density at a point — the same principle as in the Bauwens-Giot and Savage-Dickey cases but applied to the Chib (1995) MLI denominator (see Marginal Data Density).

Extracting Samples from the Gibbs Sequence (Casella-George 1992)

Three main strategies for exploiting the Gibbs sequence, each with different trade-offs:

  1. Final-kk method (Gelfand and Smith 1990): Run mm independent chains of length kk; use the terminal value XkX_k from each. Yields an approximately iid sample from f(x)f(x) when kk is large enough. Diagnostic: compare density estimates from the mm chains and stop at the first kk at which they appear identical ("felt-tip pen test"). Simple to parallelize.

  2. Thinning by rr (Geyer): Run one long chain; extract every rrth observation to reduce serial dependence. Advantage: less sensitivity to initial values. Risk: the chain may remain in a small subset of the sample space for an extended period (Gelman and Rubin 1991), which thinning does not cure.

  3. All post-burn-in (George and McCulloch 1993): Use every XjX_j for jkj \geq k. Least wasteful for computationally expensive models; the empirical distribution still converges to f(x)f(x) by ergodicity. The mixing rate of the chain determines the effective sample size per draw. In the SSVS variable-selection setting, all post-burn-in γ\gamma draws are tabulated to estimate marginal inclusion probabilities P(γi=1Y)P(\gamma_i=1|Y).

The Rao-Blackwell density estimator (RB-density) is applicable under any of these strategies and consistently outperforms direct histogram methods at no additional computational cost.

Subsampling is Never Beneficial (MacEachern-Berliner 1994)

Thinning — keeping only every kkth draw from a length-nknk run — never reduces the variance of posterior mean estimates and generally increases it. MacEachern-Berliner (1994) prove this for any stationary Markov chain, requiring no reversibility assumption and thus covering the standard fixed-scan Gibbs sampler.

The inefficiency proof. Partition the run into kk systematic subsample means: xˉi=1nj=0n1xi+jk,i=1,,k\bar{x}_i = \frac{1}{n}\sum_{j=0}^{n-1} x_{i+jk}, \quad i = 1, \ldots, k By stationarity, all kk subsample means have the same variance: var(xˉi)=var(xˉ1)\text{var}(\bar{x}_i) = \text{var}(\bar{x}_1). The full-chain mean xˉ=k1ixˉi\bar{x} = k^{-1}\sum_i \bar{x}_i satisfies: var(xˉ)=var(xˉ1)k+1k2ijcov(xˉi,xˉj)var(xˉ1)\text{var}(\bar{x}) = \frac{\text{var}(\bar{x}_1)}{k} + \frac{1}{k^2}\sum_{i \neq j}\text{cov}(\bar{x}_i, \bar{x}_j) \leq \text{var}(\bar{x}_1) because cov(xˉi,xˉj)var(xˉ1)|\text{cov}(\bar{x}_i, \bar{x}_j)| \leq \text{var}(\bar{x}_1). Equality holds only when the distribution is degenerate (constant). Hence the full chain weakly dominates any systematic subsample.

The stationary time series trap. The spectral variance formula var(xˉ)=(σ2/nk){1+2(1i/nk)ρi}\text{var}(\bar{x}) = (\sigma^2/nk)\{1+2\sum(1-i/nk)\rho_i\} can suggest that thinning wins when ρ1>0.5\rho_1 > 0.5: for an AR(1)-type autocorrelation sequence with ρ1=ρ\rho_1 = \rho, ρi=0\rho_i = 0 for i>1i > 1, and k=2k = 2, the thinned variance equals σ2/n\sigma^2/n while the full-chain variance equals (σ2/2n)(1+2ρ)(\sigma^2/2n)(1 + 2\rho), which exceeds σ2/n\sigma^2/n when ρ>0.5\rho > 0.5. But stationarity with this autocorrelation structure requires ρ0.5|\rho| \leq 0.5 — the scenario never arises. The constraints on the autocorrelation function of any stationary process close off every parameter combination that would make thinning beneficial.

Extension beyond Geyer (1992). Geyer's (1992) analogous result required chain reversibility (detailed balance). MacEachern-Berliner require only stationarity, since Tierney (1992) noted that the standard fixed-scan Gibbs sampler is typically non-reversible.

Preferred alternatives. Batching (block-mean variance estimator) and spectral variance estimation (see Spectral Variance Estimator above) use the full chain and are uniformly preferred for variance estimation. The only legitimate reason to thin is computational: limited storage capacity before processing, or when processing cost per draw exceeds generation cost — a scenario more relevant in 1994 than today.

Predictive Distributions via MCMC (Scollnik ~1996)

A primary actuarial output is the posterior predictive distribution for future data Y2Y_2 given observed data Y1Y_1:

f(Y2Y1)=f(Y2Y1,θ)f(θY1)dθf(Y_2 \mid Y_1) = \int f(Y_2 \mid Y_1, \theta)\, f(\theta \mid Y_1)\, d\theta

The MCMC estimate follows directly from the ergodic theorem (eq. 2.2): average f(Y2Y1,θ(i))f(Y_2 \mid Y_1, \theta^{(i)}) over posterior draws θ(i)\theta^{(i)}. This is the same principle as the Rao-Blackwell density estimator (RB-density) — conditional densities averaged over sampled parameters — and requires no extra computation beyond the Gibbs run itself.

Posterior inference on any transformation w=w(θ)w = w(\theta) is equally free: compute w(i)=w(θ(i))w^{(i)} = w(\theta^{(i)}) and form the empirical distribution.

Data Augmentation for Grouped Data (Scollnik ~1996, Example 3)

When observations are grouped (only class frequencies observed, not exact values), a data augmentation approach adds the unobserved exact values as latent auxiliary variables, making the full conditionals tractable. For nn losses from Pareto(θ,λ\theta, \lambda) observed in CC class intervals with counts fcf_c:

  1. Augment: introduce latent exact losses xix_i for each observation; their conditional distribution given θ\theta and the class interval is a truncated Pareto on that interval.
  2. Update θ\theta: with exact values in hand, the conjugate gamma posterior is immediate — θx,λGamma(n+α,  βnlnλ+iln(λ+xi))\theta \mid x, \lambda \sim \text{Gamma}(n + \alpha,\; \beta - n\ln\lambda + \sum_i \ln(\lambda + x_i)).
  3. Iterate: the Gibbs chain over (θ,x1,,xn)(\theta, x_1, \ldots, x_n) converges quickly (empirically, ~10 iterations suffice for 25 observations in 4 classes).

Side inferences on tail events — e.g., P(at least one open-interval loss >L> L) — are read directly from the simulated augmented data, requiring no additional computation.

The augmentation idea generalizes: any latent-variable model (censored data, mixture models, state-space models) can be handled by adding the missing data as a Gibbs block.

Data Augmentation for Variable Selection (George-McCulloch 1993)

Stochastic Search Variable Selection (SSVS) casts subset selection as a Gibbs problem over (β,σ2,γ)(\beta, \sigma^2, \gamma), where γ{0,1}p\gamma \in \{0,1\}^p is a latent binary inclusion vector added as an augmentation block. See Variable Selection for the full model; the Gibbs structure is:

Block 1 — βj\beta^j: Conjugate Normal draw given current (σj1,γj1)(\sigma^{j-1}, \gamma^{j-1}) — the mixture prior βγNp(0,DγRDγ)\beta|\gamma \sim \mathcal{N}_p(0, D_\gamma R D_\gamma) yields a closed-form posterior: βjNp ⁣(Aγ(σj1)2XXβ^LS,  Aγ),Aγ=((σj1)2XX+Dγ1R1Dγ1)1\beta^j \sim \mathcal{N}_p\!\left(A_\gamma(\sigma^{j-1})^{-2}X'X\hat\beta_{LS},\; A_\gamma\right), \quad A_\gamma = \left((\sigma^{j-1})^{-2}X'X + D_\gamma^{-1}R^{-1}D_\gamma^{-1}\right)^{-1}

Block 2 — σj\sigma^j: Conjugate Inverse-Gamma draw given current (βj,γj1)(\beta^j, \gamma^{j-1}).

Block 3 — γij\gamma_i^j: Independent Bernoulli draws. For each ii, the inclusion probability is a/(a+b)a/(a+b) where a=f(βijγi=1)pia = f(\beta_i^j|\gamma_i=1)\cdot p_i and b=f(βijγi=0)(1pi)b = f(\beta_i^j|\gamma_i=0)\cdot(1-p_i) — evaluating the spike and slab Normal density at the already drawn βij\beta_i^j. Crucially, YY enters only through βj\beta^j, not directly.

The all-post-burn-in strategy reads off the empirical frequency of γi=1\gamma_i=1 across draws as an estimate of P(γi=1Y)P(\gamma_i=1|Y), navigating 2602^{60} model space without enumeration.

MN-GARCH Gibbs Sampler (Bauwens-Rombouts 2005)

The Bauwens-Rombouts (2005) sampler for the Mixture-of-Normals GARCH model illustrates two non-standard Gibbs patterns within a GARCH context:

Data augmentation for the mixture: Latent state variables St{1,,K}S_t \in \{1,\ldots,K\} are added as a Gibbs block. Conditional on states, each GARCH component's likelihood factors, converting the mixture problem into KK separate conditional problems. The state draw is multinomial: P(St=kπ,μ,θ,yt)πkϕ(yt;μk,hk,t)P(S_t = k | \pi, \mu, \theta, y_t) \propto \pi_k \phi(y_t; \mu_k, h_{k,t}).

Griddy-Gibbs for GARCH parameters: The GARCH parameters (ωk,αk,βk)(\omega_k, \alpha_k, \beta_k) per component have no conjugate conditional because GARCH variances hk,th_{k,t} depend on past observations recursively. The griddy-Gibbs algorithm evaluates the log-conditional density on a 3-D grid, numerically integrates to form the CDF, and inverts via linear interpolation. Positivity constraints ωk>0\omega_k > 0, αk0\alpha_k \geq 0, βk0\beta_k \geq 0, and the stationarity constraint αk+βk<1\alpha_k + \beta_k < 1 (for stationary components) bound the grid.

Dirichlet conjugate for mixing weights: πSTDirichlet(ak0+nk)\pi | S_T \sim \text{Dirichlet}(a_{k0} + n_k) where nk=#{t:St=k}n_k = \#\{t: S_t = k\}. This is the same conjugate update as in the i.i.d. mixture case; conditioning on STS_T makes it valid even in the GARCH setting.

Constrained mean block: The K1K-1 free means (μ1,,μK1)(\mu_1, \ldots, \mu_{K-1}) are drawn jointly from a multivariate Normal that enforces the zero-mean constraint kπkμk=0\sum_k \pi_k \mu_k = 0 via a (K1)×(K1)(K-1)\times(K-1) linear substitution.

See GARCH and BEKK-GARCH and Mixture of Normals for the model context.

Three-Block SUR Gibbs with Cross-Set Coefficient Pooling (Griffiths-Valenzuela 2002)

When HH groups of SUR equations share a common coefficient vector η\eta but have group-specific parameters Θh\Theta_h and covariance matrices Ωh\Omega_h, the fully conjugate Gibbs sampler decomposes into three natural blocks:

Model: Yh=ZhΘh+Xhη+ehY_h = Z_h\Theta_h + X_h\eta + e_h, h=1,,Hh = 1,\ldots,H; ehN(0,ΩhIMh)e_h \sim \mathcal{N}(0, \Omega_h \otimes I_{M_h}); each set hh has MhM_h observations and NhN_h equations.

Block 1 — ΩhΘh,η,YIW(Ah,Mh)\Omega_h \mid \Theta_h, \eta, Y \sim \mathrm{IW}(A_h, M_h): The residual within set hh after removing both set-specific and common effects is e~h=Y~hZ~hΘhX~hη\tilde{e}_h = \tilde{Y}_h - \tilde{Z}_h\Theta_h - \tilde{X}_h\eta, and Ah=e~he~hA_h = \tilde{e}_h'\tilde{e}_h (reshaped to Nh×NhN_h \times N_h). One Inverted-Wishart draw per set, all HH draws are independent given the other blocks.

Block 2 — ΘhΩh,η,YN(Θ^h,[Zh(Ωh1IMh)Zh]1)\Theta_h \mid \Omega_h, \eta, Y \sim \mathcal{N}(\hat\Theta_h, [Z_h'(\Omega_h^{-1} \otimes I_{M_h})Z_h]^{-1}): Within set hh, partial out the common η\eta contribution from the dependent variable, then run a standard GLS draw. The precision matrix Zh(Ωh1IMh)ZhZ_h'(\Omega_h^{-1} \otimes I_{M_h})Z_h is block-diagonal within the set.

Block 3 — η{Ωh},{Θh},YN(η^,W1)\eta \mid \{\Omega_h\}, \{\Theta_h\}, Y \sim \mathcal{N}(\hat\eta, W^{-1}): The precision matrix pools information across all HH sets: W=h=1HXh(Ωh1IMh)Xh,Q=h=1HXh(Ωh1IMh)(y~hZ~hΘh)W = \sum_{h=1}^H X_h'(\Omega_h^{-1} \otimes I_{M_h})X_h, \qquad Q = \sum_{h=1}^H X_h'(\Omega_h^{-1} \otimes I_{M_h})(\tilde{y}_h - \tilde{Z}_h\Theta_h) η^=W1Q\hat\eta = W^{-1}Q

This is the novel block: it is the GLS estimator for η\eta that treats each set as contributing observations to a pooled regression, weighted by its own Ωh1\Omega_h^{-1}. Compared to Percy (1992) and Chib-Greenberg (1995b), which handle single-set SUR, this block aggregates cross-set information in one conjugate step.

Key distinction from Baltagi (1995): Baltagi assumes the same Ωh=Ω\Omega_h = \Omega for all sets; Griffiths-Valenzuela allow distinct unrestricted Ωh\Omega_h per set, which is more flexible but requires separate Block 1 draws for each hh.

Applications (Griffiths-Valenzuela 2002):

See Equivalence Scale and Seemingly Unrelated Regression.

Sparse Factor Analytic Probit Gibbs Sampler (Hahn-Carvalho-Scott 2012)

Hahn, Carvalho, and Scott (2012) construct a 12-step conjugate Gibbs sampler for the sparse factor analytic probit model applied to high-dimensional binary outcomes. The sampler extends Chib-Greenberg (1998) by replacing the unstructured correlation matrix with a sparse factor decomposition.

Model: ziN(α+λγi+Bfi,Ip)z_i \sim \mathcal{N}(\alpha + \lambda\gamma_i + Bf_i, I_p); yij=1[zij>0]y_{ij} = \mathbf{1}[z_{ij} > 0]; Σ=BVB+I\Sigma = BVB^\top + I; BB lower triangular (bjj>0b_{jj} > 0, bjs=0b_{js} = 0 for s>js > j); fiN(0,V)f_i \sim \mathcal{N}(0, V); VV free k×kk \times k positive-definite.

Spike-and-slab prior on loadings: (bjsνs,qs)qsN(0,νs)+(1qs)δ0(bjs)(b_{js} \mid \nu_s, q_s) \sim q_s \cdot \mathcal{N}(0, \nu_s) + (1-q_s) \cdot \delta_0(b_{js}); νsIG\nu_s \sim \mathrm{IG}; qsBeta(1,1)q_s \sim \mathrm{Beta}(1,1).

Selected Gibbs blocks:

Step Variable Conditional Form
3 γi\gamma_i zi,α,λ,B,fi,Vz_i, \alpha, \lambda, B, f_i, V Truncated Normal: R+\mathbb{R}^+ for Republicans, R\mathbb{R}^- for Democrats
5 fif_i zi,α,λ,γi,B,Vz_i, \alpha, \lambda, \gamma_i, B, V N(m,M)\mathcal{N}(m, M); M=(V1+BB)1M = (V^{-1} + B^\top B)^{-1}; m=MB(ziαλγi)m = M \cdot B^\top(z_i - \alpha - \lambda\gamma_i)
6 VV {fi},V0\{f_i\}, V_0 IW(V0+FF,n+h)\mathrm{IW}(V_0 + FF^\top, n + h)
7 bjsb_{js} z,f,α,λ,γ,νs,qsz, f, \alpha, \lambda, \gamma, \nu_s, q_s Spike-and-slab: compute Bayes factor r^js\hat{r}_{js}; q^js=r^js/[(1qs)/qs+r^js]\hat{q}_{js} = \hat{r}_{js}/[(1-q_s)/q_s + \hat{r}_{js}]
10 zijz_{ij} yij,α,λ,γi,B,fiy_{ij}, \alpha, \lambda, \gamma_i, B, f_i Truncated N\mathcal{N}: (0,)(0,\infty) if yij=1y_{ij}=1, (,0)(-\infty,0) if yij=0y_{ij}=0

Key design choices:

Simulation results (Table 1, n=50):

Model p=20 Stein loss p=100 Stein loss
Sparse-6-factor (k=3 true) 3.0 43.4
Factor (no sparsity) 4.3 136.7
Wishart 11.9 503.1

Senate application (1949–2009): Three-factor model on 30 closest roll-call votes per term. Partisanship factor γi\gamma_i extracted as party-aligned dimension; dimensionality of bills stable across decades; partisanship low in late 1960s–early 1970s, increased sharply from 1979.

See Sparse Factor Probit, Multivariate Probit, and Variable Selection.

Data Augmentation for Scale Mixtures: Student-t Disturbances (Geweke 1993)

Geweke (1993) shows that a linear regression with i.i.d. Student-t(ν\nu) errors can be sampled by a four-block conjugate Gibbs sampler once the latent scale weights ωi\omega_i are included. The equivalence yixi,ωiN(xiβ,σ2ωi)y_i \mid x_i, \omega_i \sim \mathcal{N}(x_i'\beta, \sigma^2\omega_i) with ν/ωiχ2(ν)\nu/\omega_i \sim \chi^2(\nu) renders the following full conditionals all conjugate:

Block Variable Conditional Form
1 ωi\omega_i (β,σ,ν)(\beta,\sigma,\nu) IG: [(σ2ui2+ν)/ωi]χ2(ν+1)[(\sigma^{-2}u_i^2+\nu)/\omega_i]\sim\chi^2(\nu+1)
2 σ2\sigma^2 (β,ω)(\beta,\omega) IG: [iui2/ωi]/σ2χ2(n)[\sum_i u_i^2/\omega_i]/\sigma^2\sim\chi^2(n)
3 β\beta (σ,ω)(\sigma,\omega) Normal: GLS β^(ω)=(XΩ1X)1XΩ1y\hat\beta(\omega)=(X'\Omega^{-1}X)^{-1}X'\Omega^{-1}y
4 ν\nu (optional) (β,σ,ω)(\beta,\sigma,\omega) Non-standard kernel; exponential prior recommended

Posterior odds ratios between competing degrees-of-freedom values are available as a by-product of the Gibbs output, as an expectation under the ν(2)\nu^{(2)}-posterior (eq. 16). Convergence proofs (Theorems 4–5) are provided for fixed ν\nu and for the exponential-prior case.

Connection to SV models. The cross-sectional ωi\omega_i weights here are the static predecessor of the time-varying hth_t in the Jacquier-Polson-Rossi (1994) stochastic volatility model: JPR's data-augmentation with a latent variance path is the dynamic extension of Geweke's latent scale weights. See Geweke (1993), Mixture of Normals, and Stochastic Volatility.

Truncated Normal Gibbs for Inequality-Constrained Regression (Geweke 1996)

Geweke (1996) shows how to impose linear inequality constraints aDβwa \leq D\beta \leq w on the coefficients of a normal linear regression entirely within a Gibbs sampler, without the accept-reject inefficiency of the crude frequency simulator.

Key reparameterization. Let z=D(βb)z = D(\beta - b), a=D(ab)a^* = D(a-b), w=D(wb)w^* = D(w-b), T=σ2D(XX)1DT = \sigma^2 D(X'X)^{-1}D'. The constraint region aDβwa \leq D\beta \leq w becomes azwa^* \leq z \leq w^* coordinate by coordinate. The two full conditionals are:

  1. σz\sigma \mid z: (yXβ)(yXβ)/σ2χ2(T)(y - X\beta)'(y - X\beta)/\sigma^2 \sim \chi^2(T) — same chi-squared as the unconstrained model (eq. 3.2).
  2. zjσ,zijz_j \mid \sigma, z_{i\neq j}: univariate Normal truncated to [aj,wj][a_j^*, w_j^*], with mean bj+ijcijzib_j + \sum_{i\neq j} c_{ij}z_i and variance hj2=(Tjj)1h_j^2 = (T_{jj})^{-1} (eq. 3.3).

The critical insight is that rotating the problem by DD converts joint constraints into independent per-coordinate bounds, so each zjz_j's full conditional is a univariate (not multivariate) truncated normal — directly samplable via inverse-CDF. The chain converges in distribution to the constrained posterior because there is positive probability of moving to any positive-posterior region in one step.

Computational advantage. When the constraint probability p21p_{2|1} is small (e.g., 9×1059\times10^{-5} for the automobile sales example with k=11 sign constraints), the crude accept-reject simulator requires hours for 1,000 valid draws; the Gibbs sampler achieves equivalent accuracy in 49 minutes using every-100th draw.

Extensions. The same template applies to any model where a parameter block's conditional distribution is truncated multivariate normal: SUR models, censored regression, multinomial probit, and scale-mixture regression (Student-t with inequality constraints — the zjz_j draws inherit the scale weights from Geweke 1993). See Geweke (1996) and Multinomial Probit.

Mixture of Normals Probit Gibbs Sampler (Geweke-Keane 1997)

Geweke and Keane (1999) construct a fully conjugate Gibbs sampler for binary probit with a mm-component Gaussian mixture disturbance. The augmented state at each iteration consists of: the Albert-Chib (1993b) latent utilities {y~t}\{\tilde{y}_t\} and a new set of component-assignment indicators {Lt}{1,,m}T\{L_t\} \in \{1,\ldots,m\}^T. The six blocks, all with standard-form conditionals, are:

Block Variable Conditional Form
1 y~t\tilde{y}_t dt,Lt,β,α,hd_t, L_t, \beta, \alpha, h Truncated Normal on (0,)(0,\infty) or (,0)(-\infty,0); mean αLt+βxt\alpha_{L_t}+\beta'x_t, precision hLth_{L_t}
2 LtL_t y~t,β,α,h,p\tilde{y}_t, \beta, \alpha, h, p Multinomial: P(Lt=j)pjexp[0.5hj(y~tαjβxt)2]P(L_t=j)\propto p_j\exp[-0.5h_j(\tilde{y}_t-\alpha_j-\beta'x_t)^2]
3 β\beta y~,L,α,h\tilde{y}, L, \alpha, h Normal: precision-weighted regression with thLtxtxt\sum_t h_{L_t} x_t x_t'
4 α\alpha y~,L,β,h\tilde{y}, L, \beta, h Normal with ordering constraint; draws via Geweke (1991)/(1995) truncated-Normal algorithm
5 hjh_j (jjj\neq j^*) y~,L,β,α\tilde{y}, L, \beta, \alpha sj2hjχ2(νj+Tj)s_j^2 h_j \sim \chi^2(\nu_j+T_j); sj2s_j^2 updated by component SSR
6 pp LL Dirichlet with counts rj+Tjr_j + T_j

Dual augmentation principle. Block 1 is the Albert-Chib (1993b) latent-utility device; block 2 is the Chib (1996)-style component-assignment device. Together they handle both the binary truncation and the mixture non-Gaussianity within a single unified Gibbs cycle. The same pattern (latent utility + component label) generalizes to multinomial probit with mixture disturbances (Geweke-Keane-Runkle 1994, 1997).

Marginal likelihood. The Gelfand-Dey (1994) estimator, using a truncated multivariate Normal function f()f(\cdot) centered at posterior mean of (β,α,h,p)(\beta,\alpha,h,p), avoids the dimension explosion that would arise from including (y~,L)(\tilde{y},L) in the parameter space; the analytically marginalized likelihood (eq. 2.15) is p(dβ,α,h,p,X)=t[dtjpjΦ(hj1/2(αj+βxt))+(1dt)(1jpjΦ())]p(d|\beta,\alpha,h,p,X) = \prod_t [d_t\sum_j p_j\Phi(h_j^{1/2}(\alpha_j+\beta'x_t)) + (1-d_t)(1-\sum_j p_j\Phi(\ldots))].

See Geweke-Keane (1999), Binary Probit, and Mixture of Normals.

Data Augmentation for Panel Data and Mixture Shocks (Geweke-Keane 2000)

Geweke and Keane (2000) illustrate two non-standard Gibbs patterns in a dynamic panel earnings model fitted to the PSID:

Unbalanced panel augmentation. Individuals enter and exit the panel at different ages, breaking the balanced-panel structure required for tractable AR-based conditionals. Unobserved period earnings yity_{it} are added as latent variables; their full conditional is Gaussian from the model's AR structure, enabling a complete balanced panel at each Gibbs iteration.

Mixture-of-normals block. First-period shocks ei1e_{i1} and transitory increments gitg_{it} each follow a 3-component mixture k=13pkN(ak,hk1)\sum_{k=1}^3 p_k\, \mathcal{N}(a_k,\, h_k^{-1}). Latent component indicators sit{1,2,3}s_{it} \in \{1,2,3\} are added as a Gibbs block; conditional on sits_{it}, all parameters have conjugate Gaussian or Gamma conditionals. Proper Gamma priors on precisions hkh_k are essential: the mixture likelihood is unbounded as hkh_k \to \infty for any non-empty component unless regularized. The normalization a2=0a_2 = 0, a1a2a3a_1 \leq a_2 \leq a_3 prevents label switching.

The 8-block earnings sampler (plus marital status and individual effects qiq_i) achieves RNE of 0.05–1.0; the full PSID sample requires ~332 sec per iteration and 2,500 sweeps. See Mixture of Normals for the general framework.

Auxiliary Variable Gibbs Sampler for Non-Conjugate Models (Damien-Wakefield-Walker 1999)

When a full conditional takes the non-standard form f(x)π(x)i=1Nli(x)f(x) \propto \pi(x)\prod_{i=1}^N l_i(x) — where π\pi is a proper density and each lil_i is non-negative and invertible — Damien, Wakefield, and Walker (1999) show how to construct a Gibbs sampler with only uniform and truncated-standard conditionals.

Theorem 1. Introduce latent variables UiUniform(0,li(x))U_i \sim \mathrm{Uniform}(0, l_i(x)) for i=1,,Ni=1,\ldots,N. The joint density of (X,U1,,UN)(X, U_1,\ldots,U_N) is: f(x,u1,,uN)π(x)i=1N1[0<ui<li(x)]f(x, u_1,\ldots,u_N) \propto \pi(x)\prod_{i=1}^N \mathbf{1}[0 < u_i < l_i(x)]

The full conditionals are:

The key requirement is that the invertibility of each lil_i gives an analytical expression for AuA_u, making the truncated draw tractable.

"Always moves" property. The auxiliary variable sampler is equivalent to a Metropolis-Hastings independence chain with proposal π()\pi(\cdot) but one that always moves — the chain never rejects. This is because sampling UU before XX conditions the proposal on falling in the acceptance region of the implied MH step. This dominates the corresponding MH independence chain for any estimand (Peskun 1973 optimality argument).

Choosing latent variables. The decomposition f=πlif = \pi \cdot \prod l_i is not unique; this flexibility is exploited to obtain computable truncation sets. For example:

Applications in the paper:

  1. Poisson-log-normal model: f(xr)exp{rxexp(x)0.5x2}f(x|r) \propto \exp\{rx - \exp(x) - 0.5x^2\} → latent exponential UU → truncated Normal for XX.
  2. Bernoulli-logistic regression: two sets of latents Ui,ViU_i, V_i per observation → truncated Normal for β\beta on a computable interval AwA_w.
  3. Weibull proportional hazards: exponential latents for the survival term → tractable interval bounds for both β\beta and the baseline hazard aa.
  4. Generalized linear mixed models (GLMMs): two-latent-per-observation scheme for both the regression block β\beta and random effects bib_i; all full conditionals become truncated Normal.
  5. Non-linear mixed models (logistic growth): dimension-by-dimension sampling from π(θkθk)\pi(\theta_k|\theta_{-k}) restricted to AukA^k_u when the multivariate set AuA_u is intractable.

Numerical comparison (Lindstrom-Bates 1990 orange-tree growth data): 7 trees, 5 observations each, 3-dimensional random effect θi\theta_i. Auxiliary variable Gibbs vs. random-walk MH for 10,000 iterations:

Caveats. The decomposition f=πlif = \pi \cdot \prod l_i must be discovered case-by-case; there is no automatic algorithm. When an efficient rejection sampler or MH proposal already exists, the auxiliary variable approach may not improve efficiency. The "always moves" property does not guarantee rapid mixing if the truncation set AuA_u is small relative to the support of π\pi.

See Damien-Wakefield-Walker (1999), Paul Damien, Jon Wakefield, Stephen Walker, and Metropolis-Hastings Algorithm.

Convergence Theory (Tierney 1994)

Tierney (1994) establishes formal convergence properties using general state space Markov chain theory (Nummelin 1984). The key hierarchy:

Theorem 1 (Ergodic convergence). If the chain has invariant distribution π\pi, is π\pi-irreducible, and is aperiodic, then π\pi is the unique invariant distribution and for π\pi-almost all starting points xx: Pn(x,)π()0\|P^n(x,\cdot) - \pi(\cdot)\| \to 0

Geometric ergodicity via drift condition. Suppose there exist a function V:E[1,)V: E \to [1,\infty), a "small" set CC (where P(x,)ϵν()P(x,\cdot) \geq \epsilon\nu(\cdot) uniformly), and constants λ<1\lambda < 1 and b<b < \infty such that: PV(x)λV(x)+b1C(x)xPV(x) \leq \lambda V(x) + b\cdot\mathbf{1}_C(x) \quad \forall x

Then the chain is geometrically ergodic: Pn(x,)πM(x)ρn\|P^n(x,\cdot) - \pi\| \leq M(x)\rho^n for some ρ<1\rho < 1 (Proposition 1 / Tierney's formalization of Nummelin). This is the standard sufficient condition for central limit theorem (CLT) validity.

Theorem 4 (CLT for geometric ergodic chains). If the chain is geometrically ergodic and gL2+ε(π)g \in L^{2+\varepsilon}(\pi), then: n(n1j=1ng(Xj)Eπ[g])dN(0,σ2)\sqrt{n}\left(n^{-1}\sum_{j=1}^n g(X_j) - E_\pi[g]\right) \xrightarrow{d} \mathcal{N}(0,\sigma^2)

where the asymptotic variance is the spectral density at zero: σ2=Varπ(g)+2j=1Covπ(g(X0),g(Xj))\sigma^2 = \mathrm{Var}_\pi(g) + 2\sum_{j=1}^\infty \mathrm{Cov}_\pi(g(X_0),\, g(X_j))

Geometric ergodicity guarantees this series converges absolutely. For uniform ergodicity (stronger: P(x,)π\|P(x,\cdot)-\pi\| bounded uniformly), L2(π)L^2(\pi) functions suffice (Theorem 5).

Practical implication. For a Gibbs or MH sampler to yield valid confidence intervals (via batch means or spectral variance estimation), geometric ergodicity must hold. For posteriors with sub-exponential tails, the drift condition is typically satisfied. For posteriors with heavy tails or bounded supports, uniform ergodicity often holds directly.

Peskun (1973) optimality of MH acceptance ratio. Among all Metropolis-type acceptance functions α(x,y)\alpha(x,y) that leave π\pi invariant, the Hastings form α(x,y)=min{π(y)q(y,x)/[π(x)q(x,y)],1}\alpha(x,y) = \min\{\pi(y)q(y,x)/[\pi(x)q(x,y)],\, 1\} minimises the rejection probability for any pair (x,y)(x,y) — and therefore minimises the asymptotic variance σ2\sigma^2 for any estimand. Barker's (1965) acceptance form π(y)q(y,x)/[π(x)q(x,y)+π(y)q(y,x)]\pi(y)q(y,x)/[\pi(x)q(x,y) + \pi(y)q(y,x)] is strictly worse by this criterion.

Metropolis-Hastings Algorithm (Jackman 2000)

The Metropolis-Hastings (MH) algorithm generalizes Gibbs sampling to cases where a full conditional cannot be sampled directly. At each iteration, a candidate θ\theta^* is drawn from a proposal density q(θθt1)q(\theta^*|\theta^{t-1}), then accepted with probability:

r=min ⁣(1,  p(θY)q(θt1θ)p(θt1Y)q(θθt1))r = \min\!\left(1,\; \frac{p(\theta^* \mid Y)\, q(\theta^{t-1} \mid \theta^*)}{p(\theta^{t-1} \mid Y)\, q(\theta^* \mid \theta^{t-1})}\right)

If rejected, the chain stays at θt1\theta^{t-1}. The Gibbs sampler is a special case: when q(θθt1)=p(θθit1,Y)q(\theta^*|\theta^{t-1}) = p(\theta^* \mid \theta^{t-1}_{-i}, Y) (a full conditional), the ratio rr equals 1 everywhere and every candidate is accepted.

Practical choices for q:

When MH steps are nested inside a larger Gibbs cycle, the resulting algorithm is called Metropolis-within-Gibbs (or hybrid MH-Gibbs). See Jackman (2000) for worked examples in probit and AR(1) models.

Convergence Diagnostics

Gelman-Rubin Potential Scale Reduction (Gelman and Rubin 1992)

Run m2m \geq 2 independent chains of length 2n2n from widely dispersed starting values; discard the first nn draws as burn-in. For a scalar parameter ψ\psi:

The potential scale reduction factor R^=V^/W\hat{R} = \sqrt{\hat{V}/W} where V^=(n1)W/n+B/n\hat{V} = (n-1)W/n + B/n. At convergence, R^1\hat{R} \to 1; values substantially above 1 (say >1.1> 1.1) indicate insufficient mixing. The intuition: if all chains have converged to the same distribution, the between-chain variance should equal the within-chain variance.

Raftery-Lewis Chain Length Determination (Raftery and Lewis 1992)

Given a target quantile qq, tolerance rr, and confidence level ss, the method computes the required burn-in MM, thinning interval kk, and total chain length NN from a short pilot run (~2,000 draws).

Step 1 — Binarize. Set Zj=1[θ(j)t^]Z_j = \mathbf{1}[\theta^{(j)} \leq \hat{t}] where t^\hat{t} is the pilot-estimated qq-th quantile. Under stationarity, {Zj}\{Z_j\} is approximately a first-order two-state Markov chain.

Step 2 — Fit transitions. Estimate α^=n01/(n00+n01)\hat\alpha = n_{01}/(n_{00}+n_{01}) and β^=n10/(n10+n11)\hat\beta = n_{10}/(n_{10}+n_{11}), where nijn_{ij} counts iji \to j transitions. Check first-order adequacy via a G2G^2 deviance test vs. a second-order model; if rejected, thin by kk (use only every kk-th draw) until first-order holds.

Step 3 — Required burn-in. Mlog ⁣(ε(α^+β^)/max(α^,β^))log1α^β^M \approx \left\lceil \frac{\log\!\bigl(\varepsilon(\hat\alpha+\hat\beta)/\max(\hat\alpha,\hat\beta)\bigr)}{\log|1-\hat\alpha-\hat\beta|} \right\rceil where ε\varepsilon is a small constant (e.g. 0.001) controlling closeness to stationarity.

Step 4 — Required chain length. Nmink2z(1+s)/22(α^+β^α^2β^2)r2q(1q)(α^+β^)2N_{\min} \approx k \cdot \frac{2\, z_{(1+s)/2}^2\, (\hat\alpha+\hat\beta-\hat\alpha^2-\hat\beta^2)}{r^2\, q(1-q)\, (\hat\alpha+\hat\beta)^2}

For low-autocorrelation chains, N3,000N \approx 3{,}0005,0005{,}000 is typical. Slowly mixing chains can require N>50,000N > 50{,}000.

More targeted than Gelman-Rubin: rather than assessing whether convergence has been reached, it tells you how many iterations you need for a given inferential precision. The method is quantile-specific — apply to the most demanding quantile when multiple are of interest.

Zellner-Min (1995) Convergence Criteria: GSC²

Gelman-Rubin and Raftery-Lewis diagnostics detect whether the chain has mixed — they do not detect convergence to an incorrect distribution. If the GS is trapped near one mode of a multimodal posterior, both diagnostics can indicate convergence while the estimated marginals are wrong.

Zellner and Min (1995) exploit the fact that when the joint posterior p(α,βD)π(α,βI0)l(α,βy)p(\alpha,\beta \mid D) \propto \pi(\alpha,\beta \mid I_0)\, l(\alpha,\beta \mid y) is known analytically up to a constant, two factorizations must hold simultaneously:

p(αD)p(βα,D)=p(βD)p(αβ,D)(ZM-identity)p(\alpha \mid D)\,p(\beta \mid \alpha, D) = p(\beta \mid D)\,p(\alpha \mid \beta, D) \tag{ZM-identity}

This identity can be evaluated pointwise using GS-estimated marginals p^N(αiD)\hat{p}_N(\alpha_i \mid D), p^N(βiD)\hat{p}_N(\beta_i \mid D) alongside the known conditional densities p(βα,D)p(\beta \mid \alpha, D) and p(αβ,D)p(\alpha \mid \beta, D).

Three GSC² criteria evaluated at parameter-space points (αi,βi)(\alpha_i, \beta_i):

Criterion Formula Converged value
ARC² (Anchored Ratio) θ^12(N)=p^N(α1D)p(β1α1,D)/[p^N(α2D)p(β2α2,D)]\hat\theta_{12}(N) = \hat{p}_N(\alpha_1\|D)\,p(\beta_1\|\alpha_1,D) / [\hat{p}_N(\alpha_2\|D)\,p(\beta_2\|\alpha_2,D)] vs. exact θ12\theta_{12} θ^12θ12\hat\theta_{12} \approx \theta_{12}
DC² (Difference) η^i(N)=p^N(αiD)p(βiαi,D)p^N(βiD)p(αiβi,D)\hat\eta_i(N) = \hat{p}_N(\alpha_i\|D)\,p(\beta_i\|\alpha_i,D) - \hat{p}_N(\beta_i\|D)\,p(\alpha_i\|\beta_i,D) η^i0\hat\eta_i \approx 0
RC² (Ratio) γ^i(N)=p^N(αiD)p(βiαi,D)  /  p^N(βiD)p(αiβi,D)\hat\gamma_i(N) = \hat{p}_N(\alpha_i\|D)\,p(\beta_i\|\alpha_i,D) \;/\; \hat{p}_N(\beta_i\|D)\,p(\alpha_i\|\beta_i,D) γ^i1\hat\gamma_i \approx 1

Inference on η^i\hat\eta_i. Under large-sample theory, η^i(N)N(ηi,ϕ^i2)\hat\eta_i(N) \approx \mathcal{N}(\eta_i,\, \hat\phi_i^2) where the variance ϕ^i2\hat\phi_i^2 (equation 12) accounts for GS autocorrelation via the sample autocovariances of the GS draws. Posterior odds for H0:ηi=0H_0: \eta_i = 0 vs. HA:ηi0H_A: \eta_i \neq 0: KOA=πN/2(1+zi2/N)exp{zi2/2},zi=η^i/ϕ^iK_{OA} = \sqrt{\pi N/2}\,(1 + z_i^2/N)\exp\{-z_i^2/2\}, \qquad z_i = \hat\eta_i / \hat\phi_i This uses a Cauchy prior on ηi\eta_i under HAH_A (Jeffreys 1967). For the SUR example, KOAK_{OA} rises from 10.98 at N=100N=100 to 118.68 at N=9,000N=9{,}000, strongly favoring H0H_0 and confirming correct convergence.

Bimodal failure detection. For the mixture p=0.1pA+0.9pBp = 0.1\, p_A + 0.9\, p_B (modes at (0,5)(0,5) and (0,5)(0,-5)), the GS gets stuck near (0,5)(0,5). Although the chain appears stationary, the DC² criterion gives η^=0.509\hat\eta = -0.509 at (α,β)=(0,5)(\alpha,\beta) = (0,-5), clearly nonzero — the GS has converged to the wrong marginals.

Limitation. The GSC² criteria require both the joint posterior form and the full conditional densities to be available analytically. They are not applicable in fully black-box settings where Gibbs is used precisely because no analytical form exists.

CUMSUM Plot (Yu and Mykland 1994)

CSt(Xi)=t1j=1txi(j)μ^iσ^i,t=1,,k\mathrm{CS}_t(X_i) = \frac{t^{-1}\sum_{j=1}^t x_i^{(j)} - \hat\mu_i}{\hat\sigma_i}, \qquad t = 1, \ldots, k

If the chain has converged, CSt0\mathrm{CS}_t \to 0 smoothly. Erratic or persistent drifts indicate the chain is exploring slowly or is stuck.

Spectral Variance Estimator (Geweke 1992)

The Markov chain of sampled values is a dependent time series. The variance of the ergodic mean estimator μ^i\hat\mu_i is:

V(μ^i)=S(0)k(SE)V(\hat\mu_i) = \frac{S(0)}{k} \tag{SE}

where S(ω)S(\omega) is the spectral density of the series {xi(j)}\{x_i^{(j)}\} evaluated at ω=0\omega = 0:

S(ω)=j=γjeiωjS(\omega) = \sum_{j=-\infty}^{\infty} \gamma_j e^{-i\omega j}

A peak in S(ω)S(\omega) near ω=0\omega = 0 indicates strong low-frequency dependence (slow mixing). In practice, S(0)S(0) is estimated via a smoothed periodogram using one of three spectral windows applied to the sample autocovariances γ^j\hat\gamma_j:

Window Weight k(j)k(j) for jM|j| \leq M
Truncated periodogram 11
Daniell sin(πj/M)/(πj/M)\sin(\pi j/M)/(\pi j/M)
Tukey-Hanning 12(1+cos(πj/M))\frac{1}{2}(1 + \cos(\pi j/M))

The bandwidth MM should be set to half the critical bandwidth of the spectrum — the frequency interval over which S(ω)S(\omega) changes appreciably. For nearly white-noise chains (γ^j0\hat\gamma_j \approx 0 for j1j \geq 1), all windows give essentially the same S^(0)\hat{S}(0), and few draws are needed. For chains with strong low-frequency peaks, MM must be large and long chains are required.

The formula (SE) yields a confidence interval for μ^i\hat\mu_i: a 95% CI is μ^i±1.96S^(0)/k\hat\mu_i \pm 1.96\sqrt{\hat{S}(0)/k}.

Why It Matters

Open Questions

Related