Composed Pipeline Type I Error Simulator
Pipeline-level Type I error simulator for two-arm Phase II oncology designs that combine four design components — historical borrowing (MAP prior) plus three adaptive mechanisms: Bayesian sequential monitoring, sample-size re-estimation (SSR), and response-adaptive randomization (Thompson Sampling). The engine is a Python port of the canonical R reference implementation underlying Qian (2026, JSM); the calculator page ships one-click presets that run the paper's composite-null sweep, its fixed-threshold ablations, and the departure × time-trend crossing.
Calibrating at one point does not control error across the null.
An efficacy threshold is typically calibrated at a single assumed control rate. But is composite: it holds wherever both arms share a common response process, not only at that anchor. Along a one-dimensional slice of the null (common baseline rate , shared time trend ), Type I error rises monotonically with , reaching 0.2272 at against a nominal 0.025. Holding fixed and switching SSR and RAR off does not restore control either (0.1638 at the same point). Each component passed its reported numerical benchmark check, but none of those checks evaluated Type I error away from the calibration anchor.
Contents
1. When to Use This Calculator
Use this calculator to explore two-arm, binary-endpoint Phase II designs that combine two or more of the following supported design components:
- Historical borrowing: a MAP (meta-analytic predictive) or robustified-mixture prior on the control arm, fitted from one or more historical cohorts.
- Bayesian sequential monitoring: interim posterior probability tests evaluated at one or more pre-specified looks.
- Sample-size re-estimation (SSR): blinded re-estimation of at an interim look using pooled response data, capped at .
- Response-adaptive randomization (RAR): Thompson Sampling allocation that shifts treatment assignment toward the arm with the higher current posterior.
Single-mechanism designs are well-served by the existing calculators (Bayesian Borrowing, Bayesian Sequential, SSR Blinded/Unblinded/ Single-Arm, Adaptive Randomization). This calculator is purpose-built for the composed case. The claim there is deliberately narrow and purely negative: calibrating each component under its own marginal model, and the composed rule at a single null point, places no constraint on the error rate of the composed rule elsewhere in the null. That is a statement about what those checks fail to establish — not a theorem that composition must inflate error, and not a claim that shared information implies failure. Whether error control breaks, in which direction, and by how much are empirical questions, which is why this is a simulation. The FDA's January 2026 draft guidance recommends (as non-binding recommendations in a draft) documenting operating characteristics under realistic simulation scenarios and pre-specifying how prior–data conflict will be handled.
2. Design Class & Mechanisms
2.1 Trial structure
Two-arm Phase II oncology design with binary endpoint (e.g., ORR). The default schedule mirrors the JSM 2026 reference design: monitoring looks at , planned final at , cap at , and SSR firing at via blinded pooled response. Treatment and control arms accrue concurrently; allocation is either fixed 1:1 alternation (when RAR is off) or Thompson Sampling after a 10-patient burn-in (when RAR is on).
2.2 MAP prior
Method background: Bayesian Historical Borrowing (MAP priors, robustification, prior-data conflict).
The control prior is a Beta mixture
fitted with RBesT from the historical cohorts (; response rates 26%, 25%, 25%; pooled 38/150 = 0.2533), giving the three-component default ; ; and a flat robustifying . Mixture weights are updated at each interim via the log marginal likelihood. The treatment-arm posterior uses an independent Jeffreys prior — historical borrowing applies only to control.
The reference rate is ambiguous, so name it explicitly. The threshold is calibrated at the design anchor , which is not the mean of any prior in play: the dominant informative component has mean 0.2568, the full robustified mixture has mean 0.3132, and the historical pooled rate is 0.2533. Describe as departure of the baseline rate from the calibration anchor, never as “ percentage points above the prior mean.”
2.3 Bayesian monitoring
Method background: Bayesian Sequential Monitoring (posterior-probability stopping rules).
At each scheduled look the calculator computes
by deterministic Gauss–Legendre quadrature (400 nodes) as , where is the Jeffreys treatment posterior density and the control posterior mixture CDF. Stop for efficacy if this posterior probability exceeds . Quadrature replaced an earlier 2,000-draw Monte Carlo estimate: the monitoring rule takes a maximum over interim looks, so Monte Carlo noise inflates that maximum and identical trial data could otherwise yield different decisions. The default comes from a grid-free binary search with the blinded nuisance SSR active, and gives in-sample T1E = 0.0248 (MCSE 0.0011, ) at the design anchor with no trend. Note this is in-sample calibration: the search targets the empirical calibration sample exactly, not the population Type I error, so out-of-sample behaviour is unverified.
2.4 Blinded SSR
Method alignment: Blinded SSR and this composed pipeline now use the same core principle: re-estimate a binary nuisance level from blinded pooled outcomes while holding the planned treatment effect fixed. This is consistent with the binary internal-pilot framework of Friede–Kieser (2004). The implementation here remains a conventional-style working rule embedded in a different pipeline: its planning calculation assumes 1:1 allocation, whereas the simulated trial can use Thompson-sampling RAR and a Bayesian posterior-probability final decision. Its reference Wald power is therefore not the exact power of the full composed design.
At the pooled response count defines. With planned effect, working rates are imposed symmetrically around the blinded estimate:
The target is not an arbitrary 80% conditional-power threshold. It is the one-sided fixed-sample Wald power implied by the original design at , which is 0.5296. The recalculated working 1:1 total is
and . Only enters the rule; arm labels, arm-specific outcomes, posterior probabilities, and the realized allocation ratio do not. At the default look, exhaustive evaluation of all pooled counts maps to final through 100.
2.5 Response-Adaptive Randomization
Method background: Adaptive Randomization (Thompson sampling, DBCD, Neyman, Pocock–Simon).
Thompson Sampling: at each enrollment after a 10-patient burn-in, sample one Beta variate from each arm's posterior and allocate to whichever variate is larger. This is the canonical TS reference implementation; it converges toward complete allocation to the better arm (a fundamentally different limit from the Rosenberger DBCD target).
2.6 Time trend
Linear drift on a fixed per-patient scale anchored to the planned horizon: with . Both arms drift in parallel under H0, so the data-generating null is preserved. Coupling RAR with this drift can create allocation imbalance that affects the final analysis, although the experiment does not isolate an RAR-specific trend channel.
Note is not capped at 1: when SSR extends enrollment past drift keeps accruing at the same per-patient rate, which is intended — a longer trial spans more calendar time. (A trial expanded to accrues total drift , not 0.05.) Only the resulting probability is clamped to . Dividing by the re-estimated sample size instead would make normalized time jump backward the moment SSR fires, an SSR-induced artifact.
3. JSM Presets & What They Show
Each preset on the calculator runs a multi-scenario batch corresponding to a table in the JSM paper.
Section 3.3 — Composite-null sweep
The primary result. Holds the trend fixed at and varies the common baseline rate from 0.20 to 0.36, running each point twice: with all mechanisms active, and with SSR and RAR disabled at the same fixed .
- T1E under the full design rises monotonically, 0.0112 at to 0.2272 at .
- With SSR and RAR off, T1E still runs 0.0336 → 0.1638 — disabling the adaptive components does not restore control.
- The fixed- difference reverses sign, from −0.0224 at to +0.0634 at .
No row in this table is the calibration scenario — the row shares the anchor rate but carries the trend, so it should not be read against 0.0250 as though the trend were held fixed.
Section 3.5 — Departure × Time Trend
A 2×2 crossing baseline-rate departure from the anchor () with time trend (), all four mechanisms active. Both factors independently raise T1E and their joint effect exceeds the additive prediction:
Paper values: neither 0.0236, departure only 0.0894, trend only 0.0468, both 0.1206 — against an additive prediction of 0.1126, giving (MCSE 0.0071; 95% SI [−0.0060, +0.0220]). The interval includes zero. Because all four cells use the full design, they share a common calibrated baseline and the contrasts are internally consistent. This is a risk-difference interaction at the specific factor levels evaluated, not a scale-free mechanistic claim.
Section 3.4 — SSR × RAR fixed-threshold ablation
Four designs at with the trend active: SSR + RAR disabled (borrowing + monitoring; 0.1170), + SSR (0.1138), + RAR (0.1202), + both (0.1276). The factorial interaction point estimate is +0.0106 (MCSE 0.0092; 95% SI [−0.0074, +0.0286]), so the simulation does not distinguish it from zero. A fresh-seed check is likewise compatible with zero (+0.0003; 95% SI [−0.0227, +0.0234]).
These are ablations, not a decomposition. was calibrated with SSR and RAR active, and every ablation cell retains that threshold, so none of them is calibrated to α — with SSR and RAR disabled the monitoring rule already returns ≈0.05 at the anchor before any departure or trend. Read these rows as “does switching this component off restore control?”, never as “how much of the excess did this component cause?” Attribution would require separately calibrating each design.
Do not over-interpret the point estimate. The current result replaces the one computed under the earlier conditional-power SSR rule. Both the propagated simulation interval and the fresh-seed validation include zero. The factorial is useful as a fixed-threshold sensitivity analysis, but it does not establish a stable SSR×RAR interaction or an attributable contribution from either mechanism.
4. Interpreting Results
4.1 The estimand
The reported rejection rate is the frequentist Type I error rate under the data-generating null — not a posterior predictive error rate conditional on prior beliefs. The prior–data conflict scenarios are realistic situations where the historical prior is misspecified relative to the current trial population, but H0 still holds in the current data. The inflation we report is the false-positive rate under the current trial's data-generating null — the regulatory-relevant quantity, not a Bayesian robustness diagnostic.
4.2 Monte Carlo uncertainty
The simulator reports the rejection rate, its binomial Monte Carlo standard error , and a 95% Wald CI. At with , MCSE ≈ 0.0038 and the CI half-width is about ±0.0075. To halve MCSE, run at in the Advanced panel.
4.3 How this engine compares to the paper's R runs
The paper's reference numbers were generated in R (Mersenne Twister PRNG); this calculator is a Python/NumPy (PCG64) port. Same seed values give different streams, so a single-seed run drifts by a few MCSE even when two engines are mathematically equivalent. The calculator presets are pinned to the final published design and compare each run with the manuscript value using the combined Monte Carlo uncertainty from both simulations. Treat a few-MCSE single-seed discrepancy as a prompt to increase replications and compare independent seeds, not as deterministic non-reproduction.
Two details of the reference implementation matter enough to call out, because getting either wrong shifts results in trend-active scenarios specifically. First, calendar drift accrues on a fixed per-patient scale anchored to the planned horizon. If the denominator tracked the re-estimated sample size instead, normalized time would jump backward the moment SSR fired and the response probability would fall — an artifact induced by SSR that contaminates both the SSR effect and the departure × trend interaction. Second, the monitoring posterior is computed by deterministic quadrature, not Monte Carlo: because the monitoring rule takes a maximum over interim looks, MC noise inflates that maximum and identical trial data could otherwise yield different decisions.
4.4 Interaction term
When the Departure × Trend 2×2 preset finishes, the calculator displays below the results table. A positive value means the joint effect exceeds the sum of the independent contributions. The paper's reference value is +0.0080 (MCSE 0.0071; 95% SI [−0.0060, +0.0220]), so its sign is uncertain.
Two caveats attach. It is a risk-difference interaction at the specific factor levels evaluated, not a scale-free mechanistic claim. And because drift is anchored to the planned horizon , a trial expanded to accrues total drift of about 0.056 rather than 0.05 — so the interaction includes the extra secular-trend exposure created by extending enrollment, not only a mechanism interaction.
5. Assumptions & Limitations
- Two-arm, binary endpoint. Continuous and survival are on the roadmap but not implemented in v1; the JSM paper itself is binary-only.
- Blinded SSR with pooled response. The calculator uses aggregate counts at the SSR look (the "single-arm in the sense that SSR uses only aggregate counts, not treatment-arm allocation" phrasing from the paper). Unblinded treatment-arm-specific SSR is not modeled.
- Thompson Sampling RAR only. DBCD, Neyman, and other allocation rules are not exposed in this calculator. Use the dedicated RAR calculator for those.
- MAP prior is pre-pooled. The prior is supplied as a set of mixture components via
prior_components. To fit a MAP prior from historical cohort data, use the Bayesian Borrowing calculator first and copy the fitted hyperparameters across. - Linear time trend only. Sigmoidal, step, or non-linear trends would require code changes.
- The supremum is not estimated. A grid exhibits points at which control fails and establishes that the supremum of the Type I error is at least the largest value observed (0.2272, at the upper grid boundary, where the curve was still rising). It does not locate the worst case.
- The SSR rule is a working nuisance calculation. It uses blinded pooled outcomes and a prespecified 1:1 planning allocation, while the full design may realize unequal Thompson- sampling allocation and uses Bayesian monitoring. This makes the SSR operationally blinded, but its preserved Wald power is not the exact power of the composed analysis. Results remain conditional on the chosen planned effect and working model.
- Calibration is in-sample. The binary search targets the empirical calibration sample exactly; out-of-sample behaviour is unverified.
6. API Reference
POST /api/v1/calculators/composed-pipeline— runs one scenario.
Request body (key fields)
use_borrowing,use_monitoring,use_ssr,use_rar— bool toggles for each mechanismp_control,p_treatment,time_trend_delta— data-generating scenarion_base,n_cap,n_ssr_trig,monitoring_looks,gamma,planned_effect— designprior_components— MAP prior as [weight, a, b] triples (weights sum to 1)simulate,n_simulations,simulation_seed— Monte Carlo control
Response (key fields)
simulation.estimates.rejection_rate— pipeline-level T1Esimulation.estimates.monte_carlo_se,ci_95_lower,ci_95_upperanalytical_results.mechanisms_active— design summaryanalytical_results.reference_power,operational_n_min,operational_n_max— SSR diagnostics
The endpoint returns 400 on invalid scenario combinations (e.g.,n_ssr_trig >= n_base), and 500 on internal simulation failures. Pro subscription required.
7. References
- Qian L. Point Calibration Does Not Control Type I Error Across the Composite Null in a Composed Adaptive Bayesian Design. Joint Statistical Meetings 2026, August 2026. (The source paper for this calculator.)
- Weber S, Li Y, Seaman JW III, Kakizume T, Schmidli H. Applying meta-analytic-predictive priors with the R Bayesian evidence synthesis tools (RBesT). Journal of Statistical Software. 2021;100(19):1-32. (Source of the three-component MAP prior fit.)
- Berry SM, Broglio KR, Groshen S, Berry DA. Bayesian hierarchical modeling of patient subpopulations: Efficient designs of Phase II oncology clinical trials. Clinical Trials. 2013;10(5):720-734.
- Mehta CR, Pocock SJ. Adaptive increase in sample size when interim results are promising: A practical guide with examples. Statistics in Medicine. 2011;30(28):3267-3284.
- Friede T, Kieser M. Blinded sample size re-estimation in non-inferiority and equivalence trials. Pharmaceutical Statistics. 2004;3(4):269-279. doi: 10.1002/pst.140. (Binary blinded nuisance-parameter re-estimation framework underlying the SSR rule used here.)
- Kieser M, Friede T. Simple procedures for blinded sample size adjustment that do not affect the type I error rate. Statistics in Medicine. 2003;22(23):3571-3581.
- Hu F, Zhang LX. Asymptotic properties of doubly adaptive biased coin designs for multitreatment clinical trials. Annals of Statistics. 2004;32(1):268-301.
- Schmidli H, et al. Robust meta-analytic-predictive priors in clinical trials with historical control information. Biometrics. 2014;70(4):1023-1032.
- U.S. Food and Drug Administration. Use of Bayesian Methodology in Clinical Trials of Drug and Biological Products: Draft Guidance for Industry. January 12, 2026.
- U.S. Food and Drug Administration. Adaptive Designs for Clinical Trials of Drugs and Biologics: Guidance for Industry. November 2019.
Last updated: July 2026
Ready to stress-test your composed design?
Use our Composed Pipeline T1E Simulator for pipeline-level Type I error under prior-data conflict and time-trend scenarios for designs that compose borrowing, monitoring, SSR, and RAR.
Open Composed Pipeline T1E Simulator