Tutorials › Response-Adaptive Randomization › Posterior Probabilities That Treatments Are Best

Thompson Sampling for Trials · Tutorial 246 of 501

Posterior Probabilities That Treatments Are Best

Learn to define and calculate posterior best-treatment probabilities, and to interpret them as Thompson-sampling allocation probabilities when the model and tie rule support that identity.

Advanced 12 min read

What You'll Learn

  • Define the posterior event that a treatment has the highest response probability.
  • Explain why Thompson sampling assigns treatments according to posterior best-treatment probabilities.
  • Calculate best-treatment probabilities from hypothetical discrete posterior distributions.
  • Handle posterior ties and distinguish strict superiority from being tied for best.
  • Check the assumptions behind the allocation interpretation and recognize common misreadings.
  • Compare posterior-best allocation with fixed randomization and deterministic selection rules.

Why a Posterior Probability of Being Best Matters

In a response-adaptive trial, the trial team has observed outcomes from patients already assigned to each treatment. Those outcomes do not reveal the true response probabilities with certainty. Instead, a Bayesian analysis represents uncertainty about each treatment’s response probability by a posterior distribution conditional on the observed trial history. Thompson sampling uses that uncertainty to randomize the next assignment: it favors a treatment when that treatment has a high posterior chance of being the best, while still allowing another treatment to be selected when it could plausibly be best.

The key quantity is not simply a treatment’s estimated response rate. It is the posterior probability of a particular event: that its underlying response probability exceeds those of all the other treatments. The distinction matters because a treatment can have a high estimated response rate but substantial uncertainty, while another treatment may have a lower estimate and a more concentrated posterior distribution. The introductory material on Beta-Bernoulli updating explains how binary responses can produce posterior distributions for response probabilities; here the focus is on comparing those uncertain probabilities.

Definition: Suppose there are \(K\) treatments, indexed by \(i=1,\ldots,K\), and let \(\theta_i\) denote the response probability for treatment \(i\), with larger values defined as better. Let \(\mathcal H_t\) denote the observed trial history immediately before the next assignment. The posterior best-treatment event for treatment \(i\) is \(B_i=\{\theta_i>\theta_j\text{ for every }j\ne i\}\). Its posterior best-treatment probability is \(P(B_i\mid\mathcal H_t)\). If ties can occur, being strictly best and being tied for the maximum are different events.

For a binary endpoint, a common model is that a patient assigned treatment \(i\) has a Bernoulli response with probability \(\theta_i\). The posterior distribution for \(\theta_1,\ldots,\theta_K\) must be based on a specified likelihood and prior, conditioned on the available trial history. The comparison assumes that the response probabilities are meaningful and stable for the patients to whom the model is being applied. It also assumes the outcome direction is clear: if lower event probability is preferable, the parameters or comparison must be defined so that “best” corresponds to the desired clinical outcome.

A posterior probability is conditional on the model, prior, and observed history. It is not the probability that a treatment will work for the next patient, nor does it prove that one treatment is truly superior. It quantifies uncertainty, under the Bayesian model, about which treatment has the largest response probability.

From Posterior Comparison to Assignment Probability

Thompson sampling draws a possible value of each treatment’s response probability from the posterior distribution and assigns the next patient to the treatment with the largest draw. This is a randomized rule: the posterior draw is uncertain, even after conditioning on the current history, so the selected treatment is uncertain too.

When the posterior probability of ties is zero, the probability that treatment \(i\) is selected is exactly its posterior probability of being strictly best. This covers, for example, continuous posterior distributions for response probabilities. If posterior draws can tie, a tie-breaking rule is needed; the allocation probability then includes the chance of receiving the assignment through a tie.

Key result: Under Thompson sampling, draw the parameter vector from its joint posterior given \(\mathcal H_t\), then select a treatment with the largest draw. If the posterior has no ties, the conditional probability of assigning treatment \(i\) is \(P(B_i\mid\mathcal H_t)\). With ties, this equality holds for a specified tie rule only if \(B_i\) is defined to include the corresponding share of tied-best outcomes.

The identity follows from the procedure itself. A posterior draw produces a random vector of plausible response probabilities. Treatment \(i\) is selected precisely when its component is the largest (apart from the stated tie rule). Therefore, the conditional probability of selecting \(i\) is the posterior probability of that selection event. This is a direct correspondence between the algorithm and the event; it does not say that the trial response on the next patient is drawn from the posterior distribution of \(\theta_i\).

