November 25, 2026


| Component | What it controls |
|---|---|
cohort_size |
Capacity of each backfill cohort |
max_size |
Total backfill enrollment across the trial |
opening |
When a lower-dose cohort can enroll |
recruitment |
How many backfill patients can enroll per cycle |
priority |
Which open cohort fills first |
Design() defaults to OpeningNone(). After each escalation cohort, the simulator updates the queue, fills available slots in priority order, then fits the model and applies dose and stopping rules.
Backfill simulation is supported for standard Design objects. Note that examine() omits backfill because it would be too complicated quickly.
Open eligible lower-dose cohorts after one completed escalation cohort.
Open after at least three escalation cohorts and a response at the candidate dose or below.
backfill_complex <- Backfill(
cohort_size = CohortSizeRandom(min_size = 1, max_size = 6),
opening = OpeningMinCohorts(min_cohorts = 3) &
OpeningMinResponses(
min_responses = 1,
include_lower_doses = TRUE
),
recruitment = RecruitmentRatio(ratio = 1 / 2),
priority = "highest",
max_size = 20
)
design_complex_backfill <- design_no_backfill
design_complex_backfill@backfill <- backfill_complexThe simple and response-gated designs use the same dose-toxicity scenario.

Ten trials per design with short MCMC runs for illustration.
Hollow symbols mark backfilled patients.
Blue squares mark observed responses.
Count backfilled patients in each trial using the patient-level backfilled flag.
backfill_counts_simple
9 12
1 9
backfill_counts_complex
0 2 3 6 10
6 1 1 1 1
summary(sims_simple, truth = myTruth) reports backfill counts and dose allocation across simulations:
Summary of 10 simulations
Target toxicity interval was 20, 35 %
Target dose interval corresponding to this was 13, 16.8
Intervals are corresponding to 10 and 90 % quantiles
Number of patients overall : mean 37 (33, 42)
Number of patients treated above target tox interval : mean 7 (3, 9)
Proportions of DLTs in the trials : mean 16 % (12 %, 20 %)
Mean toxicity risks for the patients on active : mean 19 % (16 %, 22 %)
Doses selected as MTD : mean 18 (15, 20)
True toxicity at doses selected : mean 40 % (28 %, 48 %)
Proportion of trials selecting target MTD: 40 %
Dose most often selected as MTD: 20
Observed toxicity rate at dose most often selected: 50 %
Number of backfill patients : mean 12 (12, 12)
Doses for backfill patients: 3: 25.6%, 5: 25.6%, 10: 35.9%, 15: 12.8%
Fitted toxicity rate at dose most often selected : mean 31 % (25 %, 39 %)
Overdose probability at selected dose : mean 11 % (5 %, 20 %)
Stop reason triggered:
≥ 3 cohorts dosed : 100 %
P(0.2 ≤ prob(DLE | NBD) ≤ 0.35) ≥ 0.5 : 100 %
≥ 10 patients dosed in 30 % dose range around NBD : 90 %
≥ 40 patients dosed : 30 %
Stopped because of missing dose : 0 %
In the model of @Neuenschwander2015, two single-agent models give the DLT probabilities \(p_1(x_1)\) and \(p_2(x_2)\). Under independent toxicity, the probability of at least one DLT is
\[ p_0(x_1,x_2)=1-[1-p_1(x_1)][1-p_2(x_2)]. \]
With the additional interaction term, the model becomes
\[ \operatorname{logit}(p(x_1,x_2)) = \operatorname{logit}(p_0(x_1,x_2)) + \eta\frac{x_1}{x_1^*}\frac{x_2}{x_2^*}. \]
Positive \(\eta\) raises DLT odds relative to independence, and negative \(\eta\) lowers them.
For details see the Combination designs vignette and Satrajit’s slides on the Bayesian combination model
TwoDrugsCombo() pairs the two single-agent models with a prior on the interaction.
Use one-drug-at-a-time escalation and cap increases at 200% for each drug.
Both drugs range from 10 to 50 in steps of 5. Start at (10, 20) with cohorts of three and a 20-patient stopping threshold.
my_next_best <- NextBestNCRM(
target = c(0.2, 0.35),
overdose = c(0.35, 1),
max_overdose_prob = 0.25
)
my_stopping <- StoppingMinPatients(nPatients = 20)
empty_data <- DataCombo(
doseGrid = list(
drug1 = seq(from = 10, to = 50, by = 5),
drug2 = seq(from = 10, to = 50, by = 5)
)
)
design_combo <- DesignCombo(
model = combo_model,
nextBest = my_next_best,
stopping = my_stopping,
increments = my_increments,
cohort_size = CohortSizeConst(3L),
data = empty_data,
startingDose = c(drug1 = 10, drug2 = 20)
)Simulate 20 trials. The assumed DLT probability includes a dose-by-dose interaction.
Larger circles indicate more patients on average. Thicker arrows indicate more frequent transitions.

