What MCMC Convergence Means in a Joint Model
Bayesian shared-random-effects joint models can have posterior distributions that are difficult to explore. Longitudinal and event-time information both contribute to inference about subject-specific random effects, and the association parameters can be strongly related to other model parameters. A chain may therefore move slowly through the posterior, or appear stable while sampling only a restricted region. Convergence diagnostics assess the behavior of the simulation; they do not establish that the model is correctly specified or that its parameters are well identified.
For subject \(i\), let \(Y_i\) denote the longitudinal observations and let \(T_i\) and \(\delta_i\) denote the observed event or censoring time and event indicator. Write \(\theta\) for the model parameters and \(b=(b_1,\ldots,b_N)\) for the subject-specific random effects. The posterior target is
An MCMC algorithm generates a sequence of draws intended to have this posterior as its stationary distribution. A chain is useful for posterior summaries only if it has reached the target distribution sufficiently well and explores the relevant parts of that distribution. The diagnostics here are applied not just to coefficients, but also to random-effect variance components, association parameters, survival quantities, and scientifically relevant functions of the parameters.
Diagnostics rely on more than the appearance of a graph. The transition mechanism must target the specified posterior and be able to reach its relevant regions; standard ergodicity conditions are used to justify long-run averages. For Monte Carlo standard errors and central-limit approximations, suitable posterior moments and dependence conditions are also needed. In practice, run multiple chains from dispersed initial values, use the algorithm's warmup or adaptation period as intended, and calculate diagnostics from post-warmup draws. No finite diagnostic can prove that all mathematical conditions hold.
Trace Plots: Inspecting the Chains Directly
A trace plot displays successive post-warmup draws of a scalar quantity against iteration, with separate traces for the different chains. Plot parameters that matter scientifically as well as parameters that may be hard to sample: for example, an association parameter, a random-intercept variance, a random-slope variance, and a derived hazard ratio. For a high-dimensional random-effects vector, inspect representative subject effects and summaries of the random-effects distribution rather than relying on one trace.
A reassuring trace generally fluctuates around a stable level, with chains overlapping and moving through similar ranges. Warning signs include a sustained trend, long flat stretches, abrupt jumps between separated regions, chains staying in different ranges, or one chain with much less variability than the others. These patterns suggest drift, sticking, poor mixing, or incomplete exploration. A trace that looks like stationary noise is not proof of convergence: a chain trapped in one part of the posterior can look stable there.
Worked Example: Reading a Trace for an Association Parameter
Suppose four chains are used for the shared-parameter association coefficient \(\alpha\), on the log-hazard scale per one-unit increase in the linked longitudinal quantity. After warmup, each trace is inspected across 4,000 iterations. Chains 1 and 2 fluctuate around 0.4, while chains 3 and 4 fluctuate around 1.1; each stays in its own range and shows little overlap.
This pattern is evidence against treating the pooled 16,000 draws as a single well-mixed sample. The chains may not have reached the same posterior region, or movement between regions may be very slow. Their different trace levels are a warning even before calculating a summary statistic. The appropriate next step is to investigate the fit and sampling behavior, for example by checking the model and parameterization and running longer or better-tuned chains from dispersed starts. Averaging these chains would not resolve the disagreement.
The units matter: \(\alpha\) is on the log-hazard scale per one-unit increase in the linked longitudinal quantity. If that quantity is measured in different units, the numerical coefficient and its interpretation change accordingly.
Split R-hat: Comparing Within- and Between-Chain Variation
The basic split R-hat compares variation within chains with variation between chains. Splitting each chain in half makes the comparison more sensitive to changes between an early and late part of a chain. Suppose there are \(m\) original chains, each with \(2n\) post-warmup draws. Treat the first and second halves as \(2m\) split chains of length \(n\). For one scalar quantity, let \(\bar{\theta}_{j}\) and \(s_j^2\) be the mean and variance of split chain \(j\). Define the average within-chain variance \(W\), the between-chain variance \(B\), and the estimated marginal variance \(\widehat{V}\) as follows:
Here \(\bar{\theta}_{\cdot}\) is the mean of the \(2m\) split-chain means. When chains have similar distributions, between-chain variation should be comparable to within-chain variation and \(\widehat{R}\) should be close to 1. A value noticeably above 1 indicates that chain means differ relative to their within-chain variation. Modern software commonly reports rank-normalized split R-hat, often with a folded version to detect scale differences as well as location differences. Use the software's documented version and thresholds; the basic calculation below explains the within-versus-between comparison.
Worked Example: Calculating Basic Split R-hat
Suppose four split chains each contain \(n=100\) draws for a scalar parameter. Their means are 1.0, 1.1, 0.9, and 1.0, and each has sample variance 0.0400. The grand mean is \(\bar{\theta}_{\cdot}=1.0\), so
Then
The between-chain differences are large relative to within-chain variation, and this value is not close enough to 1 to offer reassurance under common modern diagnostic practice. It is a warning to investigate and improve sampling, not a test that gives the probability that convergence has or has not occurred. A threshold such as 1.01 is a practical screening convention for modern R-hat, not a universal mathematical guarantee.
Effective Sample Size and Monte Carlo Precision
MCMC draws are dependent, so the number of iterations is not the number of independent draws. For a scalar quantity with lag-\(t\) autocorrelation \(\rho_t\), an intuitive effective sample size is
where \(N\) is the total number of draws being summarized. The denominator is the integrated autocorrelation time: positive dependence reduces effective information, while negative dependence can increase it. In real applications, autocorrelations must be estimated and the infinite sum handled with a stable truncation or a modern multi-chain estimator. Software may report bulk effective sample size for central posterior behavior and tail effective sample size for quantiles or tail probabilities; these answer different precision questions.
For estimating a posterior mean, an approximate Monte Carlo standard error is the posterior standard deviation divided by the square root of the effective sample size. A large effective sample size is not a universal pass: adequacy depends on the precision needed for the reported quantity. Tail probabilities and quantiles can need more effective draws than a posterior mean.
Worked Example: Autocorrelation and Effective Sample Size
Consider \(N=2{,}000\) post-warmup draws of \(\alpha\). As a simplified illustration, suppose the lag autocorrelations follow \(\rho_t=0.8^t\). The geometric sum is \(\sum_{t=1}^{\infty}0.8^t=0.8/(1-0.8)=4\), so the integrated autocorrelation time is
Thus 2,000 highly correlated draws contain roughly the information about a posterior mean that 222 independent draws would contain, under this simplified autocorrelation pattern. If the posterior standard deviation of \(\alpha\) is 0.30, the approximate Monte Carlo standard error of its posterior mean is
This is simulation error in estimating the posterior mean, not the posterior uncertainty about \(\alpha\) itself. The posterior standard deviation remains 0.30. In practice, use the sampler's multi-chain effective sample size estimate rather than assuming a geometric autocorrelation pattern.
Comparing Chains and Acting on Diagnostics
Use trace plots, split R-hat, and effective sample sizes together. Trace plots show how behavior changes over iteration; split R-hat detects disagreement across chains or across halves; effective sample size quantifies the information available for a particular summary. Chain comparisons should also include posterior summaries by chain, such as means, standard deviations, and quantiles. Agreement in means alone is insufficient if scales or tails differ.
The following sequence helps organize the checks without turning them into a mechanical pass/fail ritual.
Include every parameter used for scientific conclusions, important variance and association parameters, and relevant derived quantities. A global diagnostic can hide trouble in one parameter.
Look for drift, trapping, different ranges, scale differences, and disagreements between early and late portions. Investigate suspicious traces rather than relying on a single aggregate statistic.
Use the sampler's documented modern diagnostics, including bulk and tail effective sample sizes when available. A problematic R-hat flags disagreement; a low effective sample size flags limited Monte Carlo information.
Check sampler warnings and parameterization, assess scaling and posterior dependence, and consider tuning or longer runs. Then rerun diagnostics. More iterations can help slow mixing but cannot guarantee that a chain trapped in a region will find another one.
Different convergence assessments have different roles. Trace plots and chain-specific summaries are visual and interpretable but can miss subtle issues in many dimensions. Split R-hat is a compact cross-chain comparison but may look acceptable when all chains share the same failure. Effective sample size estimates simulation efficiency but does not establish that the chains sampled the right posterior. Monte Carlo standard errors translate effective sample size into precision for an estimate, but only conditional on adequately exploring the target. These diagnostics complement, rather than replace, examination of the model, sampler behavior, and posterior summaries.
Common remedies depend on the failure mode. If traces show poor movement and high autocorrelation, improve parameter scaling or the sampler's tuning and run longer; if chains disagree, retain dispersed initializations and investigate why they remain separated. Thinning is not a general solution to poor mixing: it reduces storage and may reduce dependence among retained draws, but it does not create the information that a longer, better-mixing run would provide. Similarly, discarding more warmup does not fix persistent drift or chain disagreement.
Common Pitfalls and Limits
- Treating an R-hat near 1 as proof. All chains can be similarly trapped in the same region. Check traces, chain-specific summaries, and whether the starting points were meaningfully dispersed.
- Calling every large run adequate. A large iteration count can still yield a small effective sample size when draws are strongly autocorrelated.
- Checking only model coefficients. Variance components, random effects, association parameters, and derived survival quantities can mix differently. Diagnose the quantities used in inference.
- Confusing posterior uncertainty with Monte Carlo error. Posterior spread describes uncertainty about a parameter under the model and data; Monte Carlo error describes numerical uncertainty from approximating posterior summaries with finite simulation.
- Assuming convergence diagnostics assess model validity. They address sampling behavior, not whether the shared-random-effects assumptions or likelihood are appropriate.
A final limitation is that all diagnostics are finite-sample evidence. In particular, apparently overlapping traces and favorable summaries can fail to reveal slowly traversed regions of a complex posterior. Report what was checked and whether diagnostics raised concerns; do not claim that a numerical threshold proves convergence.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- Four chains have overlapping trace plots for a variance parameter, but the traces show long flat stretches. What concern remains, and which diagnostic would help quantify it?
- What does a split R-hat appreciably above 1 indicate, and what does it not establish?
- A run has 10,000 draws but an effective sample size of 250 for a posterior mean. Explain what this says about Monte Carlo information.
- Why is thinning not a sufficient remedy for chains that remain in different ranges?
Solutions. (1) The flat stretches suggest sticking and strong serial dependence despite overlap. Effective sample size, together with trace inspection, helps quantify the information loss. (2) It indicates that between-chain or between-half variation is large relative to within-chain variation, so the chains may not yet be sampling the same distribution. It does not give the probability that convergence failed, nor does a value near 1 prove convergence. (3) For that quantity, the dependent 10,000 draws provide roughly the Monte Carlo information of 250 independent draws under the effective-sample-size approximation; adequacy depends on the precision required. (4) Retaining fewer draws cannot make chains explore regions they have not reached. The disagreement needs investigation and improved exploration, not merely a lower stored draw count.