Tutorials › Generalized Linear Mixed Models (GLMM) › Initializing MCMC Chains for Variance Components

Bayesian GLMM and Prior Specification for Variance Components · Tutorial 279 of 698

Initializing MCMC Chains for Variance Components

Learn to construct and check dispersed, plausible initial states for multiple chains, including variance scales, correlated effects, and latent variables.

Advanced 12 min read

What You'll Learn

  • Explain why each chain must start in the target distribution’s support, but need not start at a posterior draw.
  • Choose distinct variance-component starts that are plausible on the model’s data and prior scales.
  • Convert between standard-deviation, variance, and unconstrained log-scale initial values.
  • Initialize correlated random effects without violating covariance-matrix constraints.
  • Check that augmented latent variables are consistent with the observed outcomes.
  • Recognize how identical or extreme starts can conceal limited exploration.

Why Initial Values Matter

MCMC initialization is a practical design choice with statistical consequences. A chain started at a single convenient value may take a long time to explore a distant part of the posterior, particularly when a variance component is weakly identified or near zero. Conversely, implausibly extreme initial values can produce numerical failures that say more about the starting point than about the model. With multiple chains, the goal is to use starting states that are different enough to reveal dependence on initialization, but plausible enough to let the sampler operate in the region supported by the model and data.

This tutorial concerns initial states for variance components and associated GLMM parameters. It does not prescribe a warmup schedule or a formal mixing diagnostic. Those are separate questions. Here, the key tasks are to define what makes a starting state valid, select meaningful variation across chains, and check that no construction quietly suppresses variation in the parameters of interest.

Definition: An initial state for an MCMC chain is a complete assignment of values to every parameter and any auxiliary or latent variable used by the sampler at iteration zero. A valid initial state lies in the support of the model’s target distribution and satisfies all constraints required by the parameterization and update algorithm.

For example, in a random-intercept GLMM, a model might use

$$ g\{E(Y_{ij}\mid b_j)\}=x_{ij}^{\mathsf T}\beta+b_j,\qquad b_j\mid \tau \sim N(0,\tau^2). $$

Here \(Y_{ij}\) is the response for observation \(i\) in group \(j\), \(x_{ij}\) is its predictor vector, \(\beta\) is the fixed-effect coefficient vector, and \(\tau\) is the random-intercept standard deviation. A complete state may need to include \(\beta\), \(\tau\), every \(b_j\), and any extra variables introduced by the chosen sampling scheme. Initializing \(\tau\) but leaving other state variables inconsistent or undefined is not a complete initialization.

Validity, Plausibility, and Dispersion

Three checks should be kept distinct. Validity means the state obeys the model’s support and parameter constraints. For a positive standard deviation, for instance, \(\tau>0\). Plausibility means that the state is not so far from scales supported by the prior and data that the sampler encounters avoidable numerical problems. Dispersion means that separate chains begin at meaningfully different, valid points. A set of starts can satisfy any two of these properties and fail the third.

For a variance component \(\tau^2\), it is often clearer to choose a few initial values on the standard-deviation scale, because their size is easier to interpret in relation to the linear predictor or response. The corresponding variance is obtained by squaring. If the sampler uses an unconstrained parameter \(u=\log(\tau)\), transform each positive proposed value by taking its logarithm. For example, \(\tau=0.5\) corresponds to \(\tau^2=0.25\) and \(u=\log(0.5)\approx-0.6931\). These are three representations of the same starting point, not three distinct starts.

“Dispersed” does not mean selecting the largest and smallest numerically possible values. A near-zero variance may be useful if it is scientifically plausible, but an astronomically large variance can make fitted linear predictors extreme and likelihood calculations unstable. The prior, predictor scaling, response pattern, and substantive scale all inform what counts as plausible. If the posterior plausibly concentrates near zero, include a small positive start rather than setting a positive-only scale parameter to exactly zero.

Worked Example: Selecting Random-Intercept Starts

Suppose a hypothetical binary-outcome GLMM has a random-intercept standard deviation \(\tau\) for clinics. For this illustration, assume the prior and a preliminary scale check make standard deviations from about \(0.1\) to \(1.0\) plausible. Construct three dispersed starting values and express them on the variance and log-standard-deviation scales.

Choose \(\tau_1=0.1\), \(\tau_2=0.5\), and \(\tau_3=1.0\). The corresponding variances are

$$ \tau_1^2=0.1^2=0.01,\qquad \tau_2^2=0.5^2=0.25,\qquad \tau_3^2=1.0^2=1.00. $$

If the sampler stores \(u=\log(\tau)\), the starting values are

$$ u_1=\log(0.1)\approx-2.303,\qquad u_2=\log(0.5)\approx-0.6931,\qquad u_3=\log(1.0)=0. $$

