Tutorials › Stochastic Processes › Scan Schedules and Component Update Order

Markov Chain Monte Carlo · Tutorial 922 of 994

Scan Schedules and Component Update Order

Learn how update order determines a Gibbs transition kernel, why systematic and random scans preserve the same target, and how their convergence behavior can differ.

Advanced 11 min read

What You'll Learn

  • Define single-component Gibbs kernels for a positive finite target distribution.
  • Derive the invariant distribution of systematic sweeps and random-scan updates.
  • Distinguish a fixed-order sweep from a mixture of component-update kernels.
  • Compute and verify exact transition matrices for a correlated binary target.
  • Compare convergence modes for two scan schedules without equating invariance with mixing speed.
  • Identify a scan-schedule calculation that incorrectly replaces composition with averaging.

Why the Scan Schedule Matters

A Gibbs sampler updates one component of a configuration at a time, drawing that component from its conditional distribution given the others. The schedule determines how those component updates form a transition kernel. In a systematic scan, the components are updated in a fixed order; in a random scan, one component is selected at random at each step. Both schedules can preserve the same target distribution, but they need not have the same transition probabilities or convergence behavior.

Let \(S=S_1\times\cdots\times S_d\) be a finite product state space, and let \(\pi(x)>0\) for every \(x\in S\), with \(\sum_{x\in S}\pi(x)=1\). For component \(\ell\), write \(x_{-\ell}\) for all coordinates except coordinate \(\ell\). The conditional distribution used to update component \(\ell\) is \(\pi_\ell(a\mid x_{-\ell})=\pi(x_{-\ell},a)/\sum_{b\in S_\ell}\pi(x_{-\ell},b)\). Positivity ensures that every denominator is nonzero. Consider a discrete-time chain \((X_n)_{n\ge0}\) on \(S\), on a probability space \((\Omega,\mathcal{F},\mathbb{P})\), with filtration \(\mathcal{F}_n=\sigma(X_0,\ldots,X_n)\). Its transition matrices use row vectors for distributions.

Definition: The component-\(\ell\) Gibbs kernel \(K_\ell\) keeps all coordinates other than \(\ell\) fixed and draws the new \(\ell\)th coordinate from \(\pi_\ell(\cdot\mid x_{-\ell})\). A systematic sweep in order \(\sigma(1),\ldots,\sigma(d)\) has kernel \(K_{\sigma(1)}\cdots K_{\sigma(d)}\). A random-scan step that selects component \(\ell\) with probability \(w_\ell\), where \(w_\ell\ge0\) and \(\sum_{\ell=1}^d w_\ell=1\), has kernel \(\sum_{\ell=1}^d w_\ell K_\ell\).

Kernel products here follow row-vector convention: if the current distribution is \(\mu\), then after a component-\(\ell\) update it is \(\mu K_\ell\). Thus, in the displayed systematic order, the first update is applied first and the distribution after a complete sweep is \(\mu K_{\sigma(1)}\cdots K_{\sigma(d)}\). The chain observed at sweep boundaries is homogeneous in discrete sweep time. A random-scan chain instead takes one randomly selected component update per discrete-time step.

Why Both Schedules Preserve the Target

Theorem: For a finite product state space and a strictly positive target distribution \(\pi\), each component Gibbs kernel satisfies \(\pi K_\ell=\pi\). Consequently, every fixed-order systematic sweep and every random-scan mixture with fixed probabilities \(w_\ell\) also has invariant distribution \(\pi\).

Proof. Fix a component \(\ell\). For any configuration \(y\), a transition to \(y\) under \(K_\ell\) is possible only from configurations \(x\) with \(x_{-\ell}=y_{-\ell}\). Therefore \(\sum_{x\in S}\pi(x)K_\ell(x,y)=\sum_{a\in S_\ell}\pi(y_{-\ell},a)\pi_\ell(y_\ell\mid y_{-\ell})\). By the definition of the conditional probability, the sum over \(a\) is \(\pi(y_{-\ell})=\sum_{a\in S_\ell}\pi(y_{-\ell},a)\), so the expression is \(\pi(y_{-\ell})\pi_\ell(y_\ell\mid y_{-\ell})=\pi(y)\). This proves \(\pi K_\ell=\pi\) at every \(y\). For a systematic sweep, repeated multiplication gives \(\pi K_{\sigma(1)}\cdots K_{\sigma(d)}=\pi\), since each factor preserves \(\pi\). For random scan, linearity gives \(\pi\sum_\ell w_\ell K_\ell=\sum_\ell w_\ell\pi K_\ell=\sum_\ell w_\ell\pi=\pi\). The weights sum to one, so the mixture is a transition kernel and the stated equality proves invariance. \(\square\)

