HomeMaster Protocol & Adaptive Trial DesignBayesian Adaptive Randomization Simulator

🧩 Bayesian Adaptive Randomization Simulator

A Bayesian adaptive randomization method that shifts towards more effective treatments based on interim analysis results.

Master Protocol & Adaptive Trial Design2DModerate60 FPS
bayesian-adaptive-randomization ↗ Open standalone

Why Adaptive Randomization Starts from a Classical 1:1:1 Reference Design

Every Bayesian response-adaptive randomization (RAR) trial is built on top of, and validated against, the fixed-ratio randomization it is trying to improve on. Before any adaptation begins, statisticians pre-specify the reference design — equal allocation, stratified by known prognostic covariates — because regulatory acceptance of an adaptive design hinges entirely on demonstrating, via simulation, that it preserves the operating characteristics (Type I error, power) of that fixed comparator under the null and alternative hypotheses.

  • 1:1:1: Reference allocation (equal randomization across arms)
  • Beta(0.5,0.5): Prior distribution (Jeffreys non-informative prior)
  • 0.05: Target Type I error (one-sided, per FDA convention)
  • 2–4: Stratification factors (baseline risk, site, biomarker)

The Beta-Binomial conjugate model as the statistical engine

Every arm k in the trial is modeled with a binary (or ordinal, collapsed to binary) responder endpoint θ_k = true response probability. The Bayesian machinery is deliberately simple so it can run thousands of times inside a simulation:

Prior: θ_k ~ Beta(α₀, β₀) • Jeffreys prior Beta(0.5, 0.5): minimally informative, invariant to reparameterization • Weakly informative alternative: Beta(1,1) uniform, or historically-informed Beta(a,b) from a prior registry (e.g., I-SPY2 uses accumulating historical control data)

Likelihood: after n_k patients on arm k with r_k responders, Binomial(n_k, θ_k)

Posterior (conjugacy makes this closed-form, no MCMC required): θ_k | data ~ Beta(α₀ + r_k, β₀ + n_k − r_k)

This conjugacy is not a mathematical curiosity — it is the reason Bayesian RAR is computationally tractable at scale. A trial simulation engine (typically built in R with the "rpact" or a bespoke Stan/JAGS backend, or in FACTS software from Berry Consultants) must simulate 10,000–100,000 virtual trial replicates to certify operating characteristics before a protocol is submitted. Closed-form Beta posteriors mean each replicate updates in microseconds; a model requiring MCMC per update (needed for more complex endpoints — time-to-event, longitudinal biomarkers) can push simulation runtime from minutes to days on a compute cluster.

Monte Carlo estimation of P(arm k is best): 1. Draw θ_A^(i), θ_B^(i), θ_C^(i) independently from their respective posteriors, i=1…10,000 2. For each draw i, identify which arm has max(θ_A^(i), θ_B^(i), θ_C^(i)) 3. P(arm k best) = (count of draws where k was max) / 10,000

This Monte Carlo step is recomputed after every cohort (or every patient, in fully continuous designs) and is the single number that everything else in the design — randomization probability, stopping rules, DSMB reports — is derived from.

Why burn-in and pre-specification matter for regulatory acceptance

A design that adapts from patient 1 is statistically valid in theory but operationally fragile: with n=3 per arm, a single lucky responder can swing P(best) to 0.7+ on pure noise, and the algorithm will start over-enrolling that arm before there is any real signal. FDA's 2019 draft guidance on Adaptive Designs for Clinical Trials of Drugs and Biologics, and the companion 2023 Master Protocols guidance, both flag this as the central reviewer concern: an adaptive rule must be shown, by simulation, not to inflate false-positive rates or destabilize under sparse early data.

Standard mitigations built into essentially every deployed Bayesian RAR design:

• Burn-in period: fixed 1:1:1 (or 1:1) allocation for the first cohort (commonly 20–40 patients per arm, or 10–20% of planned maximum N) before any adaptation is switched on • Minimum allocation floor: no arm's randomization probability is allowed below a floor (typically 0.10–0.15) even if its posterior looks terrible, preserving statistical power to detect a late-emerging signal and preventing complete abandonment from a bad early run • Batch (cohort-wise) rather than patient-wise updating: randomization probabilities recompute every 10–30 patients, not after every single outcome, damping oscillation • Delayed outcome handling: if the primary endpoint takes 8–12 weeks to mature (common in oncology, e.g., ORR by RECIST at week 8), patients enrolled but not yet evaluable are excluded from the current update — mishandling this "pipeline" of pending outcomes is a well-documented source of bias (Thall, Fox, Wathen, Biostatistics 2015)