$$ P(\text{assign treatment }i\mid\mathcal H_t) = P(\text{treatment }i\text{ is selected by the posterior draw}\mid\mathcal H_t) = P(B_i\mid\mathcal H_t), $$

when ties have posterior probability zero. The posterior draws must represent the joint posterior distribution. If treatment parameters are independent given the history, drawing each parameter separately from its arm-specific posterior gives the appropriate joint draw. If they are dependent, the draws must preserve that dependence; independent draws from the marginal posteriors would generally describe a different joint distribution and could produce different probabilities of being best.

Worked Example: Two Treatments With Discrete Posterior Draws

Consider a hypothetical binary-response trial with treatments A and B. After the observed history and a specified prior, suppose the posterior distribution for A assigns probability \(0.30\) to \(\theta_A=0.40\) and \(0.70\) to \(\theta_A=0.70\). For B, suppose the posterior assigns probability \(0.60\) to \(\theta_B=0.50\) and \(0.40\) to \(\theta_B=0.60\). Assume the arm-specific posterior draws are independent. These are stipulated posterior distributions for this hypothetical example, not data from an actual trial.

If A’s draw is \(0.40\), A cannot exceed either possible draw for B. If A’s draw is \(0.70\), it exceeds both possible B draws. Thus

$$ P(\theta_A>\theta_B\mid\mathcal H_t) = P(\theta_A=0.70\mid\mathcal H_t) =0.70. $$

The possible values do not tie, so the two best-treatment probabilities sum to one. Therefore \(P(\theta_B>\theta_A\mid\mathcal H_t)=1-0.70=0.30\). Thompson sampling assigns the next patient to A with probability \(0.70\) and to B with probability \(0.30\), conditional on this history and model. These probabilities describe the randomization rule, not the probability of response for a patient assigned to either treatment.

More Than Two Treatments

With several treatments, each best-treatment event compares one parameter with every other parameter. The events are mutually exclusive when there are no ties, and together they cover all posterior draws. Consequently, their probabilities sum to one. This provides a useful check on calculations: if the probabilities do not sum to one, possible causes include omitted treatments, mishandled ties, or an error in the comparison.

Worked Example: Three Treatments and the Maximum Draw

In a second hypothetical trial, suppose the posterior draws are independent and have the following finite distributions:

  • Treatment A: \(0.55\) with probability \(0.50\), or \(0.80\) with probability \(0.50\).
  • Treatment B: \(0.60\) with probability \(0.40\), or \(0.75\) with probability \(0.60\).
  • Treatment C: \(0.50\) with probability \(0.25\), or \(0.70\) with probability \(0.75\).

There are no ties among the possible values. A is best whenever its draw is \(0.80\), which occurs with probability \(0.50\); when its draw is \(0.55\), B’s draw is always larger. Thus \(P(B_A\mid\mathcal H_t)=0.50\).

For B to be best, its draw must exceed both other draws. If B draws \(0.60\), A must draw \(0.55\) and C must draw \(0.50\). The probability of this combination is \(0.40(0.50)(0.25)=0.05\). If B draws \(0.75\), A must draw \(0.55\), while either C value is lower than \(0.75\). The probability is \(0.60(0.50)(1)=0.30\). Hence

$$ P(B_B\mid\mathcal H_t)=0.05+0.30=0.35. $$

C can be best only when it draws \(0.70\), A draws \(0.55\), and B draws \(0.60\). The probability is \(0.75(0.50)(0.40)=0.15\). The check is \(0.50+0.35+0.15=1.00\). Thompson sampling therefore assigns A, B, and C with probabilities \(0.50\), \(0.35\), and \(0.15\), respectively, conditional on this posterior and the stated independent-draw model.

Ties, Interpretation, and Diagnostics

Continuous posterior distributions typically assign probability zero to an exact tie between two distinct response probabilities. Discrete posterior distributions need not. In that case, the algorithm must specify how a tied maximum is resolved—for example, uniformly at random among tied treatments or by a fixed priority rule. The posterior probabilities of strict superiority alone may then sum to less than one, because tied outcomes are not counted in any strict-best event.

Worked Example: Accounting for Ties

Suppose a hypothetical trial has independent posterior draws with \(\theta_A=0.50\) or \(0.80\), each with probability \(0.50\), and \(\theta_B=0.50\) or \(0.70\), each with probability \(0.50\). Thompson sampling breaks a tie uniformly between the tied treatments.