The result concerns invariance: if a chain starts with distribution \(\pi\), it has distribution \(\pi\) after the update being considered. It does not say that chains started elsewhere approach \(\pi\) at the same rate, or even that different schedules have the same transition matrix. The following calculations make that distinction explicit.

Worked Example: Correlated Binary Components

Let \(S=\{+1,-1\}^2\), with states ordered \((++,+-,-+,--)\), and assign target probability \(3/8\) to \(++\) and \(--\), and \(1/8\) to \(+-\) and \(-+\). These probabilities are positive and sum to \(3/8+1/8+1/8+3/8=1\). Given either component, the other matches it with probability \(3/4\), and differs with probability \(1/4\). Use a systematic sweep that updates \(X\) and then \(Y\).

From \(++\), the first updated coordinate \(X\) is \(+\) with probability \(3/4\) and \(-\) with probability \(1/4\). If \(X=+\), the update of \(Y\) gives \(++\) with probability \(3/4\) and \(+-\) with probability \(1/4\). If \(X=-\), it gives \(-+\) with probability \(1/4\) and \(--\) with probability \(3/4\). Multiplying the probabilities gives the first row below. The same conditional-update calculation for each starting state gives

$$ K_XK_Y= \begin{bmatrix} 9/16&3/16&1/16&3/16\\ 3/16&1/16&3/16&9/16\\ 9/16&3/16&1/16&3/16\\ 3/16&1/16&3/16&9/16 \end{bmatrix}. $$

Row check: the row sums, with denominator \(16\), are \(9+3+1+3=16\), \(3+1+3+9=16\), \(9+3+1+3=16\), and \(3+1+3+9=16\). Hence each row sums to \(1\). To check invariance directly, multiply \(\pi=(6/16,2/16,2/16,6/16)\) by this matrix. The four resulting entries have denominator \(256\) and numerators \(6\cdot9+2\cdot3+2\cdot9+6\cdot3=96\), \(6\cdot3+2\cdot1+2\cdot3+6\cdot1=32\), \(6\cdot1+2\cdot3+2\cdot1+6\cdot3=32\), and \(6\cdot3+2\cdot9+2\cdot3+6\cdot9=96\). Thus \(\pi K_XK_Y=(96/256,32/256,32/256,96/256)=\pi\), and the entries of \(\pi\) sum to \(1\).

Worked Example: Random Scan on the Same Target

Now select \(X\) or \(Y\) with probability \(1/2\) at each step. From \(++\), updating \(X\) gives \(++\) or \(-+\) with probabilities \(3/4\) and \(1/4\); updating \(Y\) gives \(++\) or \(+-\) with probabilities \(3/4\) and \(1/4\). Averaging these two rows gives \((3/4,1/8,1/8,0)\). Applying the same procedure to the other states gives

$$ R=\tfrac12(K_X+K_Y)= \begin{bmatrix} 3/4&1/8&1/8&0\\ 3/8&1/4&0&3/8\\ 3/8&0&1/4&3/8\\ 0&1/8&1/8&3/4 \end{bmatrix}. $$

Row check: the row sums are \(6/8+1/8+1/8+0=1\), \(3/8+2/8+0+3/8=1\), \(3/8+0+2/8+3/8=1\), and \(0+1/8+1/8+6/8=1\). For a direct stationary check, the four numerators of \(\pi R\), over denominator \(128\), are \(6\cdot6+2\cdot3+2\cdot3+6\cdot0=48\), \(6\cdot1+2\cdot2+2\cdot0+6\cdot1=16\), \(6\cdot1+2\cdot0+2\cdot2+6\cdot1=16\), and \(6\cdot0+2\cdot3+2\cdot3+6\cdot6=48\). Hence \(\pi R=(48/128,16/128,16/128,48/128)=\pi\). This matrix differs from the systematic-sweep matrix, even though both preserve the same target.

Invariance Is Not a Mixing Comparison