parameter_pools <- list(
drug1_intercept = list(
mono_drug1 = "alpha0",
combo = "alpha0[1]"
),
drug1_slope = list(
mono_drug1 = "alpha1",
combo = "alpha1[1]"
),
drug2_intercept = list(
mono_drug2 = "alpha0",
combo = "alpha0[2]"
),
drug2_slope = list(
mono_drug2 = "alpha1",
combo = "alpha1[2]"
),
interaction = list(
combo = "eta"
)
)
pool_correlations <- list(
drug1 = c("drug1_intercept", "drug1_slope"),
drug2 = c("drug2_intercept", "drug2_slope")
)
pool_priors <- list(
drug1_intercept = list(
mu = c(mean = qlogis(0.25), sd = 2.5),
tau = c(meanlog = log(0.5), sdlog = log(2) / 1.96)
),
drug1_slope = list(
mu = c(mean = 0, sd = 0.7),
tau = c(meanlog = log(0.25), sdlog = log(2) / 1.96)
),
drug2_intercept = list(
mu = c(mean = qlogis(0.25), sd = 2.5),
tau = c(meanlog = log(0.75), sdlog = log(2) / 1.96)
),
drug2_slope = list(
mu = c(mean = 0, sd = 1),
tau = c(meanlog = log(0.25), sdlog = log(2) / 1.96)
),
interaction = list(
mu = c(mean = 0, sd = 1.121),
tau = c(meanlog = log(0.125), sdlog = log(2) / 1.96)
)
)Wrap each component design in a named DesignArm() and use those names in the exchangeable pools.
design_mono_drug1 <- Design(
model = combo_model@single_models$drug1,
nextBest = my_next_best,
stopping = StoppingMinPatients(nPatients = 20) | StoppingMissingDose(),
increments = IncrementsRelative(intervals = c(0), increments = c(2)),
cohort_size = CohortSizeConst(3L),
data = Data(
doseGrid = seq(from = 10, to = 50, by = 5)
),
startingDose = 10
)
design_mono_drug2 <- Design(
model = combo_model@single_models$drug2,
nextBest = my_next_best,
stopping = StoppingMinPatients(nPatients = 20) | StoppingMissingDose(),
increments = IncrementsRelative(intervals = c(0), increments = c(2)),
cohort_size = CohortSizeConst(3L),
data = Data(
doseGrid = seq(from = 10, to = 50, by = 5)
),
startingDose = 20
)
design_arm_mono_drug1 <- DesignArm(
name = "mono_drug1",
design = design_mono_drug1
)
design_arm_mono_drug2 <- DesignArm(
name = "mono_drug2",
design = design_mono_drug2
)
design_arm_combo <- DesignArm(
name = "combo",
design = design_combo
)Finally we can assemble the hierarchical design using the individual arm designs and the specified parameter pools, correlations, and priors:
truth_mono_drug1 <- function(dose) plogis(-4 + 0.08 * dose)
truth_mono_drug2 <- function(dose) plogis(-4 + 0.06 * dose)
truth_combo <- function(dose) plogis(-4 + 0.08 * dose[1] + 0.06 * dose[2] + 0.001 * dose[1] * dose[2])
hierarchical_sims <- simulate(
hierarchical_design,
truth = list(
mono_drug1 = truth_mono_drug1,
mono_drug2 = truth_mono_drug2,
combo = truth_combo
),
truthResponse = list(
# Just for demo purposes we choose the same functions for efficacy.
mono_drug1 = truth_mono_drug1,
mono_drug2 = truth_mono_drug2,
combo = truth_combo
),
nsim = 20,
seed = 819,
mcmcOptions = mcmc_options,
parallel = FALSE
)Extract an arm to review its dose trajectories and allocation across trials.
HistoricalArm() supplies existing data to the hierarchical model without opening enrollment.open_when delays an arm until a condition is met, such as a monotherapy arm reaching dose 20.borrow = FALSE uses an arm-specific fit for that arm’s dose and stopping decisions. The arm still contributes to the hierarchical model.scenario() evaluates next-dose and stopping decisions for fixed data supplied through HierarchicalData().