There are four equally likely pairs of draws, each with probability \(0.25\). A wins outright in the two pairs where \(\theta_A=0.80\), so its strict-win probability is \(0.50\). B wins outright only for \((\theta_A,\theta_B)=(0.50,0.70)\), with probability \(0.25\). The remaining pair is a tie at \(0.50\), also with probability \(0.25\). A receives half of that tie probability, so its assignment probability is \(0.50+0.25/2=0.625\). B’s assignment probability is \(0.25+0.25/2=0.375\). They sum to one. In this example, the strict-best probabilities alone are \(0.50\) for A and \(0.25\) for B; they do not equal the allocation probabilities because of the tie rule.

Several checks help detect an incorrect interpretation or calculation:

  • Check the conditioning. The allocation probabilities are conditional on the trial history and the posterior model at the time of assignment. They can change as new responses are observed and the posterior changes.
  • Check the comparison. “Best” means largest response probability under the stated outcome direction. Comparing posterior means instead would answer a different question.
  • Check the joint distribution and tie rule. Dependence between treatment parameters and positive posterior tie probability can affect the best-treatment probabilities and the assignment rule.
  • Check the probability total. With a complete set of treatments and a rule assigning exactly one treatment, the allocation probabilities should sum to one. If strict-best probabilities sum to less than one, examine whether ties have positive probability.

How This Allocation Rule Differs From Alternatives

A fixed randomization rule assigns treatments using prespecified probabilities that do not respond to the current posterior. It can provide predictable allocation ratios, but it does not use the evolving posterior evidence to favor treatments that are more likely to be best. Thompson sampling instead uses posterior best-treatment probabilities as its assignment probabilities.

A deterministic rule that always selects the treatment with the largest posterior mean also differs from Thompson sampling. The deterministic rule selects one treatment based on a point summary; Thompson sampling repeatedly draws from the full posterior and can select different treatments on different assignments, even with the same history. Its probability of assigning a treatment reflects how often that treatment is best across posterior draws, not simply its rank by posterior mean.

This does not make posterior-best allocation a complete clinical decision analysis. The rule’s behavior depends on the model, prior, outcome definition, and current information. It does not by itself establish that an observed treatment difference is clinically important, guarantee adequate representation in every arm, or answer questions about patient subgroups or safety constraints. Those aims may require additional design features. Posterior best-treatment probabilities are allocation quantities under a specified procedure, not standalone measures of clinical benefit or evidence that a treatment should be approved.

Common Mistake

A frequent error is to say, “Treatment A has a posterior best probability of \(0.70\), so a patient assigned to A has a \(70\%\) chance of responding.” This confuses uncertainty about which arm’s response probability is largest with the probability of an individual response. The \(0.70\) is the chance, under the posterior and conditional on the history, that A’s response probability exceeds the alternatives. A patient’s response probability under A is \(\theta_A\), which remains uncertain; the posterior best probability is not that response probability.

A related mistake is to report strict-best probabilities as allocation probabilities when posterior ties are possible. State the tie rule and include its contribution. Under a continuous posterior with no ties, the strict-best event and the selection event coincide; without that condition, the equivalence needs adjustment.

Key takeaway: Thompson sampling converts posterior uncertainty into randomization by selecting the treatment with the largest posterior draw. When ties have probability zero, a treatment’s assignment probability, conditional on the current trial history, is its posterior probability of having the highest response probability.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. In one sentence, define the posterior event that treatment \(i\) is best among \(K\) treatments.
  2. Suppose three treatments have no posterior ties and their best-treatment probabilities are \(0.20\) and \(0.55\) for two of them. What is the third treatment’s Thompson-sampling allocation probability?
  3. Two treatments tie for the largest posterior draw with probability \(0.12\). Why might their strict-best probabilities fail to sum to one?
  4. A treatment has a posterior best-treatment probability of \(0.65\). Does that mean its next assigned patient has a \(65\%\) chance of responding? Explain.

Solutions. (1) It is the event that \(\theta_i>\theta_j\) for every other treatment \(j\), conditional on the trial history when its posterior probability is calculated. (2) With no ties, the probabilities sum to one, so the third probability is \(1-0.20-0.55=0.25\). (3) Tied draws are not included in either treatment’s strict-superiority event, so some posterior probability is omitted; the allocation rule must specify how the tie is resolved. (4) No. The \(0.65\) is the posterior probability that the treatment has the largest response probability, not the probability of an individual response under that treatment.

Clinical Biostats