All of these are locked into the Statistical Analysis Plan (SAP) before first patient in — an adaptive trial cannot legally change its adaptation rule mid-course without an amendment reviewed by the DSMB and, for pivotal trials, the FDA.

The Burn-in Period — Protecting Adaptive Designs from Premature Convergence

The burn-in period is the most underappreciated component of a Bayesian RAR design: a deliberate delay before adaptation begins, sized specifically so that the posterior distributions have enough data to be informative rather than noisy. Get the burn-in size wrong and the entire trial's operating characteristics — Type I error, power, expected sample size — can shift by double digits in simulation, which is why burn-in length is itself a tuned parameter, not an afterthought.

  • 20–40: Typical burn-in size (patients per arm before adapting)
  • 10k–100k: Simulated replicates to tune it (per candidate design)
  • FACTS, East, rpact: Common software (Bayesian trial simulation platforms)
  • 10–15%: Minimum allocation floor (prevents total arm abandonment)

Simulation-based design certification — the operating characteristics package

Because Bayesian RAR designs have no closed-form analytic solution for power or Type I error (the randomization probabilities are themselves random variables depending on accumulated data), every deployed design is certified entirely by simulation. A typical design justification document, submitted as part of the protocol to a DSMB and to FDA under an IND, includes:

1. Null scenario simulations (all arms truly equal, θ_A=θ_B=θ_C): • Run 10,000+ virtual trials • Measure: false-positive rate (how often the design incorrectly declares an arm superior) • Target: ≤0.05 (or ≤0.025 one-sided for pivotal claims), matching or improving on the fixed design • Bayesian RAR without correction commonly inflates this to 0.07–0.09; power-transform tuning (the exponent c) and calibrated decision thresholds bring it back down

2. Alternative scenario simulations (true effect present, various magnitudes): • Small, moderate, large effect sizes swept across a grid • Measure: power (probability of correctly declaring superiority), expected sample size, expected number of patients on inferior arms • The core ethical selling point of RAR: fewer patients randomized to the arm turning out to be worse, without materially sacrificing power

3. Robustness scenarios: • Delayed outcome ascertainment (pipeline patients) • Time trends in patient population (drift) that could masquerade as arm superiority — a serious confounder for RAR specifically, since a trial that shifts allocation over calendar time is vulnerable if patient prognosis also drifts over calendar time • Model misspecification (true outcome distribution not Beta-Binomial-compatible, e.g., overdispersion)

4. Comparison table: fixed 1:1:1 vs. RAR vs. group-sequential fixed design, across all scenarios above, is the primary exhibit reviewers examine.

Berry Consultants' FACTS software and the R packages "brms"+custom Monte Carlo loops, or Cytel's East-Bayes module, are the dominant tools used to generate this package — a full operating-characteristics report for a Phase II RAR design typically represents 200–600 CPU-hours of simulation.

The BATTLE trial (Biomarker-integrated Approaches of Targeted Therapy for Lung cancer Elimination, MD Anderson, 2006–2009) is the canonical case study for burn-in design: it used an initial fixed-allocation "marker-group" cohort before switching to adaptive randomization within biomarker subgroups, explicitly to avoid early instability. It successfully identified that EGFR/KRAS mutation status predicted response to erlotinib, informing the design of BATTLE-2 and the broader master-protocol movement.

Monte Carlo Posterior Superiority — Turning Accumulating Data into a Live Probability

At the heart of every Bayesian adaptive randomization trial sits a computational loop that runs after every cohort: update each arm's posterior distribution given newly observed outcomes, then simulate from those posteriors to estimate the probability each arm is truly the best. This loop is what separates Bayesian RAR from older "play-the-winner" urn-model designs — it propagates genuine statistical uncertainty rather than reacting to raw counts, which is why it degrades gracefully as data accumulate instead of overfitting to short runs of luck.

  • 10,000: MC draws per update (per arm, per interim update)
  • every 10–30 pts: Update cadence (cohort-wise, not per-patient)
  • Beta(α₀+r, β₀+n−r): Posterior form (closed-form conjugate update)
  • <200 ms: Typical update latency (per interim, on standard hardware)

