Tutorials › Multi-Arm Multi-Stage (MAMS) Designs › Diagnosing MCMC Near Decision Boundaries

Bayesian Multi-Arm Approaches · Tutorial 418 of 499

Diagnosing MCMC Near Decision Boundaries

Learn to assess whether MCMC sampling has adequately resolved a posterior decision probability when it lies near the cutoff for an arm decision.

Advanced 11 min read

What You'll Learn

  • Express a posterior arm decision as a probability for a precisely defined event.
  • Diagnose chains using traces, between-chain agreement, and rank-normalized split R-hat.
  • Assess effective sample size for the decision indicator, not only for model parameters.
  • Recognize when rare events, chain disagreement, or a near-cutoff estimate make a decision computationally unstable.
  • Distinguish convergence diagnostics from a formal measure of Monte Carlo error.

Why Decisions Near a Cutoff Need Special Diagnostics

A posterior decision rule often compares a posterior probability with a prespecified cutoff. For example, an arm might be retained if the posterior probability that its treatment effect exceeds a clinically relevant margin is greater than 0.90. If the estimated probability is 0.98, modest simulation instability is unlikely to change that rule. If it is 0.901, a small computational shift could reverse the decision. The nearer the estimate is to the cutoff, the more important it is to establish that the MCMC output has adequately explored the decision-relevant part of the posterior.

The issue is not simply whether the parameter chains look smooth or whether a long run produced many draws. A decision is based on a particular posterior event, such as an arm exceeding a margin or having the highest utility. The chain must estimate the probability of that event reliably. Diagnostics should therefore focus on the event that defines the decision, as well as on relevant model quantities.

Definition: Let \(D\) be a prespecified posterior event relevant to an arm decision, and let \(q=P(D\mid y)\) be its posterior probability given observed data \(y\). A cutoff rule retains the arm when \(q>c\), where \(c\) is a prespecified probability threshold. MCMC diagnostics near the decision boundary assess whether the sampled chains have adequately explored the posterior distribution needed to estimate \(q\), especially when \(q\) is close to \(c\).

This discussion assumes that the posterior model and the event \(D\) have been specified correctly, that the MCMC transition method targets that posterior, and that retained draws are intended to represent its stationary distribution. Convergence diagnostics address computational sampling; they do not establish that the likelihood, prior, or decision rule is scientifically appropriate. The earlier material on computing decision probabilities with MCMC gives the basic estimate: evaluate the event at each retained draw and average the resulting indicators.

Diagnose the Quantity That Drives the Decision

For retained draws \(\theta^{(1)},\ldots,\theta^{(M)}\), define \(I_m=1\) if draw \(m\) satisfies \(D\), and \(I_m=0\) otherwise. The MCMC estimate is \(\hat q=M^{-1}\sum_{m=1}^M I_m\). The sequence \(I_1,\ldots,I_M\) is itself a chain-derived sequence. Its behavior can differ sharply from that of a treatment-effect parameter: a parameter may move smoothly while the decision event changes rarely, or a parameter chain may appear stable while the event indicator is nearly constant within individual chains.

$$ I_m=\mathbf{1}\{\theta^{(m)}\in D\}, \qquad \hat q=\frac{1}{M}\sum_{m=1}^{M} I_m $$

Use several chains initialized from suitably dispersed starting points, discard warmup according to the sampling procedure, and inspect retained draws. For a boundary-sensitive decision, inspect the event indicator and the quantities defining the event: for instance, a treatment-control contrast and its margin. A useful diagnostic set includes trace plots, chain-specific event proportions, autocorrelation or mixing patterns, effective sample size (ESS), and a between-chain convergence diagnostic.

  • Trace plots: Look for chains that explore comparable ranges without persistent drift, long stuck segments, or distinct chain-specific regions. Plot the decision indicator or event-defining contrast, not just convenient model parameters.
  • Between-chain agreement: Compare each chain’s estimate of \(q\). Large differences can reveal that pooled draws conceal poor exploration.
  • Rank-normalized split R-hat: This compares within-chain and between-chain variation after splitting chains and applying rank-based normalization. Values near 1 indicate better agreement; values above about 1.01 are a warning in many workflows, not a universal pass/fail rule.
  • Event-specific ESS: Calculate or inspect ESS for \(I_m\), as well as for relevant contrasts. A large ESS for a treatment-effect parameter does not guarantee a large ESS for an indicator of a threshold event.