For a sharper comparison, write the two component values as \(x,y\in\{-1,+1\}\). Under this target, the conditional mean of either updated component, given the other, is \(r\) times the other component, where \(r=1/2\): for example, \(\mathbb{E}[X\mid Y=y]=(3/4)y+(1/4)(-y)=y/2\). In random scan, a step updates \(X\) with probability \(1/2\) and otherwise leaves \(X\) unchanged. Therefore \(\mathbb{E}[X_{n+1}\mid X_n=x,Y_n=y]=(x+ry)/2\). The corresponding conditional mean for \(Y\) is \((y+rx)/2\). If the chain starts at \(++\), symmetry gives equal means at each step, and each mean is multiplied by \((1+r)/2=3/4\). Thus after \(n\) random-scan updates, both component means are \((3/4)^n\).

For systematic scan, one complete sweep first gives \(\mathbb{E}[X_{\mathrm{new}}\mid X=x,Y=y]=ry\), then gives \(\mathbb{E}[Y_{\mathrm{new}}\mid X_{\mathrm{new}}]=rX_{\mathrm{new}}\). Starting at \(++\), after \(n\ge1\) complete sweeps the means are \(\mathbb{E}[Y_n]=(1/4)^n\) and \(\mathbb{E}[X_n]=(1/2)(1/4)^{n-1}\). These formulas follow by repeatedly applying the two conditional-mean equations; for example, \(\mathbb{E}[Y_n]=r\mathbb{E}[X_n]=r^2\mathbb{E}[Y_{n-1}]\), with \(\mathbb{E}[Y_0]=1\). The schedules therefore contract these particular discrepancies at different rates. This is not a general claim that systematic scan is always faster: the comparison depends on the target, update order, and how computational effort is counted.

Worked Example: Independent Components Separate the Schedules

Take the uniform target on the same four states, so the two components are independent and each conditional update is a fair draw. Its target vector is \((1/4,1/4,1/4,1/4)\). In an \(X\)-then-\(Y\) systematic sweep, both coordinates have been redrawn independently by the end of the sweep, regardless of the starting state. The sweep matrix has every entry \(1/4\); each row sums to \(1/4+1/4+1/4+1/4=1\), and multiplying the uniform target by it returns the uniform target.

For random scan with equal selection probabilities, the transition matrix is

$$ R= \begin{bmatrix} 1/2&1/4&1/4&0\\ 1/4&1/2&0&1/4\\ 1/4&0&1/2&1/4\\ 0&1/4&1/4&1/2 \end{bmatrix}. $$

Row check: its four row sums are \(2/4+1/4+1/4+0=1\), \(1/4+2/4+0+1/4=1\), \(1/4+0+2/4+1/4=1\), and \(0+1/4+1/4+2/4=1\). Starting at \(++\), one random-scan step gives the first row \((1/2,1/4,1/4,0)\), not the target \((1/4,1/4,1/4,1/4)\). By contrast, one systematic sweep gives the target exactly. Both kernels preserve the target, but preservation alone does not specify how quickly a chain started away from it changes distribution.

A Common Scan-Schedule Error

A tempting but incorrect calculation is to represent an \(X\)-then-\(Y\) systematic sweep by the average \((K_X+K_Y)/2\). Averaging means that one of the two updates is selected for a single step; it is the random-scan rule, not the fixed-order rule. For the correlated binary target, starting at \(++\), the probability of ending at \(++\) after a systematic sweep is \((3/4)(3/4)=9/16\): \(X\) must first remain \(+\), then \(Y\) must remain \(+\). The random-scan probability of \(++\) in one step from \(++\) is \((1/2)(3/4)+(1/2)(3/4)=3/4\). Confusing the two gives \(3/4\) where the systematic entry is \(9/16\). The correction is to compose the update kernels in order for a sweep, and to average them only when the algorithm actually chooses one component at random per step.

Scan choice matters because it changes what counts as a step, which configurations can be reached in that step, and how dependence between components is removed. In practice, compare schedules at a stated computational cost—for example, one component update versus one full sweep—and examine the transition behavior relevant to the target. The invariant distribution is essential for correctness, but it is not by itself a measure of mixing.

Check Your Understanding

Use the definitions and calculations above to check the distinction between invariance and scan behavior.

  1. For a finite positive target, explain why updating one component conditionally leaves the joint target distribution unchanged.
  2. For equal scan probabilities, explain why \((K_X+K_Y)/2\) describes one random-scan step rather than an \(X\)-then-\(Y\) sweep.
  3. For the correlated binary target, compute the probability of reaching \(--\) in one systematic sweep starting from \(++\).
  4. For the uniform independent target, what distribution results from one random-scan update starting at \(++\), and why is it not yet the target?
  5. Why does the fact that both schedules have the same invariant distribution not imply that their chains have the same convergence behavior?