From posterior draws to a defensible allocation probability

The Monte Carlo posterior-superiority computation is deceptively simple to implement and deceptively easy to get subtly wrong in ways that only show up under simulation stress-testing:

Step-by-step per update: 1. Pull current cumulative (α_k, β_k) for each arm k from the trial database (typically a validated EDC-integrated statistical computing environment, not a spreadsheet — GxP considerations apply since this output drives live randomization) 2. Draw 10,000 independent samples θ_k^(i) ~ Beta(α_k, β_k) for each arm 3. For each of the 10,000 draws, determine argmax across arms 4. Tabulate P(arm k best) = fraction of draws where k wins 5. Persist this vector to the randomization module with a timestamp and audit trail (21 CFR Part 11 electronic records requirements apply to the software performing this step in a regulated trial)

Handling ties and near-ties: with continuous Beta distributions, exact ties across 10,000 draws are essentially never observed, but near-ties (all arms clustered around P(best)≈0.33) are common early and signal genuinely equivocal evidence — the design should NOT force a decision here, which is exactly why the power-transform exponent c (Stage 4) exists to control sensitivity.

Multi-arm correction: with K>2 arms, naive "declare winner when P(best)>0.95" thresholds do not control familywise Type I error the way a single pairwise comparison would — the effective number of implicit comparisons grows with K. Simulation-calibrated thresholds (not the naive 0.95) are required; a 5-arm trial commonly needs a superiority threshold around 0.985–0.99 to hold overall α at 0.05, information only obtainable by running the null simulation described in Stage 2.