All three starts are positive on the \(\tau\) scale and distinct on the log scale. In this hypothetical setup, they span the stated plausible range rather than using a zero variance or an extreme value. The three chains should also have complete values for the fixed effects and clinic effects. For example, a common fixed intercept can be initialized at the logit of a rough baseline response rate; the clinic effects can be set to zero or to modest values on the linear-predictor scale, provided the construction is valid for the sampler. Starting all clinic effects at zero is a choice to assess critically, not an automatic guarantee of adequate exploration.

Correlated Random Effects Need Valid Starts

For random intercepts and slopes, the group-level effects may be modeled jointly as \(b_j\sim N(0,G)\), where \(G\) is a covariance matrix. A valid covariance or correlation matrix must be positive semidefinite. Positive definiteness is required when the model specifically assumes a nonsingular covariance matrix or when a particular computational factorization requires it; it is not the general definition of covariance-matrix validity. A positive-semidefinite matrix may be singular, as with perfectly correlated components.

If the model represents \(G\) using standard deviations \(\tau_0,\tau_1\) and correlation \(\rho\), then

$$ G= \begin{pmatrix} \tau_0^2 & \rho\tau_0\tau_1\\ \rho\tau_0\tau_1 & \tau_1^2 \end{pmatrix}. $$

For positive \(\tau_0,\tau_1\), a two-dimensional correlation matrix is valid when \(-1\leq \rho\leq 1\). If the parameterization or sampler requires a nonsingular matrix, the start must instead use \(-1<\rho<1\). Check the actual computational requirement rather than treating positive definiteness as a universal validity condition.

Worked Example: Checking Two Correlated-Effect Starts

Consider hypothetical random-intercept and random-slope standard deviations. For one chain, choose \(\tau_0=0.4\), \(\tau_1=0.2\), and \(\rho=0.5\). Substitution gives

$$ G_1= \begin{pmatrix} 0.4^2 & (0.5)(0.4)(0.2)\\ (0.5)(0.4)(0.2) & 0.2^2 \end{pmatrix} = \begin{pmatrix} 0.16 & 0.04\\ 0.04 & 0.04 \end{pmatrix}. $$

Its diagonal entries are nonnegative, and its determinant is \(0.16(0.04)-0.04^2=0.0048>0\), so this matrix is positive definite. A second chain could use the same standard deviations and \(\rho=-0.5\), giving covariance \(-0.04\) and the same positive determinant. These starts differ in their assumed intercept-slope association while remaining valid and nonsingular.

By contrast, setting \(\rho=1\) gives a singular correlation matrix. That matrix is positive semidefinite and can describe perfectly correlated effects, but it is not a valid start for an algorithm that requires a nonsingular Cholesky factor or restricts correlations to the open interval \((-1,1)\). In that case, choose an interior value such as \(0.9\), and verify the resulting matrix and computational constraints.

Why Plausible Starts Do Not Remove Initialization Effects

A Markov chain can be started away from the posterior distribution. Let \(\pi\) denote the target posterior distribution, \(P\) the transition rule, and \(\pi_0\) the distribution induced by the chosen initial state. After \(m\) transitions the chain has distribution \(\pi_0P^m\), which need not equal \(\pi\). If the transition rule preserves \(\pi\), then starting with \(\pi_0=\pi\) would keep the chain distributed as \(\pi\); otherwise, the chain must move toward the target through its transitions. This is why a starting point is not itself evidence that posterior exploration has occurred.

The value of using multiple distinct starts is practical: it makes it harder for all chains to inherit the same unexamined choice of variance scale. It does not guarantee that the chains will explore the same posterior region, nor does apparent agreement prove that they have explored all relevant regions. A useful design deliberately varies the variance components while keeping each state plausible and valid.

Justification: Suppose every chain begins at the same state \(s\). Then all chains share the same initial value for every parameter, including each variance component. Any comparison among the chains cannot reveal sensitivity to the starting variance values, because there is no between-chain starting variation in those values. Distinct valid starts do not prove convergence, but they allow subsequent chain behavior to expose some initialization sensitivity that identical starts cannot expose.

Initial Values for Augmented Models

Some GLMM samplers augment the state with latent variables. These variables must be initialized consistently with both the observed data and the augmentation scheme. For example, in a binary probit model with latent response \(Z_i\), the observed outcome is \(Y_i=1\) when \(Z_i>0\) and \(Y_i=0\) when \(Z_i<0\). Thus a starting latent value on the wrong side of zero is not a valid state for that augmentation. In other samplers, a particular latent variable may be drawn conditionally as part of the first update; follow the sampler’s specified state definition.