A basic ESS approximation for a scalar chain of length \(M\) is \(M/[1+2\sum_{k=1}^{\infty}\rho_k]\), where \(\rho_k\) is its lag-\(k\) autocorrelation. This motivates why correlated draws provide less information than the same number of independent draws. For a cutoff decision, apply the idea to the indicator sequence: if exceedances cluster into long runs, the indicator is autocorrelated and its effective sample size can be much smaller than the nominal number of draws.

Why Event-Specific ESS Matters

The indicator definition gives a direct justification. Each draw contributes either zero or one to \(\hat q\), so the decision-probability estimate depends on the frequency and clustering of those two values. Autocorrelation in \(I_m\) determines how much the sequence’s repeated exceedances or non-exceedances reduce the information in the run. A parameter’s ESS instead describes the sampling behavior of that parameter; it is not automatically the ESS of a nonlinear event defined by several parameters.

$$ \operatorname{ESS}(I)\ \approx\ \frac{M}{1+2\sum_{k=1}^{\infty}\rho_k(I)} $$

This expression is a diagnostic summary, not a guarantee that a decision is safe. In particular, if an event is very rare, most indicators may be zero. A chain that never visits the event can give a deceptively simple-looking indicator trace, and a conventional ESS calculation may be uninformative or undefined when the indicator has no variation. Such output does not establish that the posterior probability is zero; it may indicate that the sampler has not adequately visited the relevant region.

Worked Example: A Probability Estimate Just Above the Cutoff

Suppose a hypothetical trial’s decision rule retains arm A when \(q=P(\theta_A-\theta_C>5\mid y)>0.90\), with treatment effect measured in points. Four chains each produce 2,500 retained draws. Their event counts are 2,185, 2,245, 2,285, and 2,315.

The pooled estimate is \(\hat q=(2185+2245+2285+2315)/10000=9030/10000=0.903\). Numerically, it exceeds the cutoff by only \(0.903-0.900=0.003\). But chain-specific estimates are \(0.874\), \(0.898\), \(0.914\), and \(0.926\). The range, 0.052, is large relative to the pooled estimate’s distance from the boundary.

Assume the chains were initialized from dispersed values and the event definition is implemented consistently. Even so, this evidence does not support a stable retain decision: chain estimates disagree, and suppose the rank-normalized split R-hat for the event indicator is 1.04, above the usual warning level. The appropriate conclusion is that the decision is computationally unresolved. It is not justified to retain the arm merely because the pooled estimate is 0.903; investigate mixing, run longer or improve sampling, then reassess.

Use Diagnostics Together, Not as a Single Gate

No one diagnostic certifies convergence. R-hat can be close to one when all chains are trapped in the same region. Conversely, a high R-hat is a warning that chains do not yet agree, not a direct measure of how often a decision would change. Trace plots can expose sticking or drifting, but visual inspection alone is subjective. ESS reflects autocorrelation under the sampled chain, but cannot reveal an important region that no chain has visited.

Interpret diagnostics in light of the decision margin \(|\hat q-c|\). When that margin is small, modest chain disagreement or a low event-specific ESS deserves particular attention. If the estimate is far from the cutoff and chains mix well for the event, the computational decision may be more robust. However, “far” is relative: it should be assessed against the variability and stability of the event estimates, not by a fixed universal distance.

For multiple candidate arms, identify every probability or comparison that could change the action. An arm may be retained by exceeding an efficacy probability cutoff, dropped by falling below a futility cutoff, or selected by having the largest utility. Diagnose the corresponding indicator or ranking event for each decision-relevant quantity. Checking only one arm’s effect chain can miss poor exploration of a joint event such as “arm A has the highest utility.”

Worked Example: Stronger Evidence With Event-Level Diagnostics

In another hypothetical analysis, arm B is retained if \(P(\theta_B-\theta_C>3\mid y)>0.90\), with effects in points. Four chains each have 2,500 retained draws, and the event counts are 2,310, 2,320, 2,298, and 2,312.

The pooled estimate is \(\hat q=(2310+2320+2298+2312)/10000=9240/10000=0.924\). The chain-specific estimates are 0.924, 0.928, 0.919, and 0.925, so their range is \(0.928-0.919=0.009\). Suppose the indicator traces show frequent movement between zero and one, the rank-normalized split R-hat is 1.002, and the event-indicator ESS is 2,800. The chains agree much more closely than in the prior example, and the pooled estimate is 0.024 above the cutoff.