Computational note: because this recomputes at every interim across every simulated replicate during design certification, efficient vectorized sampling (numpy, Rmath's rbeta, or GPU-batched sampling for very large simulation studies) is a real engineering concern — a naive per-patient loop in an interpreted language can make a 100,000-replicate operating-characteristics study computationally infeasible.

The Thall–Wathen Power Transform — Converting Posterior Belief into Randomization Odds

Knowing which arm is probably best is not the same as deciding how to randomize the next patient — a Bayesian RAR design needs a deterministic, pre-specified rule that maps posterior probabilities to allocation ratios. The dominant approach, formalized by Thall and Wathen (2007, Statistics in Medicine), sets randomization probability proportional to the posterior probability of superiority raised to a tunable exponent, giving trial statisticians a single dial that trades off ethical benefit (fewer patients on the inferior arm) against statistical efficiency (power to detect a true difference).

  • π_k ∝ P(best)^c: Allocation rule (Thall–Wathen power transform)
  • c = 0.5 – 1.0: Typical exponent range (tuned via simulation, not fixed)
  • 1:1:1 fixed: c = 0 special case (no adaptation)
  • Deterministic: c → ∞ special case (always allocate to apparent best)

Tuning the exponent: the central trade-off in adaptive design

The allocation rule πₖ = P(arm k best)^c / Σⱼ P(arm j best)^c is elegant but its behavior is highly non-linear in c, which is why the exponent is never chosen by intuition — it is swept across a grid (typically c ∈ {0, 0.25, 0.5, 0.75, 1.0}) and each value is fully simulated under null and alternative scenarios before selection:

c = 0: πₖ = 1/K for all arms regardless of posterior — reduces exactly to fixed randomization. Used as the simulation anchor/reference.

c = 0.5 (common default, sometimes written as the "square-root rule"): moderate responsiveness. An arm with P(best)=0.7 versus two arms at 0.15 each gets allocation weight proportional to 0.7^0.5≈0.84 vs 0.15^0.5≈0.39 each — meaningfully more patients to the apparent winner, but not aggressively so. This value is favored in many oncology Phase II designs (e.g., several I-SPY2 sub-studies used variants near this range) because it visibly reduces exposure to inferior arms without materially costing power in simulation.

c = 1.0: full proportionality to posterior probability — "Thompson sampling" in the machine-learning literature's terminology, aggressive convergence toward the empirically best arm, appropriate when the ethical cost of a wrong assignment is high (e.g., a rapidly progressive, high-mortality condition) and the trial can tolerate somewhat reduced statistical power.

Time-varying exponent (c_n, a function of accrued sample size n): some designs (Trippa et al. 2012, adopted in several neuro-oncology GBM AGILE-style platform trials) let c grow over the trial — near 0 during burn-in, rising toward 1 as N grows — because early adaptation on sparse data is the primary source of Type I error inflation, while late-trial adaptation on mature data is comparatively safe.

The allocation-vs-power trade-off is not free: simulation studies consistently show that aggressive RAR (c near 1) trades roughly 2–8 percentage points of statistical power (versus fixed 1:1:1 at matched total N) in exchange for reducing expected patients on the inferior arm by 15–35%. Trial sponsors and DSMBs must explicitly accept this trade-off in the protocol's design justification section — it is not a free ethical lunch.

The I-SPY2 trial (Investigation of Serial Studies to Predict Your Therapeutic Response with Imaging and moLecular analysis), running continuously since 2010 across >20 experimental agents in neoadjuvant breast cancer, is the flagship real-world deployment of Bayesian RAR inside a master protocol. It uses biomarker-signature-specific adaptive randomization with graduation (efficacy) and futility boundaries calibrated to hold false-positive "graduation" rates at ~10-25% depending on signature prevalence, and has graduated over a dozen agents to Phase III with roughly 60-120 patients per arm instead of the 300-400 a conventional fixed design would require.

DSMB Interim Analyses — Futility, Efficacy, and the Discipline of Pre-Specification

A live Bayesian RAR trial reports to an independent Data and Safety Monitoring Board (DSMB) at scheduled interim looks, where posterior probabilities are compared against futility and efficacy stopping boundaries fixed at design time and calibrated entirely through the simulation package built in Stages 1-2. Unlike a fixed trial's single final analysis, an adaptive platform trial can drop an underperforming arm, graduate a superior one, or add a new arm entirely — mid-course changes that are only defensible because the decision rules were locked before a single patient enrolled.

  • 4–6: Typical interim looks (across a Phase II RAR trial)
  • P(best) < 0.02: Futility threshold (calibrated per design, not fixed)
  • P(best) > 0.975–0.99: Efficacy/graduation threshold (holds familywise α at target)
  • Mandatory: DSMB charter requirement (ICH E6(R2), 21 CFR 50.24/56)

How stopping boundaries are calibrated and what a DSMB actually reviews

Interim monitoring in a Bayesian RAR trial differs structurally from classical group-sequential monitoring (O'Brien-Fleming, Pocock boundaries) because the boundary is expressed directly on the posterior probability scale rather than on a Z-statistic or p-value scale — but the calibration discipline is identical: the boundary values themselves are chosen so that, across the null simulation ensemble from Stage 2, the overall false-positive rate lands at the pre-specified target (typically 0.05 one-sided, sometimes 0.025 for late-phase confirmatory claims per ICH E9(R1) estimand framework considerations).

What gets calibrated: • Futility boundary: if P(arm k best) drops below a low threshold (e.g., 0.02) and stays there across two consecutive looks, arm k is dropped — patients are no longer randomized to it, freeing capacity for remaining or new arms. In platform master protocols (I-SPY2, GBM AGILE, REMAP-CAP), this is what allows continuous arm turnover without inflating trial-level error. • Efficacy/graduation boundary: if P(arm k best) exceeds a high threshold (0.975–0.99, higher than the naive 0.95 to correct for multiple looks and multiple arms, per Stage 3), the arm may graduate to confirmatory testing or the trial may stop early for success. • Maximum sample size: even absent a boundary crossing, trials have a hard N cap — the "unlimited adaptation" scenario is never actually deployed because it removes the design's certifiability.

What the DSMB actually receives at each interim: 1. Unblinded posterior probability trajectories per arm (DSMB members are typically the only people who see unblinded interim data — sponsor teams remain blinded to protect trial integrity) 2. Current allocation ratios and cumulative enrollment per arm 3. Safety data (adverse event rates by MedDRA System Organ Class, serious adverse event listings) — safety stopping is procedurally separate from and takes precedence over efficacy/futility adaptation 4. Simulated "if we stopped here" operating characteristics, contextualizing whether the observed trajectory is consistent with the pre-planned null/alternative simulation envelopes

DSMB charters for adaptive trials (per FDA's adaptive design guidance and ICH E6(R2) GCP) must explicitly define the adaptation algorithm's exact computational specification — not just its intent — because a DSMB with discretion to deviate from the pre-specified rule reintroduces exactly the bias the simulation-based Type I error control was designed to eliminate.

Analyzing an Adaptively Randomized Trial — Correcting for the Bias RAR Itself Introduces

A Bayesian RAR trial that reaches its endpoint — maximum enrollment, or an efficacy/futility boundary crossing — cannot simply report the naive posterior mean or a standard frequentist p-value the way a fixed trial would, because response-adaptive allocation induces a selection bias: arms that appeared good early got more patients, which biases naive point estimates and standard-error calculations. The final regulatory package must explicitly address this to survive FDA statistical review.

  • Up to ~10–15%: Naive estimator bias (point-estimate inflation, uncorrected)
  • Re-randomization / shrinkage: Bias-correction method (permutation-based re-analysis)
  • 2019 Adaptive Designs: FDA governing guidance (+ 2018 Master Protocols guidance)
  • SDTM/ADaM: CDISC reporting standard (with adaptation audit trail domain)

Bias correction, reporting standards, and the final statistical package

Response-adaptive randomization creates a well-documented statistical hazard: because allocation probability depends on prior outcomes, and outcomes within an arm are correlated with when in the trial a patient enrolled (via the allocation trajectory), the naive posterior mean of θ_k computed from the final Beta(α_k, β_k) is a biased estimator of the true response rate — typically biased upward for the arm that "won" the adaptation race, since more of its patients were enrolled after the algorithm had already started favoring it.

Correction approaches used in submitted regulatory packages:

1. Re-randomization / permutation tests: repeatedly re-simulate the trial's exact enrollment and adaptation sequence under the null hypothesis using the actual accrual pattern, building an empirical null distribution for the test statistic — this sidesteps analytic bias formulas entirely and is the FDA-preferred approach for final confirmatory p-values in adaptive trials.

2. Shrinkage/bias-corrected estimators (Bowden & Trippa 2017, and related work): analytic corrections to the posterior mean that discount the portion of apparent superiority attributable to the adaptation mechanism itself rather than a true treatment effect.

3. Sequential/martingale-based confidence sequences: an increasingly used alternative that provides anytime-valid inference robust to the optional-stopping and adaptive-allocation structure by construction, avoiding the correction problem altogether (Ramdas et al., commonly used in newer platform trial statistical analysis plans since ~2021).

Final regulatory submission package includes: • Full statistical analysis plan (SAP) with the exact adaptation algorithm as implemented (not just as designed) — including software version, random seed handling, and audit logs of every randomization probability update, since 21 CFR Part 11 requires this level of traceability for the software driving live treatment assignment • CDISC SDTM/ADaM datasets with a supplemental domain capturing the allocation-probability trajectory over time, since standard SDTM domains do not natively capture time-varying randomization ratios • Bias-corrected treatment effect estimate with credible interval, alongside (not instead of) the naive Bayesian posterior, so reviewers can see both • Full operating-characteristics simulation report (Stage 1-2 outputs) as the design-validity exhibit

Post-marketing, if the trial supports approval, safety signals continue to be tracked through FDA FAERS and, for EU-marketed products, EMA EudraVigilance under ICH E2B(R3) individual case safety report formatting — adaptive trial design accelerates getting to a decision, but does not change post-approval pharmacovigilance obligations.

GBM AGILE (Adaptive Global Innovative Learning Environment for glioblastoma), a Bayesian adaptive platform trial launched in 2019 across sites in the US, Canada, and Europe, uses exactly this response-adaptive randomization-with-bias-correction framework to compare multiple experimental regimens against a shared control simultaneously, re-estimating allocation ratios at each interim and using re-randomization-based final analysis. Its statistical design (Alexander, Ballman, Berry et al.) explicitly cites reducing total required patients by an estimated 20-30% versus running the same regimens as sequential independent Phase II/III trials — the central economic argument for master-protocol RAR at scale.
⚙ Under the hood

A Bayesian adaptive randomization method that shifts towards more effective treatments based on interim analysis results.

CanvasBiomedicine

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)