Why Mixing Diagnostics Matter
A commensurate model lets the current-trial parameter be informed by a historical parameter while allowing the strength of that relationship to vary. An MCMC algorithm can target the intended posterior distribution and still explore it too slowly or unevenly for its reported summaries to be trustworthy. This is especially important when the commensurability precision is uncertain: a chain may spend too long in one range of precision, making the apparent amount of historical borrowing depend on its starting point.
The purpose of diagnostics is not to certify that a model is correct. They assess whether the simulation has adequately explored the specified posterior. A well-mixed chain does not establish that historical and current data are clinically exchangeable; a poorly mixed chain does not establish conflict. Those are inferential and modeling questions, distinct from whether the numerical computation has sampled its target reliably.
The Target and the Quantities to Diagnose
For clarity, consider a single historical source. Let \(\theta_H\) be its parameter, \(\theta_C\) the corresponding current-trial parameter, and \(\tau\) the commensurability precision. A common specification is \(\theta_C\mid\theta_H,\tau\sim N(\theta_H,1/\tau)\), with \(\tau>0\). The historical and current data contribute their respective likelihoods, and the prior specifies distributions for \(\theta_H\) and \(\tau\). MCMC aims to sample from the resulting joint posterior of \((\theta_H,\theta_C,\tau)\), or from a marginal posterior if some parameters are integrated out.
This specification presumes that the likelihoods and prior distributions are appropriate for the data and that the posterior is proper. It also presumes the MCMC transition procedure is implemented to target this posterior. Standard chain diagnostics further rely on running chains long enough to reach the posterior's typical regions and on having enough saved draws to assess their behavior. If a posterior has separated modes, very heavy tails, or a boundary concentration, ordinary diagnostics may be insufficient.
A precision is an inverse variance, so small \(\tau\) makes \(\theta_C\) weakly constrained toward \(\theta_H\); large \(\tau\) makes the two parameters more tightly linked. For diagnosing the implication of \(\tau\), it is often useful to inspect a borrowing weight as well. For example, suppose the current-data likelihood for \(\theta_C\) is normal with estimate \(y\) and variance \(V\), and condition on \(\theta_H\) and \(\tau\). The conditional posterior mean of \(\theta_C\) is a weighted average of \(y\) and \(\theta_H\):
Here \(w\) is the historical weight under this normal-likelihood example. It approaches zero as \(\tau\) approaches zero, and approaches one as \(\tau\) grows. The exact borrowing summary depends on the likelihood and model; the essential diagnostic principle is to examine quantities that express the inferential consequence of \(\tau\), not only its raw numerical scale.
Trace Plots and Between-Chain Checks
A trace plot places saved MCMC draws against iteration, usually with a separate line for each independently initialized chain. After any warm-up period is removed, a reasonably exploring chain should fluctuate through its posterior region without persistent trends, long unexplained plateaus, or prolonged separation from other chains. Different chains should overlap in the regions they visit. The appearance of a trace is a useful first check, but visual overlap alone cannot prove convergence.
Use multiple chains with dispersed initial values where feasible. If all chains start close together, they may share the same failure to find a distant region. Conversely, chains initialized at deliberately different values can reveal whether they move toward a common distribution. Inspect traces for \(\theta_C\), \(\theta_H\), \(\tau\), and relevant derived quantities such as \(w\). For a positive, skewed precision parameter, traces of \(\log\tau\) can be easier to inspect than traces of \(\tau\); also inspect \(w\), since it is bounded and directly indicates the borrowing implied by the precision.
The classical potential scale reduction diagnostic compares variation within chains with variation between their means. For \(m\) chains of \(n\) post-warm-up draws each, let \(s_j^2\) be the sample variance in chain \(j\), and let \(W\) be their average. Let \(B\) be \(n\) times the sample variance of the \(m\) chain means. Then a basic estimate of the marginal posterior variance and the associated diagnostic are
Values near one indicate that within-chain and between-chain variation are similar, as expected when chains have explored a common distribution. This is a diagnostic signal, not a proof. Modern practice commonly uses split, rank-normalized versions of \(\widehat{R}\), which compare chain halves and are more sensitive to some forms of nonstationarity and non-normal marginal distributions. A value meaningfully above one calls for investigation; a value near one should still be checked against traces, effective sample sizes, and model-specific behavior.
Worked Example: Comparing Four Chains
Suppose four hypothetical post-warm-up chains each contain \(n=1{,}000\) draws for a log-hazard effect. Their chain means are \(0.00,\ 0.05,\ -0.02,\ 0.03\), and their sample variances are all approximately \(0.25\). The traces fluctuate without visible trends, and the chains overlap.
The average within-chain variance is \(W=0.25\). The mean of the four chain means is \(0.015\). Their sample variance is \((0.0029/3)=0.0009667\), so \(B=1{,}000(0.0009667)=0.9667\). Therefore,
This calculation is consistent with the visual impression that the chains overlap. It does not prove adequate exploration: a shared mode missed by every chain would not be exposed by this comparison. The conclusion is appropriately limited: these checks provide no evident sign of disagreement among the four chains for this parameter, so the analyst should also examine other parameters and effective sample sizes.
Effective Sample Size and Monte Carlo Error
Successive MCMC draws are usually autocorrelated. Consequently, \(N\) saved draws generally contain less information about a posterior summary than \(N\) independent draws. For a scalar quantity with lag-\(k\) autocorrelation \(\rho_k\), the integrated autocorrelation time is \(\tau_{\mathrm{int}}=1+2\sum_{k=1}^{\infty}\rho_k\), when the sum is well behaved. The effective sample size (ESS) is approximately the number of saved draws divided by this autocorrelation time.
This expression follows from the variance of a sample mean. If each draw has marginal variance \(\sigma^2\), the variance of the average of \(N\) stationary draws is \[ \operatorname{Var}(\bar{X}) = \frac{\sigma^2}{N^2} \left[N+2\sum_{k=1}^{N-1}(N-k)\rho_k\right]. \] When the autocorrelation sum is adequately approximated by its long-run value, this is approximately \(\sigma^2\tau_{\mathrm{int}}/N\). Equating it to the variance \(\sigma^2/N_{\mathrm{eff}}\) of an average of independent draws gives the ESS formula. Thus, ESS describes simulation efficiency for a particular posterior quantity, not the amount of information in the clinical data.
Monte Carlo standard error (MCSE) measures numerical uncertainty in an estimated posterior summary due to using a finite simulation. For estimating a posterior mean, a useful approximation is the posterior standard deviation divided by the square root of ESS. ESS for a mean need not be adequate for a tail probability or quantile, so inspect bulk and tail ESS, or the corresponding diagnostics provided by the software, when those summaries matter.
Worked Example: Effective Sample Size from Autocorrelation
Consider a hypothetical chain of \(N=2{,}000\) draws for a treatment log-hazard effect. Suppose its autocorrelation is well described by an autoregressive pattern with lag-one correlation \(0.70\), so that \(\rho_k=0.70^k\). For this pattern, the sum of the positive-lag correlations is \(0.70/(1-0.70)=2.333\). The estimated autocorrelation time and ESS are therefore
If the posterior standard deviation of the log-hazard effect is \(0.40\), the approximate MCSE of its posterior mean is \(0.40/\sqrt{353}=0.0213\) log-hazard units. The chain contains 2,000 recorded values, but for estimating this mean it has roughly the precision of 353 independent draws. This is an approximation based on the stated autocorrelation pattern; in practice, ESS is estimated from the observed chain and should be interpreted with its diagnostic assumptions in mind.
Precision Parameters and Near-Zero Borrowing
Precision parameters can be particularly difficult to diagnose. They are positive, may be highly skewed, and may have substantial posterior mass near zero. A chain can move slowly across orders of magnitude while appearing stable on a raw scale, or a few large draws can dominate a raw-scale mean. For this reason, examine \(\tau\) together with \(\log\tau\), relevant quantiles, and a borrowing summary such as \(w\). If there are multiple historical sources, inspect the corresponding \(\tau_j\) and borrowing summaries source by source.
A posterior concentrated near \(\tau=0\) can be a genuine model result: it implies little constraint of the current parameter toward the historical parameter under the commensurate prior. But a chain trapped near zero can produce the same-looking marginal trace. Distinguish these cases by comparing independent chains initialized across plausible values, checking whether they all explore the same low-precision region, and checking ESS and \(\widehat{R}\) for both the transformed precision and borrowing summaries. If chains remain separated, the posterior evidence for weak borrowing is not yet reliably computed.
Worked Example: Checking a Posterior Near Zero Precision
Suppose a hypothetical commensurate analysis has current-data likelihood variance \(V=0.04\) for an effect measured in log-hazard units. Four chains, initialized at dispersed precision values, produce overlapping traces for \(\log\tau\) and \(w\). The reported median of \(\tau\) is \(0.10\), its 95% posterior interval is \([0.005,\ 0.62]\), the split \(\widehat{R}\) for \(\log\tau\) is \(1.01\), the ESS for \(w\) is \(1{,}800\), and the ESS for \(\tau\) is \(95\).
At the median precision, the conditional historical weight is
At the upper endpoint \(0.62\), the same calculation gives \(w=(0.04)(0.62)/[1+(0.04)(0.62)]=0.0242\). Thus, for this illustrative normal-likelihood calculation, even the stated upper endpoint corresponds to a small conditional historical weight. The chains' overlap and the large ESS for \(w\) support stable estimation of this borrowing summary, while the smaller ESS for \(\tau\) warns that raw precision summaries may be less stable. These results are evidence that the posterior favors little borrowing in this example, not proof that the model or its assumptions are correct.
Responding to Warning Signs
When diagnostics are unsatisfactory, first determine which quantity is problematic. A stable treatment-effect trace does not guarantee that \(\tau\) or a tail probability is well explored. Look for persistent chain separation, long plateaus, trends, abrupt transitions between regions, low bulk or tail ESS, and materially different summaries across chains. In a commensurate model, also ask whether a problem occurs on the raw precision scale, on the log scale, or in the implied borrowing weight.
Verify the likelihood, prior, support of \(\tau\), and any transformations. A positive precision represented as \(\log\tau\) requires the correct transformed density, including the Jacobian when the density is specified on the \(\tau\) scale.
Use trace plots and split-\(\widehat{R}\) to identify persistent differences in locations or regions explored. Extend warm-up if chains have not reached stable behavior, then reassess rather than assuming that extra iterations solved the problem.
If chains agree but ESS is low, longer runs may reduce MCSE. If chains remain separated or move poorly between regions, consider an appropriate reparameterization, better-tuned transitions, or a sampler that better handles the posterior geometry.
After changing computation, reassess \(\theta_C\), \(\tau\), \(w\), and the posterior summaries needed for the trial decision. A change that improves one parameter's diagnostics may not fix another's.
Thinning, which retains only every \(k\)th draw, is not a general cure for poor mixing: it discards draws and does not make chains explore regions they cannot reach. It may reduce storage or facilitate particular downstream calculations, but longer or better-targeted simulation is generally preferable for increasing effective information. If the posterior has difficult geometry, reparameterization or a suitable alternative sampler may be more effective than simply increasing the iteration count. Numerical integration can be useful in low-dimensional models as an independent check, but it does not replace diagnosing the MCMC procedure used for the reported results.
Common Mistake and Practical Limits
A common mistake is to see all chains near \(\tau=0\) and conclude either that borrowing is truly negligible or that MCMC has failed. Neither conclusion follows from the trace alone. If independently initialized chains move and overlap in that region, and diagnostics for \(\log\tau\) and \(w\) are adequate, near-zero borrowing may be a stable posterior finding. If chains are stuck at their initial values or disagree, the posterior summary is computationally unreliable. The distinction requires multiple diagnostics and, where possible, checks under altered initializations or sampling strategies.
No finite diagnostic can establish convergence with certainty. Chains can share an unvisited mode, ESS estimates can be unreliable for extremely slow or nonstationary behavior, and different summaries can mix at different rates. Diagnostics also cannot determine whether the commensurate prior is clinically appropriate. Report the chain setup, warm-up and retained draws, diagnostics for key parameters and derived quantities, and any remedial steps. Interpret precision and borrowing summaries as properties of the fitted model, not as stand-alone tests of compatibility.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- Why can 5,000 saved MCMC draws provide much less information than 5,000 independent draws?
- Four chains have \(\widehat{R}\) close to one for \(\theta_C\), but their traces for \(\log\tau\) remain separated. What can you conclude?
- For \(V=0.10\) and \(\tau=0.20\), calculate the conditional historical weight \(w\) from the normal-likelihood example.
- Why is a trace plot of \(\tau\) alone potentially inadequate when the posterior is concentrated near zero?
Solutions. (1) Autocorrelation makes successive draws redundant, reducing ESS below the saved draw count and increasing Monte Carlo error. (2) The effect-parameter diagnostic does not establish adequate exploration of the precision parameter; investigate the separated chains and do not rely on precision-dependent borrowing summaries until diagnostics improve. (3) \(w=(0.10)(0.20)/[1+(0.10)(0.20)]=0.02/1.02=0.0196\), so the conditional historical weight is about 0.0196. (4) The positive precision may be skewed or vary across orders of magnitude, and a raw-scale trace can conceal slow movement or boundary behavior; inspect \(\log\tau\), independent chains, and the implied borrowing summary as well.