Worked Example: Consistent Latent-Variable Starts

Suppose a hypothetical probit GLMM has three observations with outcomes \(Y=(1,0,1)\) and initial linear predictors \(\eta=(0.4,-0.2,0.1)\). The latent variables must satisfy \(Z_1>0\), \(Z_2<0\), and \(Z_3>0\). One possible starting assignment is \(Z=(0.7,-0.5,0.3)\). Each value has the correct sign for its observed outcome.

An assignment such as \(Z=(0.7,0.1,0.3)\) is invalid for this augmentation because \(Y_2=0\) requires \(Z_2<0\), yet the proposed value is positive. The correction is not to ignore the inconsistency or to change the observed outcome; initialize \(Z_2\) on the negative side, or use the sampler’s prescribed conditional initialization. The random effects and fixed effects should also be part of a complete state, and the latent values should be generated or selected in a way compatible with those current predictors and the augmentation.

Practical Construction and Failure Modes

A careful initialization can be organized into a short sequence. First list every stored parameter and auxiliary variable. Then choose scales using the model’s prior and the units of the linear predictor. Assign different variance-component values across chains, transform them into the sampler’s coordinates, and check every matrix and latent-variable constraint. Finally, evaluate whether the log posterior or required conditional quantities are finite at each state, if the implementation permits that check.

1
Identify the full state.
Include fixed effects, variance and correlation parameters, group effects, and any latent variables that the sampler requires at initialization.
2
Choose plausible scales.
Use the prior, predictor units, and rough data scale to select values that are distinct but not needlessly extreme.
3
Apply transformations and constraints.
Convert standard deviations to variances or log scales as needed; verify covariance matrices and augmentation-specific restrictions.
4
Check each chain separately.
Confirm that the complete state is finite, valid, and distinct in the variance components intended to be varied.

Several tempting approaches can fail. Initializing every chain at the same posterior mode can make all chains begin in one local region and conceal sensitivity to other variance scales. Starting all variance components at zero is invalid for strictly positive standard-deviation parameters and can be incompatible with some parameterizations. Starting each chain with huge random effects may create extreme logits or near-deterministic fitted probabilities. Finally, assigning independent random effects while claiming to start from a correlated model can be internally inconsistent if the sampler expects a joint state constructed under the current covariance parameters.

A prior draw is one possible source of valid starts, but prior draws can be far from the data-supported region, especially with diffuse priors. A data-informed point, such as a rough fitted value, can be more computationally stable but may place all chains in one narrow region if used identically. A practical compromise is to begin from sensible scales informed by the model and data, then vary the variance and correlation parameters across chains while retaining valid associated effects.

Initialization is only one part of MCMC computation. A valid and dispersed set of starts does not establish that the chain has reached a stationary regime, that it mixes adequately, or that posterior summaries are precise. Those conclusions require examination of the resulting draws with appropriate diagnostics. Here the limitation is important: initialization makes later assessment more informative, but cannot replace it.

Common Mistake

Wrong reasoning: “All chains start at the same posterior mode, so their later agreement shows that the variance components are well explored.” Agreement can result from the shared initialization; it does not establish broad exploration. Correction: Use distinct, plausible starting values for the variance components and associated parameters, then assess the sampled chains using suitable diagnostics. Likewise, do not reject a covariance matrix merely because it is not positive definite: positive semidefiniteness is the general validity condition, while nonsingularity is an additional requirement only when the model or algorithm imposes it.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A chain uses \(\tau=0.3\). What are the variance \(\tau^2\) and log-scale value \(\log(\tau)\), to three significant figures?
  2. Why can starting all chains at the same variance-component values fail to reveal sensitivity to initialization?
  3. For two random effects with standard deviations \(0.5\) and \(0.3\) and correlation \(-0.4\), find the covariance and determine whether the \(2\times2\) matrix is positive definite.
  4. In a latent probit model, what sign restriction applies to \(Z_i\) when \(Y_i=0\)?
  5. Does a valid, dispersed initialization prove that the resulting chains have converged? Explain briefly.

Solutions. (1) \(\tau^2=0.3^2=0.09\), and \(\log(0.3)\approx-1.204\). (2) All chains share the same starting variance values, so their subsequent agreement cannot show whether different starting variance scales would lead to different behavior. (3) The covariance is \((-0.4)(0.5)(0.3)=-0.06\). The determinant is \(0.25(0.09)-(-0.06)^2=0.0225-0.0036=0.0189>0\), with positive diagonal entries, so the matrix is positive definite. (4) \(Z_i<0\). (5) No. Valid, dispersed starts can make assessment more informative, but convergence and adequate exploration require evaluating the sampled chains with appropriate diagnostics.

Clinical Biostats