Tutorials › Response-Adaptive Randomization › Use Paired Replicates To Compare Designs Efficiently

Simulation Studies · Tutorial 491 of 501

Use Paired Replicates To Compare Designs Efficiently

Use shared simulated conditions and paired replicate contrasts to estimate design differences more precisely, while checking whether the chosen pairing actually reduces Monte Carlo variability.

Intermediate 11 min read

What You'll Learn

  • Define a paired replicate contrast and the design difference it estimates.
  • Derive the variance and standard error of a paired Monte Carlo comparison.
  • Distinguish shared scenario inputs from design-specific randomization and response randomness.
  • Calculate and interpret paired Monte Carlo uncertainty for continuous and binary metrics.
  • Recognize when pairing reduces variability, has little effect, or increases it.
  • Compare paired simulation with independent-replicate simulation and diagnose weak pairings.

Why Pair Replicates?

A simulation comparison asks how two trial designs differ in a performance measure, such as a rejection proportion or an estimator’s average error. Even when both designs are simulated under the same scenario, the Monte Carlo estimates can be noisy: each set of simulated trials is only a finite sample from the design’s operating distribution. A useful way to reduce that noise is to make each replicate under one design correspond to a replicate under the other design, with both exposed to carefully chosen common random inputs.

The aim is not to make the simulated trials identical. The designs may allocate patients differently, follow different adaptive paths, or produce different outcomes. Instead, pairing seeks to make the two replicate-level performance values move together. If a particular replicate’s shared conditions make the performance measure unusually high under both designs, their difference may still be relatively stable. The comparison then uses that difference directly.

Definition: Let \(M_{Ar}\) and \(M_{Br}\) be the performance values from replicate \(r\) under designs A and B, respectively. A paired replicate contrast is \(D_r=M_{Ar}-M_{Br}\). With \(R\) paired replicates, the estimated difference is \(\bar{D}=R^{-1}\sum_{r=1}^{R}D_r\). Its target is \(\Delta=E(M_A)-E(M_B)\), where each expectation is under that design’s specified simulation distribution.

The sign convention matters: with \(D_r=M_{Ar}-M_{Br}\), a positive \(\bar{D}\) means the simulated mean performance value is higher under A. Whether that is desirable depends on the metric. For example, a higher rejection probability can mean greater power under an alternative, but a higher rejection probability under the null can mean worse Type I error control. The contrast describes a difference; it does not by itself say which design is preferable.

What Is Shared, and What Must Remain Design-Specific?

Common random numbers (CRN) are random inputs deliberately shared, or coupled, across designs to create a useful dependence between their replicate outcomes. Depending on the simulation, shared inputs can include a replicate’s nuisance-parameter scenario, patient covariates, or latent outcome-generating values indexed by patient and treatment. Randomness that determines allocation under a particular design may need to differ or be transformed according to that design’s allocation probabilities. Each design must still have its intended marginal simulation distribution.

A sound pairing therefore has two requirements. First, each design’s replicate must be generated according to that design’s specified mechanism; sharing random inputs must not change either marginal distribution. Second, pairs from different replicate indices must be independent, or have a dependence structure that is explicitly accounted for. Within a pair, however, \(M_{Ar}\) and \(M_{Br}\) are generally dependent. That dependence is the point of the method.

For example, the same scenario value can be used for both designs in replicate \(r\), while each design applies its own allocation rule to its sequential history. If response outcomes are generated using latent uniforms, a shared set of appropriately indexed uniforms can induce related outcomes without requiring the designs to assign the same treatment. The shared inputs define a coupling: a joint way to generate two outputs that preserves each output’s correct marginal distribution.

Assumptions for the paired Monte Carlo standard error: Each pair must have the correct marginal outputs under designs A and B; the replicate pairs must be independent and identically distributed for the usual standard error formula; and the paired contrast must have finite variance. Within-pair independence is not assumed. If replicates are dependent across \(r\), the usual formula may not describe Monte Carlo uncertainty.

Why Pairing Can Reduce Monte Carlo Error

The paired estimator is an average of replicate contrasts. Its variance depends on the variance of a contrast, not on the two marginal variances alone. The covariance induced within each pair can either reduce or increase that variance.

$$ \operatorname{Var}(D_r)=\operatorname{Var}(M_{Ar})+\operatorname{Var}(M_{Br})-2\operatorname{Cov}(M_{Ar},M_{Br}) $$

Because the \(R\) contrasts are independent across replicates, the variance of their mean is \(\operatorname{Var}(\bar{D})=\operatorname{Var}(D_r)/R\). In practice, estimate the standard deviation of the observed contrasts by \(s_D\), the sample standard deviation of \(D_1,\ldots,D_R\). Then the estimated Monte Carlo standard error is:

$$ SE(\bar{D})=\frac{s_D}{\sqrt{R}} $$

This standard error quantifies simulation error in estimating the difference \(\Delta\). It is not the standard error of an effect estimated from one clinical trial, and it does not include uncertainty about whether the simulation assumptions represent real trial settings.

Worked Comparisons

Worked Example: Contrasts for a Continuous Performance Metric

Suppose a hypothetical simulation compares two designs using a continuous performance measure, recorded in a fixed unit. Eight paired replicates produce the following differences \(D_r=M_{Ar}-M_{Br}\), in that unit: \(-0.02,\ 0.01,\ 0.00,\ 0.03,\ -0.01,\ 0.02,\ 0.01,\ -0.02\). Assume the pairs are independent across replicates and each design’s output has the intended marginal distribution.

The estimated difference is the average contrast:

$$ \bar{D}=\frac{-0.02+0.01+0.00+0.03-0.01+0.02+0.01-0.02}{8} =\frac{0.02}{8}=0.0025 $$

Thus, the estimated mean performance value is 0.0025 units higher under A than under B. The sample standard deviation of the eight contrasts is \(s_D=0.01832\) units, giving:

$$ SE(\bar{D})=\frac{0.01832}{\sqrt{8}}=0.006477 $$

The Monte Carlo standard error is about 0.0065 units, which is larger than the estimated difference. With only eight replicates, the simulation has limited precision for resolving a difference this small. This calculation addresses Monte Carlo precision, not whether the difference is clinically important.

Worked Example: Paired Replicates for a Rejection Proportion

In a hypothetical null-scenario simulation, both designs are run for 100 paired replicates. Design A rejects in 30 replicates and design B rejects in 25. Of the pairs, both reject in 22, only A rejects in 8, only B rejects in 3, and neither rejects in 67. These counts sum to 100 and imply the stated marginal rejection counts.

Let \(M_{Ar}\) and \(M_{Br}\) be rejection indicators, so each is 1 for a rejection and 0 otherwise. The paired contrast is 1 for the 8 A-only rejections, \(-1\) for the 3 B-only rejections, and 0 for the other 89 pairs. Therefore:

$$ \bar{D}=\frac{8-3}{100}=0.05 $$

The estimated rejection-proportion difference is 0.05, or 5 percentage points, higher for A. For the contrast sample variance, the sum of squared contrasts is \(8(1^2)+3((-1)^2)=11\), and the sum of contrasts is 5. Thus:

$$ s_D^2=\frac{11-\frac{5^2}{100}}{99} =\frac{10.75}{99}=0.1086,\qquad SE(\bar{D})=\sqrt{\frac{0.1086}{100}}=0.03295 $$

The Monte Carlo standard error is about 3.3 percentage points. For comparison, treating the marginal rejection estimates as independent would give an estimated standard error of \(\sqrt{0.30(0.70)/100+0.25(0.75)/100}=0.06305\). The paired standard error is smaller here because the two rejection indicators are positively associated: both reject in many of the same replicates. This is simulation uncertainty in the estimated difference under the null scenario, not a confidence interval for a treatment effect in patients.

Worked Example: Pairing Can Increase Monte Carlo Error

Suppose pilot simulation results for a hypothetical continuous metric suggest \(\operatorname{Var}(M_A)=16\), \(\operatorname{Var}(M_B)=9\), and \(\operatorname{Cov}(M_A,M_B)=-4\), in squared metric units. These are properties of the replicate-level outputs under a proposed pairing. The paired contrast variance is:

$$ \operatorname{Var}(M_A-M_B)=16+9-2(-4)=33 $$

If the outputs were generated independently, the contrast variance would instead be \(16+9=25\). For \(R=100\), the estimated standard errors implied by these variances are \(\sqrt{33/100}=0.5745\) units with this pairing and \(\sqrt{25/100}=0.5000\) units under independent generation. The negative covariance makes the paired comparison less precise. Pairing is not automatically a variance reduction; the covariance it creates determines whether it helps.

A Short Derivation and a Practical Comparison

The reason the paired standard error is appropriate follows directly from averaging the contrasts. Write \(\mu_D=E(D_r)\) and \(\sigma_D^2=\operatorname{Var}(D_r)\). Under independence across replicate pairs, the variance of a sum is the sum of the variances. Hence:

$$ \operatorname{Var}(\bar{D}) =\operatorname{Var}\left(\frac{1}{R}\sum_{r=1}^{R}D_r\right) =\frac{1}{R^2}\sum_{r=1}^{R}\operatorname{Var}(D_r) =\frac{R\sigma_D^2}{R^2} =\frac{\sigma_D^2}{R} $$

Replacing \(\sigma_D\) by its sample estimate \(s_D\) gives \(SE(\bar{D})=s_D/\sqrt{R}\). This derivation also shows why the pairing must be preserved in the calculation: the variability to estimate is the variability of \(D_r\), including the within-pair covariance.

An independent-replicate comparison estimates each design’s mean separately and combines their standard errors. For equal replicate counts and independent outputs across designs, its variance is approximately \(\operatorname{Var}(M_A)/R+\operatorname{Var}(M_B)/R\). A paired comparison instead has variance \(\{\operatorname{Var}(M_A)+\operatorname{Var}(M_B)-2\operatorname{Cov}(M_A,M_B)\}/R\). Positive covariance favors pairing; negative covariance favors independent simulation. Both approaches target the same difference when the marginal simulation distributions are correct.

ApproachWhat is calculatedMain consideration
Paired replicatesMean and standard error of the replicate differencesCan gain precision from positive within-pair covariance; needs a defensible coupling
Independent replicatesDifference between separate design means, with their Monte Carlo variances combinedStraightforward when no useful pairing is available; does not exploit common conditions
Shared conditions without matched contrastsSeparate summaries under a common scenario, but no replicate-level difference is retainedMay aid comparability of scenarios, but does not by itself deliver the paired standard error

Diagnostics, Pitfalls, and Limitations

After running a set of pairs, inspect the standard deviation of the contrasts and the association between the two designs’ replicate values. A strong positive association often accompanies a smaller paired standard error than the independent calculation, while weak or negative association signals little gain or possible loss. These are diagnostics of the realized pairing, not guarantees that a future simulation will have the same covariance. The practical question is whether the pairing is both correctly constructed and useful for the estimand.

One common mistake is to assume that using the same random-number seed for both designs automatically creates a good pair. Wrong reasoning: “The seeds match, so replicate 1 under A and replicate 1 under B must experience the same conditions.” If the designs consume random numbers in different orders or amounts, corresponding draws may represent different events. Correction: define what inputs are intended to be shared, index or generate them so their meaning is clear, and preserve each design’s own allocation and response mechanism. Then check the resulting within-pair association and contrast variability.

Another mistake is to calculate a paired standard error while discarding the pairing information. For instance, calculating separate standard errors for the two designs and combining them as if outputs were independent ignores their covariance. Conversely, treating many patients within a simulated trial as if they were independent replicate pairs confuses the trial’s sampling variability with Monte Carlo variability across simulated trials.

Pairing also has limits. A coupling that gives little covariance may not reduce computation or Monte Carlo error. A negative covariance can make precision worse. For several designs, comparisons should use a clearly defined pairing and a contrast for each prespecified comparison; the paired standard error for one contrast does not resolve uncertainty across every possible comparison. Finally, common random numbers do not correct a misspecified data-generating mechanism, a coding error, or an unsuitable performance metric. They improve the efficiency of estimating a simulation-defined comparison, not the validity of the simulation’s assumptions.

Key takeaway: Pairing is useful when each design has the correct marginal simulation distribution and the chosen shared inputs induce positive covariance in the replicate-level outputs. Estimate uncertainty from the replicate contrasts themselves, and compare its size with the independent-replicate alternative.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. In one sentence, define the target \(\Delta\) of a paired comparison using \(M_A\) and \(M_B\).
  2. For paired outputs with variances 10 and 6 and covariance 3, what is the variance of their difference? What would it be if the outputs were independent?
  3. In a binary-metric simulation with 200 pairs, A rejects in 50 replicates, B rejects in 44, and both reject in 38. Find the paired estimated difference in rejection proportions.
  4. Why does sharing a random-number seed alone not establish that two replicates form a meaningful pair?

Solutions. (1) \(\Delta=E(M_A)-E(M_B)\), the difference between the two designs’ mean performance values under their specified simulation distributions. (2) The paired difference variance is \(10+6-2(3)=10\); with independent outputs it is \(10+6=16\). (3) A rejects alone in \(50-38=12\) pairs, while B rejects alone in \(44-38=6\). Thus \(\bar{D}=(12-6)/200=0.03\), or 3 percentage points higher for A. (4) Different designs may consume random numbers in different orders or amounts, so the same seed need not align corresponding draws with the same simulated meaning. A meaningful pairing requires deliberate shared-input construction while preserving each design’s correct marginal mechanism.

Clinical Biostats