These diagnostics support a computationally stable retain decision, subject to the stated model and decision rule. They are not a proof of exact convergence, and this assessment alone does not quantify a formal Monte Carlo error interval. If small changes in the action carry substantial consequences, additional sampling and review remain sensible even when the diagnostics look favorable.

Worked Example: High Parameter ESS Can Hide Poor Decision Sampling

Consider a hypothetical rule that selects arm A if its utility exceeds arm B’s utility, \(D=\{U_A>U_B\}\). Across 8,000 retained draws, a key continuous model parameter has ESS 6,500 and R-hat 1.001. Yet the event occurs 4,080 times overall, with chain-specific event proportions 0.62, 0.56, 0.44, and 0.42.

The pooled event estimate is \(\hat q=4080/8000=0.510\). If the rule compares \(q\) with \(c=0.50\), it appears to favor selecting A by just 0.010. But chain estimates range from 0.42 to 0.62, and suppose the event-indicator R-hat is 1.08. The high ESS and low R-hat for the continuous parameter do not resolve the poor agreement for the decision event. Because the chains may be exploring different parts of the joint utility distribution, this decision is not supported by the diagnostics. Assess the event-defining quantities and sampler behavior, rather than treating the parameter ESS as a substitute.

Practical Responses and Alternatives

1
Define the boundary precisely.
Write the posterior event and cutoff in context. Verify whether equality belongs to the event and ensure the event is evaluated the same way in every chain.
2
Inspect chains for the event and its drivers.
Review event traces, chain-specific proportions, and the treatment contrasts or utilities that determine membership in the event.
3
Compare convergence and effective sample size.
Use multiple diagnostics, including R-hat and event-specific ESS. Treat disagreements, poor mixing, or a constant rare-event indicator as warning signs.
4
Respond before applying the decision rule.
Check model implementation and sampler behavior; consider longer runs, better parameterization, or a suitable alternative computation, then repeat the diagnostics.

Longer runs can help when chains are mixing adequately but estimates remain unstable. They are not a remedy for chains trapped in separated regions. Reparameterization or a more suitable transition method may improve exploration. For some models, an analytic calculation or numerical integration can provide a useful independent check; whether such an approach is available depends on the posterior and event. These alternatives should be assessed for their own assumptions rather than treated as automatic replacements for diagnostics.

A common mistake is to pool a large number of draws, see \(\hat q\) barely exceed \(c\), and declare the arm eligible. That reasoning treats correlated draws as independent and ignores whether chains agree on the event. The correction is to inspect the decision indicator across chains, assess its mixing and ESS, and treat a near-boundary result with unresolved diagnostics as computationally inconclusive. This is a statement about the adequacy of the calculation, not a reason to alter the prespecified cutoff after seeing the output.

Key takeaway: Near a posterior decision boundary, diagnose the MCMC sequence for the decision event itself. Agreement across well-mixed chains and adequate event-specific ESS make a decision more credible, but no single diagnostic proves convergence or validates the model.

Check Your Understanding

Answer each question, then compare with the short solutions.

  1. A rule retains an arm when \(q>0.85\). An MCMC estimate is 0.852, but chain-specific event proportions range from 0.81 to 0.89. What is the main diagnostic concern?
  2. Why can a large ESS for a treatment-effect parameter fail to establish adequate sampling for the event that the treatment effect exceeds a margin?
  3. Four chains show an indicator of zero for every retained draw. Can you conclude that the posterior event probability is zero? Explain.
  4. What does an R-hat value near one tell you, and what does it not establish?

Solutions. (1) The pooled estimate is only 0.002 above the cutoff, while chains disagree substantially; the decision is computationally unresolved until event-level mixing and agreement are improved or clarified. (2) ESS is specific to a sampled quantity. A threshold indicator can be highly autocorrelated or poorly explored even when a continuous parameter mixes well. (3) No. A constant indicator may mean the sampler failed to visit the event region; with no variation, its ESS is not informative about the event probability. (4) R-hat near one indicates that the chains’ sampled distributions are relatively similar under that diagnostic. It does not prove that all chains reached the full posterior, that the model is correct, or that the decision estimate has negligible Monte Carlo error.

Clinical Biostats