Introduction
Randomized experiments are widely used to study whether a treatment changes outcomes. Treatment effects may vary with age, baseline risk, or prior behavior, and an average effect alone does not describe these differences across covariate values.
In a clinical trial, for example, a drug may change outcomes for patients in some age ranges but leave those in another range unaffected. A similar question arises in a voter-turnout experiment: an intervention may affect participation among people with some voting histories while having no effect among others. In both settings, an overall treatment effect can coexist with an unaffected covariate region.
Randomization inference methods provide valid inference on treatment effects based on the experimental design. Fisher’s randomization test [6 ] has finite-sample validity for the sharp null that treatment has a zero effect on all individual outcomes. Recent work extends randomization tests to detect a wider variety of treatment effects. Tests of weak nulls, such as a zero sample-average effect, can be asymptotically valid under suitable conditions [12 , 14 , 5 ] . Other methods give finite-sample inference for quantiles of individual treatment effects and for the proportion of effects above a specified threshold [3 , 4 ] . Randomization methods also test sharp nulls within pre-specified or selected subgroups [13 , 7 ] . A complementary question is how large a covariate region could be in which treatment leaves every unit unaffected. Even a statistically significant average treatment effect can coexist with a large unaffected covariate region. Bounding its size helps assess how broadly treatment effects extend across covariate values.
Contributions. In this work, we develop randomization inference for the reach of treatment effects across covariate values. Using efficient local randomization tests, we construct a finite-sample valid upper confidence bound for the size of the largest zero-effect region. We choose the pre-treatment covariates in advance and consider nearest-neighbour regions around observed points. A zero-effect region is one in which treatment leaves each unit’s outcome unchanged. Size is measured by the number of units in the region, or their proportion in the sample. A small upper bound provides evidence against large unaffected regions. A large bound leaves open the possibility that treatment has no effect on a large covariate region.
Figure 1 previews results from an experiment on AI-assisted writing [10 ] . College-educated professionals completed two occupation-specific writing tasks, with half randomly assigned access to ChatGPT before the second task. We order participants by their first-task grade. The 95% upper confidence bounds for the size of the largest zero-effect region are 25.6% of the sample for second-task writing quality and 18.4% for completion time.1 For writing quality, the non-rejected regions lie among participants with high first-task grades, leaving the possibility that ChatGPT does not improve writing quality for some participants who already write well.
Figure 1. Results from the AI-assisted writing experiment. The 95% upper confidence bounds L ^ n , 0 U \widehat{L}_{n,0}^{U} L n , 0 U for the size of the largest zero-effect region are (a) 90 participants (25.6%) for second-task writing quality and (b) 65 participants (18.4%) for second-task completion time. The blue region is the union of blocks of the reported size L ^ n , 0 U \widehat{L}_{n,0}^{U} L n , 0 U for which the zero-effect null hypotheses are not rejected.
Like randomization tests, our upper confidence bounds have finite-sample validity based on the experimental design. A 95% upper bound understates the true size of the largest zero-effect region with probability at most 5%. This validity requires no model assumptions about the covariates or outcomes. In Section 2, we construct these bounds by combining local randomization tests across locations and sizes and reporting the largest size at which at least one local null is not rejected. Because the regions overlap, computing each local test separately repeats many calculations.
In Section 3, we propose a solution that combines a linear statistic with shared randomization draws, allowing cumulative sums to be reused across tests. For a fixed number of draws, a full one-dimensional search has cubic cost in the sample size if each block-specific conditional test is computed from scratch. Our method reduces this cost to quadratic. Under a monotonicity assumption on the computed p p p -values, bisection reduces the number of lengths tested. A Gaussian approximation can further reduce the number of Monte Carlo evaluations by providing a starting point for the search. In Section 4, we extend our method to two dimensions. An exhaustive search over rectangular regions is costly, and their boundaries may poorly describe groups on curved covariate supports. We therefore extend the nearest-neighbour formulation, which keeps the Monte Carlo cost quadratic in the sample size.
A small upper confidence bound requires rejecting the zero-effect null for every larger candidate region. In § 5 , we study the tightness of the bound by analysing the power of the local tests across region sizes. The analysis uses a general outcome model and allows covariates of arbitrary dimension. A neighbourhood larger than the largest zero-effect region may contain only a few affected units near the zero-effect boundary, making its zero-effect null difficult to reject. We therefore give conditions on the number of affected units and the size of their treatment effects. Under these conditions, the excess of our upper confidence bound over the true size, divided by the sample size, decreases to zero at a minimax optimal rate up to a logarithmic factor.
Finally, in § 6 , we use simulations to assess coverage and computational efficiency. We illustrate the method using data from the Gerber–Green–Larimer voter-turnout experiment and the ACTG 175 HIV clinical trial.
From randomization tests to zero-effect regions
Preliminary: randomization tests for the sharp null
Consider a completely randomized experiment with n n n units, of which exactly n 1 n_1 n 1 receive treatment. Write [ n ] = { 1 , … , n } [n] = \{1, \ldots, n\} [ n ] = { 1 , … , n } . For unit i i i , let X i X_i X i denote the covariates, Z i ∈ { 0 , 1 } Z_i \in\{0, 1\} Z i ∈ { 0 , 1 } the treatment indicator, and Y i Y_i Y i the observed outcome. We write the observation for unit i i i and the full data as
O i = ( X i , Y i , Z i ) , O [ n ] = ( X [ n ] , Y [ n ] , Z [ n ] ) . O_i = (X_i, Y_i, Z_i), \qquad O_{[n]} = (X_{[n]}, Y_{[n]}, Z_{[n]}). O i = ( X i , Y i , Z i ) , O [ n ] = ( X [ n ] , Y [ n ] , Z [ n ] ) .
Each unit has two potential outcomes, Y i ( 0 ) Y_i(0) Y i ( 0 ) and Y i ( 1 ) Y_i(1) Y i ( 1 ) . The observed outcome is
Y i = Y i ( Z i ) = Z i Y i ( 1 ) + ( 1 − Z i ) Y i ( 0 ) , i ∈ [ n ] . Y_i = Y_i(Z_i) = Z_iY_i(1) + (1 - Z_i)Y_i(0), \qquad i \in[n]. Y i = Y i ( Z i ) = Z i Y i ( 1 ) + ( 1 − Z i ) Y i ( 0 ) , i ∈ [ n ] .
Fisher’s global sharp null [6 ] is defined as
H 0 : Y i ( 1 ) = Y i ( 0 ) for every i ∈ [ n ] . (1) H_0 : \quad Y_i(1) = Y_i(0) \quad\text{for every } i \in[n]. \tag*{(1)} H 0 : Y i ( 1 ) = Y i ( 0 ) for every i ∈ [ n ] . (1)
The null is sharp because it determines every missing potential outcome: Y i ( z ) = Y i Y_i(z) = Y_i Y i ( z ) = Y i for z ∈ { 0 , 1 } z \in\{0, 1\} z ∈ { 0 , 1 } . Fix a test statistic T ( x [ n ] , y [ n ] , z [ n ] ) T(x_{[n]}, y_{[n]}, z_{[n]}) T ( x [ n ] , y [ n ] , z [ n ] ) . Under H 0 H_0 H 0 , the observed outcomes remain unchanged under every admissible assignment z [ n ] z_{[n]} z [ n ] . We write
T ( O [ n ] ( z [ n ] ) ) : = T ( X [ n ] , Y [ n ] , z [ n ] ) . T\bigl(O_{[n]}(z_{[n]})\bigr) := T(X_{[n]}, Y_{[n]}, z_{[n]}). T ( O [ n ] ( z [ n ] ) ) := T ( X [ n ] , Y [ n ] , z [ n ] ) .
This gives the exact randomization p p p -value
p ( O [ n ] ) = P Z ~ [ n ] { T ( O [ n ] ( Z ~ [ n ] ) ) ≥ T ( O [ n ] ) } , p(O_{[n]}) = \mathbb{P}_{\widetilde{Z}_{[n]}}\left\{T\bigl(O_{[n]}(\widetilde{Z}_{[n]})\bigr) \ge T(O_{[n]})\right\}, p ( O [ n ] ) = P Z [ n ] { T ( O [ n ] ( Z [ n ] ) ) ≥ T ( O [ n ] ) } ,
where Z ~ [ n ] \widetilde{Z}_{[n]} Z [ n ] is drawn from the known treatment assignment distribution.
In practice, we approximate p ( O [ n ] ) p(O_{[n]}) p ( O [ n ] ) using Monte Carlo simulation. Draw Z [ n ] ( 1 ) , … , Z [ n ] ( M ) Z^{(1)}_{[n]},\ldots,Z^{(M)}_{[n]} Z [ n ] ( 1 ) , … , Z [ n ] ( M ) independently from the known treatment assignment distribution, and define
p M ( O [ n ] ) = 1 + ∑ m = 1 M 1 { T ( O [ n ] ( Z [ n ] ( m ) ) ) ≥ T ( O [ n ] ) } M + 1 . p_M(O_{[n]}) = \frac{1+\sum_{m=1}^{M}\mathbb{1}\{T(O_{[n]}(Z^{(m)}_{[n]})) \ge T(O_{[n]})\}}{M+1}. p M ( O [ n ] ) = M + 1 1 + ∑ m = 1 M 1 { T ( O [ n ] ( Z [ n ] ( m ) )) ≥ T ( O [ n ] )} .
Under H 0 H_0 H 0 , the observed and Monte Carlo assignments are exchangeable. Therefore, the observed and simulated test statistics are also exchangeable, and p M ( O [ n ] ) p_M(O_{[n]}) p M ( O [ n ] ) is valid:
P { p M ( O [ n ] ) ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≤ α for all α ∈ [ 0 , 1 ] . (2) \mathbb{P}\left\{p_M(O_{[n]}) \le\alpha\mid X_{[n]},Y_{[n]}(0),Y_{[n]}(1)\right\} \le\alpha\qquad\text{for all }\alpha\in[0,1]. \tag*{(2)} P { p M ( O [ n ] ) ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≤ α for all α ∈ [ 0 , 1 ] . (2)
Here, the probability is over both the observed and Monte Carlo assignments. Thus, rejecting the sharp null when p M ( O [ n ] ) ≤ α p_M(O_{[n]}) \le\alpha p M ( O [ n ] ) ≤ α controls the type I error at level α \alpha α .
What rejection and non-rejection mean. The alternative to the sharp null is
H 1 : Y i ( 1 ) ≠ Y i ( 0 ) for at least one i ∈ [ n ] . H_1:\quad Y_i(1) \ne Y_i(0) \quad\text{for at least one } i \in[n]. H 1 : Y i ( 1 ) = Y i ( 0 ) for at least one i ∈ [ n ] .
Rejection therefore provides evidence that treatment changes at least one outcome in the sample. This is a useful starting point for a more detailed analysis of treatment effects. With this evidence, we can move on to questions about which units are affected, whether effects differ across units, and how broadly they extend across covariate values. These questions require further inference: rejection of the global null alone does not answer them. In particular, it leaves open the possibility that a large covariate region is unaffected. If the null is not rejected, the chosen test does not provide enough evidence to conclude that a treatment effect is present. This does not establish that all effects are zero. Other methods can help study how average treatment effects vary across covariate values [1 , 11 ] . Their confidence intervals, however, rely on large-sample approximations under additional assumptions. Our goal is to rule out large zero-effect regions when the data allow, while retaining the finite-sample design-based validity.
Bounding the length of zero-effect regions
We apply randomization tests locally to study how large an unaffected group could be. Each local sharp null states that treatment leaves every unit in the group unaffected. Suppose non-rejection occurs only for small groups, while the local sharp null is rejected for every larger candidate group. We use this idea to construct an upper confidence bound on the size of the largest zero-effect group.
We impose structure on the candidate groups. For simplicity, we consider contiguous regions after ordering the units by a covariate chosen in advance. Arbitrary groups may contain units scattered across covariate values, making them hard to interpret. They may also contain only weak treatment effects, making it harder to reject all local nulls at a given size. We study the power issues formally in § 5 .
Let W i ∈ R W_i \in\mathbb{R} W i ∈ R denote the chosen covariate in X i X_i X i . Without loss of generality, index units so that W 1 ≤ W 2 ≤ ⋯ ≤ W n W_1 \le W_2 \le\cdots\le W_n W 1 ≤ W 2 ≤ ⋯ ≤ W n , with ties broken by a rule chosen in advance. We measure a block’s length by its number of units. For r ∈ [ n ] r \in[n] r ∈ [ n ] , denote the collection of contiguous blocks containing r r r units by
B r : = { B s ( r ) : s ∈ [ n − r + 1 ] } \mathcal{B}_r := \{B_s^{(r)} : s \in[n-r+1]\} B r := { B s ( r ) : s ∈ [ n − r + 1 ]}
where B s ( r ) : = { s , s + 1 , … , s + r − 1 } B_s^{(r)} := \{s,s+1,\ldots,s+r-1\} B s ( r ) := { s , s + 1 , … , s + r − 1 } . For each contiguous block B ⊆ [ n ] B \subseteq[n] B ⊆ [ n ] , define
H 0 , B : Y i ( 1 ) = Y i ( 0 ) for all i ∈ B . (3) H_{0,B}: \quad Y_i(1)=Y_i(0)\quad\text{for all }i\in B. \tag*{(3)} H 0 , B : Y i ( 1 ) = Y i ( 0 ) for all i ∈ B . (3)
For a fixed r r r , define the union of the local nulls over all blocks of length r r r :
H 0 ( r ) : ∃ B ∈ B r such that H 0 , B holds. (4) H_0^{(r)}:\quad\exists B\in\mathcal{B}_r\text{ such that }H_{0,B}\text{ holds.} \tag*{(4)} H 0 ( r ) : ∃ B ∈ B r such that H 0 , B holds. (4)
That is, there exists a contiguous region of length r r r in which every unit has zero treatment effect. We define the length of the longest zero-effect block by
L 0 : = max { ∣ B ∣ : B is contiguous and Y i ( 1 ) = Y i ( 0 ) for every i ∈ B } , (5) L_0 := \max\{|B| : B\text{ is contiguous and }Y_i(1)=Y_i(0)\text{ for every }i\in B\}, \tag*{(5)} L 0 := max { ∣ B ∣ : B is contiguous and Y i ( 1 ) = Y i ( 0 ) for every i ∈ B } , (5)
with L 0 = 0 L_0=0 L 0 = 0 if no nonempty zero-effect block exists. We write L 0 ( W ) L_0(W) L 0 ( W ) when we want to emphasize the ordering covariate. Because every sub-block of a zero-effect block is also a zero-effect block, the nulls are nested:
H 0 ( r ′ ) ⟹ H 0 ( r ) whenever r ′ > r . H_0^{(r')} \Longrightarrow H_0^{(r)}\quad\text{whenever }r'>r. H 0 ( r ′ ) ⟹ H 0 ( r ) whenever r ′ > r .
By the definition of L 0 L_0 L 0 , we have the equivalence:
H 0 ( r ) ⟺ L 0 ≥ r . H_0^{(r)} \Longleftrightarrow L_0\ge r. H 0 ( r ) ⟺ L 0 ≥ r .
For each block B B B , let p B p_B p B be a valid p p p -value for the local sharp null H 0 , B H_{0,B} H 0 , B . The null H 0 ( r ) H_0^{(r)} H 0 ( r ) holds when the local sharp null holds for at least one block of length r r r . Following the intersection–union principle [2 ] , we reject H 0 ( r ) H_0^{(r)} H 0 ( r ) only when every local null for a block of length r r r is rejected. We therefore use the maximum p p p -value
P r : = max B ∈ B r p B . (6) P_r := \max_{B\in\mathcal{B}_r}p_B. \tag*{(6)} P r := B ∈ B r max p B . (6)
If H 0 ( r ) H_0^{(r)} H 0 ( r ) holds, then H 0 , B 0 H_{0,B_0} H 0 , B 0 holds for at least one block B 0 B_0 B 0 of length r r r . Because P r P_r P r is the maximum of the block-level p p p -values, it is at least as large as p B 0 p_{B_0} p B 0 . Therefore, P r P_r P r can be at most α \alpha α only if p B 0 p_{B_0} p B 0 is also at most α \alpha α . Since p B 0 p_{B_0} p B 0 is valid under H 0 , B 0 H_{0,B_0} H 0 , B 0 , this event has probability at most α \alpha α . Thus, P r P_r P r is a valid p p p -value for H 0 ( r ) H_0^{(r)} H 0 ( r ) . No independence across overlapping blocks is required for this max-p p p validity argument.
Inverting over block lengths. We invert the tests over r r r . The p p p -values need not decrease with length, so the first rejection does not immediately give a valid upper bound. We report the largest non-rejected length:
L ^ 0 U : = max { r ∈ [ n ] : P r > α } = max { r ∈ [ n ] : P r ↑ > α } , (7) \widehat{L}^{U}_{0} := \max\{r \in[n] : P_r > \alpha\} = \max\{r \in[n] : P_r^{\uparrow} > \alpha\}, \tag*{(7)} L 0 U := max { r ∈ [ n ] : P r > α } = max { r ∈ [ n ] : P r ↑ > α } , (7)
where P r ↑ : = max s ∈ [ n ] : s ≥ r P s P_r^{\uparrow} := \max_{s\in[n]:\,s\ge r} P_s P r ↑ := max s ∈ [ n ] : s ≥ r P s . We set L ^ 0 U = 0 \widehat{L}^{U}_{0}=0 L 0 U = 0 if all lengths are rejected. The equality holds even when the p p p -values are not monotone in length. Indeed, P r ↑ > α P_r^{\uparrow} > \alpha P r ↑ > α holds when P s > α P_s > \alpha P s > α for some s ≥ r s \ge r s ≥ r , so both maxima equal the largest length with P s > α P_s > \alpha P s > α .
Proposition 1 (Upper confidence bound). If each p B p_B p B is valid under H 0 , B H_{0,B} H 0 , B conditional on the covariates and potential outcomes, then the bound in (7) satisfies
P { L ^ 0 U ≥ L 0 | X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≥ 1 − α . \mathbb{P}\left\{\widehat{L}^{U}_{0} \ge L_0 \,\middle|\, X_{[n]},Y_{[n]}(0),Y_{[n]}(1)\right\} \ge1-\alpha. P { L 0 U ≥ L 0 X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≥ 1 − α .
When the upper confidence bound L ^ 0 U ≥ 1 \widehat{L}^{U}_{0} \ge1 L 0 U ≥ 1 , we may also display the blocks of the reported length whose local sharp nulls are not rejected:
B ^ N R ( α ) : = { B ∈ B L ^ 0 U : p B > α } , D ^ α : = ⋃ B ∈ B ^ N R ( α ) B . \widehat{\mathcal{B}}_{\mathrm{NR}}(\alpha) := \left\{B \in\mathcal{B}_{\widehat{L}^{U}_{0}} : p_B > \alpha\right\}, \qquad\widehat{D}_{\alpha} := \bigcup_{B\in\widehat{\mathcal{B}}_{\mathrm{NR}}(\alpha)} B. B NR ( α ) := { B ∈ B L 0 U : p B > α } , D α := B ∈ B NR ( α ) ⋃ B .
The set D ^ α \widehat{D}_{\alpha} D α contains every ordered position that belongs to at least one non-rejected block of length L ^ 0 U \widehat{L}^{U}_{0} L 0 U . Because several non-rejected blocks may overlap, their union can be longer than L ^ 0 U \widehat{L}^{U}_{0} L 0 U and need not itself form a single block.
A nearest-neighbour formulation. We give an equivalent formulation of the method above using nearest neighbours in one dimension. In Section 4, we use this alternative formulation to extend the method to two covariates.
Since the units are ordered by W W W , define the rank distance between units i i i and j j j as d ( i , j ) : = ∣ i − j ∣ / n d(i,j):=|i-j|/n d ( i , j ) := ∣ i − j ∣/ n . Let N i ( r ) N_i^{(r)} N i ( r ) contain the r r r units nearest to i i i , including i i i itself, with distance ties broken in favour of the smaller rank. Each N i ( r ) N_i^{(r)} N i ( r ) is a contiguous block of length r r r . Conversely, every block B s ( r ) B_s^{(r)} B s ( r ) is the neighbourhood N s + ⌊ r / 2 ⌋ ( r ) N_{s+\lfloor r/2\rfloor}^{(r)} N s + ⌊ r /2 ⌋ ( r ) . Thus,
{ N i ( r ) : i ∈ [ n ] } = B r , P r = max i ∈ [ n ] P N i ( r ) . (8) \left\{N_i^{(r)}:i\in[n]\right\}=\mathcal{B}_r,\qquad P_r=\max_{i\in[n]}P_{N_i^{(r)}}. \tag*{(8)} { N i ( r ) : i ∈ [ n ] } = B r , P r = i ∈ [ n ] max P N i ( r ) . (8)
Different units i i i may have the same set of r r r nearest neighbours. Counting the same block more than once does not change the maximum. The null hypotheses in (4) , the target L 0 L_0 L 0 in (5) , and the upper confidence bound in (7) are therefore identical under the two formulations. We next introduce the methods to compute this bound.
Fast computation
The upper confidence bound in (7) requires local randomization tests across many overlapping blocks. Computing each block-level p p p -value by a separate conditional permutation test is costly. We combine shared randomization draws with a linear statistic to reduce this cost while retaining finite-sample validity.
Conditional permutation is costly
Fix a length r r r and a block B ∈ B r B \in\mathcal{B}_r B ∈ B r . Let K B = ∑ i ∈ B Z i K_B = \sum_{i\in B} Z_i K B = ∑ i ∈ B Z i be the observed number of treated units in B B B . Conditional on K B = k K_B = k K B = k , the distribution of Z B Z_B Z B is uniform over assignments that treat exactly k k k units in B B B . We draw Z B ( 1 ) , … , Z B ( M ) Z_B^{(1)}, \ldots, Z_B^{(M)} Z B ( 1 ) , … , Z B ( M ) independently from this conditional distribution and compute
p B , M ( O [ n ] ) = 1 + ∑ m = 1 M 1 { T B ( O B ( Z B ( m ) ) ) ≥ T B ( O B ) } M + 1 . p_{B,M}(O_{[n]}) = \frac{1 + \sum_{m=1}^{M} \mathbf{1}\left\{T_B\left(O_B\left(Z_B^{(m)}\right)\right) \geq T_B(O_B)\right\}}{M+1}. p B , M ( O [ n ] ) = M + 1 1 + ∑ m = 1 M 1 { T B ( O B ( Z B ( m ) ) ) ≥ T B ( O B ) } .
The statistic used below depends only on outcomes within B B B . Under H 0 , B H_{0,B} H 0 , B , the observed and randomized statistics are exchangeable given K B K_B K B , so p B , M p_{B,M} p B , M is valid.
To obtain the bound in (7) , we test H 0 ( r ) H_0^{(r)} H 0 ( r ) using the maximum of the block p p p -values over the n − r + 1 n-r+1 n − r + 1 overlapping blocks in B r \mathcal{B}_r B r . Suppose we draw M M M assignments separately for each block. Computing the test statistic from scratch for a block of r r r units takes O ( r ) O(r) O ( r ) time per simulated assignment, so the cost of testing all blocks of length r r r is
C c o n d i t i o n a l ( r ) = O ( M ( n − r + 1 ) r ) . (9) C_{\mathrm{conditional}}(r) = O\left(M(n-r+1)r\right). \tag*{(9)} C conditional ( r ) = O ( M ( n − r + 1 ) r ) . (9)
Searching all lengths r ∈ [ n ] r \in[n] r ∈ [ n ] has total cost
C c o n d i t i o n a l = O ( M ∑ r = 1 n ( n − r + 1 ) r ) = O ( M n 3 ) . (10) C_{\mathrm{conditional}} = O\left(M\sum_{r=1}^{n}(n-r+1)r\right) = O(Mn^3). \tag*{(10)} C conditional = O ( M r = 1 ∑ n ( n − r + 1 ) r ) = O ( M n 3 ) . (10)
This cubic cost can make a full search impractical for experiments with tens of thousands of units, especially if hundreds or thousands of randomization draws are used.
Speed-up: shared permutations and linear statistics
Under the block null H 0 , B H_{0,B} H 0 , B in (3) , the outcomes within B B B are the same under any treatment assignment, regardless of how many units are treated in B B B . We can therefore draw assignments for all n n n units from the experiment’s joint assignment distribution and reuse them across overlapping blocks. We call these global assignments. The number of treated units within a block may differ across draws, as it does under the marginal assignment distribution for Z B Z_B Z B .
We draw Z [ n ] ( 1 ) , … , Z [ n ] ( M ) Z_{[n]}^{(1)}, \ldots, Z_{[n]}^{(M)} Z [ n ] ( 1 ) , … , Z [ n ] ( M ) from the distribution of Z [ n ] Z_{[n]} Z [ n ] , and reuse them for every block. All other inputs to the block statistic must remain fixed under H 0 , B H_{0,B} H 0 , B ; we use only outcomes within the block. For each length r ∈ [ n ] r \in[n] r ∈ [ n ] and block B ∈ B r B \in\mathcal{B}_r B ∈ B r , we compute
p ~ B , M ( O [ n ] ) = 1 + ∑ m = 1 M 1 { T B ( O B ( Z [ n ] ( m ) ) ) ≥ T B ( O B ) } M + 1 . (11) \widetilde{p}_{B,M}(O_{[n]}) = \frac{1 + \sum_{m=1}^{M} \mathbf{1}\{T_B(O_B(Z_{[n]}^{(m)})) \ge T_B(O_B)\}}{M+1}. \tag*{(11)} p B , M ( O [ n ] ) = M + 1 1 + ∑ m = 1 M 1 { T B ( O B ( Z [ n ] ( m ) )) ≥ T B ( O B )} . (11)
Under H 0 , B H_{0,B} H 0 , B , the observed and randomized statistics are exchangeable given the covariates and potential outcomes, so p ~ B , M ( O [ n ] ) \widetilde{p}_{B,M}(O_{[n]}) p B , M ( O [ n ] ) is valid:
P { p ~ B , M ( O [ n ] ) ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≤ α . \mathbb{P}\{\widetilde{p}_{B,M}(O_{[n]}) \le\alpha\mid X_{[n]}, Y_{[n]}(0), Y_{[n]}(1)\} \le\alpha. P { p B , M ( O [ n ] ) ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 )} ≤ α .
The block p p p -values may be dependent, even for disjoint blocks, because they use the same global assignments. This does not affect the validity of the maximum p p p -value
p ~ r ( O [ n ] ) = max B ∈ B r p ~ B , M ( O [ n ] ) . (12) \widetilde{p}_r(O_{[n]}) = \max_{B \in\mathcal{B}_r} \widetilde{p}_{B,M}(O_{[n]}). \tag*{(12)} p r ( O [ n ] ) = B ∈ B r max p B , M ( O [ n ] ) . (12)
Under H ( r ) H^{(r)} H ( r ) , at least one block has a true local null, so p ~ r ≤ α \widetilde{p}_r \le\alpha p r ≤ α can occur only when that block’s valid p p p -value is at most α \alpha α , an event with probability at most α \alpha α . As in (7) , we report the largest non-rejected length. We denote the bound by
L ^ n , 0 U : = max { r ∈ [ n ] : p ~ r ( O [ n ] ) > α } = max { r ∈ [ n ] : p ~ r ↑ ( O [ n ] ) > α } , (13) \widehat{L}^{U}_{n,0} := \max\{r \in[n] : \widetilde{p}_r(O_{[n]}) > \alpha\} = \max\{r \in[n] : \widetilde{p}^{\uparrow}_r(O_{[n]}) > \alpha\}, \tag*{(13)} L n , 0 U := max { r ∈ [ n ] : p r ( O [ n ] ) > α } = max { r ∈ [ n ] : p r ↑ ( O [ n ] ) > α } , (13)
where p ~ r ↑ : = max s ∈ [ n ] : s ≥ r p ~ s \widetilde{p}^{\uparrow}_r := \max_{s \in[n]:\,s \ge r} \widetilde{p}_s p r ↑ := max s ∈ [ n ] : s ≥ r p s . Again, the equality holds without monotonicity, and we set the bound to zero if all lengths are rejected. The argument in Proposition 1 shows that L ^ n , 0 U \widehat{L}^{U}_{n,0} L n , 0 U is a ( 1 − α ) (1-\alpha) ( 1 − α ) upper confidence bound for L 0 L_0 L 0 .
Define the centred covariance-based statistic
T B ( O B ) : = ∑ i ∈ B ( Z i − π ) ( Y i − Y ‾ B ) , (14) T_B(O_B) := \sum_{i \in B}(Z_i-\pi)(Y_i-\overline{Y}_B), \tag*{(14)} T B ( O B ) := i ∈ B ∑ ( Z i − π ) ( Y i − Y B ) , (14)
where π = n 1 / n \pi= n_1/n π = n 1 / n is the treatment probability under complete randomization and Y ‾ B : = ∣ B ∣ − 1 ∑ i ∈ B Y i \overline{Y}_B := |B|^{-1}\sum_{i \in B}Y_i Y B := ∣ B ∣ − 1 ∑ i ∈ B Y i . Centering prevents the statistic from becoming large merely because the block has a high outcome mean and more treated units. The outcomes within B B B and their mean remain fixed under H 0 , B H_{0,B} H 0 , B , ensuring finite-sample validity. Shared permutations allow the treated count within B B B to vary, even when the observed block has no treated units. A conditional test can replace Y ‾ B \overline{Y}_B Y B with predictions from a model fitted to all covariates and observed outcomes without using treatment assignments, because it keeps assignments outside B B B fixed. Holding such a fit fixed under shared global permutations can invalidate the test, since outcomes outside B B B may change under the local null. Appendix § 9 explains this difference and gives a counterexample.
We write T B T_B T B for the observed statistic. For the m m m th global assignment, we compute
T B ( m ) : = ∑ i ∈ B ( Z i ( m ) − π ) ( Y i − Y ˉ B ) , m ∈ [ M ] . T_B^{(m)} := \sum_{i\in B} (Z_i^{(m)}-\pi)(Y_i-\bar{Y}_B), \qquad m\in[M]. T B ( m ) := i ∈ B ∑ ( Z i ( m ) − π ) ( Y i − Y ˉ B ) , m ∈ [ M ] .
Since ∑ i ∈ B ( Y i − Y ˉ B ) = 0 \sum_{i\in B}(Y_i-\bar{Y}_B)=0 ∑ i ∈ B ( Y i − Y ˉ B ) = 0 , expanding the statistic gives
T B ( m ) = ∑ i ∈ B Z i ( m ) ( Y i − Y ˉ B ) − π ∑ i ∈ B ( Y i − Y ˉ B ) = ∑ i ∈ B Z i ( m ) Y i − Y ˉ B ∑ i ∈ B Z i ( m ) . T_B^{(m)}=\sum_{i\in B}Z_i^{(m)}(Y_i-\bar{Y}_B)-\pi\sum_{i\in B}(Y_i-\bar{Y}_B)=\sum_{i\in B}Z_i^{(m)}Y_i-\bar{Y}_B\sum_{i\in B}Z_i^{(m)}. T B ( m ) = i ∈ B ∑ Z i ( m ) ( Y i − Y ˉ B ) − π i ∈ B ∑ ( Y i − Y ˉ B ) = i ∈ B ∑ Z i ( m ) Y i − Y ˉ B i ∈ B ∑ Z i ( m ) .
Each statistic depends on three block sums: the outcomes, the treatment indicators, and their products. For any array f [ n ] = ( f 1 , … , f n ) f_{[n]}=(f_1,\ldots,f_n) f [ n ] = ( f 1 , … , f n ) and set of units B ⊆ [ n ] B\subseteq[n] B ⊆ [ n ] , write
Q B ( f [ n ] ) : = ∑ i ∈ B f i . Q_B(f_{[n]}):=\sum_{i\in B}f_i. Q B ( f [ n ] ) := i ∈ B ∑ f i .
We use 1 [ n ] 1_{[n]} 1 [ n ] for the vector of ones and ⊙ \odot ⊙ for elementwise multiplication. In particular, Q B ( 1 [ n ] ) = ∣ B ∣ Q_B(1_{[n]})=|B| Q B ( 1 [ n ] ) = ∣ B ∣ . We compute these block sums from the cumulative-sum array
F j ( f [ n ] ) : = ∑ i = 1 j f i , j ∈ [ n ] , F_j(f_{[n]}):=\sum_{i=1}^{j}f_i,\qquad j\in[n], F j ( f [ n ] ) := i = 1 ∑ j f i , j ∈ [ n ] ,
with F 0 ( f [ n ] ) = 0 F_0(f_{[n]})=0 F 0 ( f [ n ] ) = 0 . For a block B = { s , … , e } B=\{s,\ldots,e\} B = { s , … , e } of length r = e − s + 1 r=e-s+1 r = e − s + 1 ,
Q B ( f [ n ] ) = F e ( f [ n ] ) − F s − 1 ( f [ n ] ) . Q_B(f_{[n]})=F_e(f_{[n]})-F_{s-1}(f_{[n]}). Q B ( f [ n ] ) = F e ( f [ n ] ) − F s − 1 ( f [ n ] ) .
When the block moves one position to the right, we update each sum by subtracting f s f_s f s and adding f e + 1 f_{e+1} f e + 1 . Applying this to the vectors Y [ n ] Y_{[n]} Y [ n ] , Z [ n ] ( m ) Z_{[n]}^{(m)} Z [ n ] ( m ) , and Z [ n ] ( m ) ⊙ Y [ n ] Z_{[n]}^{(m)}\odot Y_{[n]} Z [ n ] ( m ) ⊙ Y [ n ] gives the three sums needed for the test statistic:
T B ( m ) = Q B ( Z [ n ] ( m ) ⊙ Y [ n ] ) − Q B ( Y [ n ] ) r Q B ( Z [ n ] ( m ) ) . (15) T_B^{(m)}=Q_B(Z_{[n]}^{(m)}\odot Y_{[n]})-\frac{Q_B(Y_{[n]})}{r}Q_B(Z_{[n]}^{(m)}). \tag*{(15)} T B ( m ) = Q B ( Z [ n ] ( m ) ⊙ Y [ n ] ) − r Q B ( Y [ n ] ) Q B ( Z [ n ] ( m ) ) . (15)
The observed statistic can be computed in the same way using the observed assignment. The cumulative-sum array for Y [ n ] Y_{[n]} Y [ n ] is computed once for the whole analysis. The cumulative-sum arrays for Z [ n ] ( m ) Z_{[n]}^{(m)} Z [ n ] ( m ) and Z [ n ] ( m ) ⊙ Y [ n ] Z_{[n]}^{(m)}\odot Y_{[n]} Z [ n ] ( m ) ⊙ Y [ n ] are computed once per global assignment and reused across all blocks and lengths. Each array takes O ( n ) O(n) O ( n ) time to compute, after which each block statistic takes O ( 1 ) O(1) O ( 1 ) time.
The shared method draws M M M global assignments once and reuses them across all blocks and lengths. Computing the cumulative sums takes O ( n ) O(n) O ( n ) time per draw. Each block’s Monte Carlo count is the number of randomized statistics at least as large as its observed statistic. At a fixed length, computing all block statistics and updating these counts also takes O ( n ) O(n) O ( n ) time per draw, giving C s h a r e d ( r ) = O ( M n ) C_{\mathrm{shared}}(r) = O(Mn) C shared ( r ) = O ( M n ) . The observed block statistics take an additional O ( n ) O(n) O ( n ) time at each length. Compared with the conditional cost in (9) , the shared method avoids drawing assignments separately for each block and summing all r r r terms again for every statistic. Over all lengths r ∈ [ n ] r \in[n] r ∈ [ n ] , the total cost is C s h a r e d = O ( M n 2 ) C_{\mathrm{shared}} = O(Mn^2) C shared = O ( M n 2 ) , compared with O ( M n 3 ) O(Mn^3) O ( M n 3 ) for the conditional approach in (10) . Reducing the cost to quadratic makes it more practical to analyze larger samples, search more lengths, or use more randomization draws.
Table 1. Computational costs for obtaining the upper confidence bound in one dimension, considering all lengths r ∈ [ n ] r \in[n] r ∈ [ n ] . For each descending search, t t t counts the lengths checked up to and including the first non-rejection; t = n t = n t = n if all lengths are rejected. The preliminary Gaussian search evaluates the approximation at O ( log n ) O(\log n) O ( log n ) lengths. Here, k k k counts the block lengths at which all block tests are evaluated using Monte Carlo draws. If the two adjacent endpoints found using the Gaussian approximation satisfy (36) , then k = 2 k = 2 k = 2 . Monotonicity refers to (16) .
To compute the bound, we can check lengths from largest to smallest and stop at the first non-rejection. Every larger length has then been rejected, so this is the largest non-rejected length in (13) . If all lengths are rejected, we report zero. This search does not require monotone p p p -values. Let t t t be the number of lengths checked. Computing the cumulative sums for the M M M shared draws takes O ( M n ) O(Mn) O ( M n ) time. At lengths n , n − 1 , … , n − t + 1 n, n - 1, \ldots, n - t + 1 n , n − 1 , … , n − t + 1 , there are 1 , 2 , … , t 1, 2, \ldots, t 1 , 2 , … , t blocks, respectively. Testing these blocks takes O ( M t 2 ) O(Mt^2) O ( M t 2 ) time, giving a total cost of O ( M n + M t 2 ) O(Mn + Mt^2) O ( M n + M t 2 ) for the shared descending search. The same stopping rule applies to the conditional tests. If that search checks t t t lengths, its cost is O ( M ∑ r = n − t + 1 n ( n − r + 1 ) r ) = O ( M n t 2 ) O\left(M\sum_{r=n-t+1}^{n}(n-r+1)r\right) = O(Mnt^2) O ( M ∑ r = n − t + 1 n ( n − r + 1 ) r ) = O ( M n t 2 ) . The two methods may stop at different lengths, so t t t is counted separately for each method.
Faster search under monotonicity
The null hypotheses are nested: a zero-effect block of length r ′ r' r ′ contains a zero-effect block of every smaller length r r r . Thus, the null becomes more restrictive as the length increases. This nesting structure motivates the following monotonicity assumption, which is not required by the search in the previous subsection:
p ~ r ′ ≤ p ~ r for all r , r ′ ∈ [ n ] with r < r ′ . (16) \tilde{p}_{r'} \le\tilde{p}_{r} \quad\text{for all } r,r' \in[n] \text{ with } r < r'. \tag*{(16)} p ~ r ′ ≤ p ~ r for all r , r ′ ∈ [ n ] with r < r ′ . (16)
This is an additional assumption on the computed Monte Carlo p p p -values; nesting of the nulls alone does not imply it. For the validity statement below, we need to assume that it holds almost surely over the observed and simulated assignments.
Under (16) , once a length is rejected, every larger length is also rejected. We can therefore use bisection to find the largest non-rejected length. Once two adjacent lengths have a non-rejection at the lower endpoint and a rejection at the upper endpoint, we report the lower endpoint without checking larger lengths. This returns the same bound as (13) , so its finite-sample validity is preserved under the monotonicity assumption. If length 1 is rejected, we report zero; if length n n n is not rejected, we report n n n . The search evaluates O ( log n ) O(\log n) O ( log n ) lengths, giving C d i r e c t = O ( M n log n ) C_{\mathrm{direct}} = O(Mn \log n) C direct = O ( M n log n ) .
A Gaussian approximation of the p p p -value can be used to first suggest two lengths between which the largest non-rejected length may lie. We call this pair an initial bracket and this preliminary search a Gaussian warm-start. The construction is given in Appendix § 10 and costs O ( n log n ) O(n \log n) O ( n log n ) . If checking and refining the bracket requires Monte Carlo tests at k k k block lengths, the total cost is
C w a r m = O ( n log n + M n k ) . C_{\mathrm{warm}} = O(n \log n + Mnk). C warm = O ( n log n + M nk ) .
If the two adjacent endpoints found using the Gaussian approximation satisfy (36) , then k = 2 k = 2 k = 2 and C w a r m = O ( n log n + M n ) C_{\mathrm{warm}} = O(n \log n + Mn) C warm = O ( n log n + M n ) . The Monte Carlo step then tests all blocks at two lengths. The case k = 2 k = 2 k = 2 is more likely when the Gaussian approximation is accurate near the rejection threshold and its p p p -values at the two endpoints lie far enough above and below α \alpha α that approximation error and Monte Carlo variation do not change either decision. A larger M M M reduces the Monte Carlo variation, although additional checks may still be needed when an endpoint p p p -value is close to α \alpha α .
Without monotonicity, the endpoint checks do not rule out a non-rejection at a larger length. This warm-start must still evaluate the same lengths required by the shared descending search, while adding the Gaussian calculations and possibly extra endpoint checks. It does not reduce the Monte Carlo work needed for the final bound.
Summary. Table 1 summarizes the computational costs. Our main computational gain comes from reusing randomization draws and cumulative sums across regions (§ 3.2 ). Compared with computing each conditional block test from scratch, this reduces the worst-case cost of the full search from cubic to quadratic in the sample size, without requiring monotone p p p -values. In practice, we recommend the shared descending search when monotonicity is not guaranteed. It computes the bound over all lengths r ∈ [ n ] r \in[n] r ∈ [ n ] and stops at the first non-rejection. Under (16) , shared bisection reduces the number of lengths evaluated to O ( log n ) O(\log n) O ( log n ) . When M M M is large, an accurate Gaussian approximation can further reduce the Monte Carlo work.
Extension to two dimensions
The two equivalent formulations in Section 2 suggest two extensions of our method to the setting with two pre-treatment covariates, W i = ( W i 1 , W i 2 ) ∈ R 2 W_i = (W_{i1}, W_{i2}) \in\mathbb{R}^2 W i = ( W i 1 , W i 2 ) ∈ R 2 , chosen in advance. We show that following the original block formulation leads us to consider rectangular regions, but computing the upper confidence bound for the size of the largest zero-effect rectangle by exhaustive search becomes computationally prohibitive. We instead generalize the alternative formulation to construct nearest-neighbour regions around each observed point, and offer an efficient approach for computation.
Rectangular formulation
Let g i 1 g_{i1} g i 1 and g i 2 g_{i2} g i 2 be the ranks of unit i i i in the two coordinates, with ties broken by a rule chosen in advance. The original one-dimensional regions are rank intervals. We take the Cartesian product of an interval in each coordinate:
R = { s 1 , … , e 1 } × { s 2 , … , e 2 } , 1 ≤ s ℓ ≤ e ℓ ≤ n , ℓ = 1 , 2. (17) R = \{s_1, \ldots, e_1\} \times\{s_2, \ldots, e_2\}, \qquad1 \le s_\ell\le e_\ell\le n,\quad\ell= 1,2. \tag*{(17)} R = { s 1 , … , e 1 } × { s 2 , … , e 2 } , 1 ≤ s ℓ ≤ e ℓ ≤ n , ℓ = 1 , 2. (17)
The units in this rectangle form the set
B R : = { i ∈ [ n ] : s 1 ≤ g i 1 ≤ e 1 , s 2 ≤ g i 2 ≤ e 2 } . B_R := \{i \in[n] : s_1 \le g_{i1} \le e_1,\, s_2 \le g_{i2} \le e_2\}. B R := { i ∈ [ n ] : s 1 ≤ g i 1 ≤ e 1 , s 2 ≤ g i 2 ≤ e 2 } .
Let R \mathcal{R} R contain all the non-empty rectangles with B R ≠ ∅ B_R \ne\varnothing B R = ∅ . As in one dimension, the region size is ∣ B R ∣ |B_R| ∣ B R ∣ , the number of units it contains.
For each R ∈ R R \in\mathcal{R} R ∈ R , use the local sharp null H 0 , B R H_{0,B_R} H 0 , B R in (3) . The inferential target is the largest number of units in a zero-effect rectangle:
L 0 , r e c t : = max { ∣ B R ∣ : R ∈ R , H 0 , B R holds } . (18) L_{0,\mathrm{rect}} := \max\{|B_R| : R \in\mathcal{R},\ H_{0,B_R}\text{ holds}\}. \tag*{(18)} L 0 , rect := max { ∣ B R ∣ : R ∈ R , H 0 , B R holds } . (18)
At size r r r , the null L 0 , r e c t ≥ r L_{0,\mathrm{rect}} \ge r L 0 , rect ≥ r states that at least one rectangle containing r r r or more units has zero effect on every unit. Let p ~ R , M : = p ~ B R , M ( O [ n ] ) \widetilde{p}_{R,M} := \widetilde{p}_{B_R,M}(O_{[n]}) p R , M := p B R , M ( O [ n ] ) be the local shared-permutation p p p -value from (11) . We test this null using p ~ r r e c t : = max R ∈ R , ∣ B R ∣ ≥ r p ~ R , M \widetilde{p}^{\mathrm{rect}}_r := \max_{R\in\mathcal{R},\,|B_R|\ge r}\widetilde{p}_{R,M} p r rect := max R ∈ R , ∣ B R ∣ ≥ r p R , M . The same max-p p p argument applies. The corresponding bound is
L ^ 0 , r e c t U : = max { r ∈ [ n ] : p ~ r r e c t > α } = max { ∣ B R ∣ : R ∈ R , p ~ R , M > α } , \widehat{L}^{U}_{0,\mathrm{rect}} := \max\{r \in[n] : \widetilde{p}^{\mathrm{rect}}_r > \alpha\} = \max\{|B_R| : R \in\mathcal{R},\ \widetilde{p}_{R,M} > \alpha\}, L 0 , rect U := max { r ∈ [ n ] : p r rect > α } = max { ∣ B R ∣ : R ∈ R , p R , M > α } ,
with an empty maximum set to zero. The maximum includes all rectangles containing at least r r r units. Thus, p ~ r r e c t \widetilde{p}^{\mathrm{rect}}_r p r rect is non-increasing: increasing r r r only removes rectangles from the maximum. The argument in Proposition 1 shows that L ^ 0 , r e c t U \widehat{L}^{U}_{0,\mathrm{rect}} L 0 , rect U is a finite-sample valid ( 1 − α ) (1-\alpha) ( 1 − α ) upper confidence bound for L 0 , r e c t L_{0,\mathrm{rect}} L 0 , rect .
Computational cost of O ( M n 4 ) O(Mn^4) O ( M n 4 ) . The cumulative-sum idea in § 3.2 can be applied to rectangles. For a rectangle R R R , write Q R ( f [ n ] ) : = Q B R ( f [ n ] ) Q_R(f_{[n]}) := Q_{B_R}(f_{[n]}) Q R ( f [ n ] ) := Q B R ( f [ n ] ) . We compute these sums from a two-dimensional cumulative-sum array whose entry F a b ( f [ n ] ) F_{ab}(f_{[n]}) F ab ( f [ n ] ) sums over units with rank pairs in [ a ] × [ b ] [a] \times[b] [ a ] × [ b ] :
F a b ( f [ n ] ) : = ∑ i : g i 1 ≤ a , g i 2 ≤ b f i , a , b ∈ [ n ] . F_{ab}(f_{[n]}) := \sum_{i:g_{i1}\leq a,\,g_{i2}\leq b} f_i,\qquad a,b\in[n]. F ab ( f [ n ] ) := i : g i 1 ≤ a , g i 2 ≤ b ∑ f i , a , b ∈ [ n ] .
Set entries with either index equal to zero to zero. For the rectangle in (17) , start with F e 1 , e 2 ( f [ n ] ) F_{e_1,e_2}(f_{[n]}) F e 1 , e 2 ( f [ n ] ) and subtract the parts below the lower rank bounds s 1 s_1 s 1 and s 2 s_2 s 2 . Their overlap is subtracted twice, so we add it back. This gives
Q R ( f [ n ] ) = F e 1 , e 2 ( f [ n ] ) − F s 1 − 1 , e 2 ( f [ n ] ) − F e 1 , s 2 − 1 ( f [ n ] ) + F s 1 − 1 , s 2 − 1 ( f [ n ] ) . Q_R(f_{[n]}) = F_{e_1,e_2}(f_{[n]}) - F_{s_1-1,e_2}(f_{[n]}) - F_{e_1,s_2-1}(f_{[n]}) + F_{s_1-1,s_2-1}(f_{[n]}). Q R ( f [ n ] ) = F e 1 , e 2 ( f [ n ] ) − F s 1 − 1 , e 2 ( f [ n ] ) − F e 1 , s 2 − 1 ( f [ n ] ) + F s 1 − 1 , s 2 − 1 ( f [ n ] ) .
We apply this formula to 1 [ n ] 1_{[n]} 1 [ n ] , Y [ n ] Y_{[n]} Y [ n ] , Z [ n ] ( m ) Z_{[n]}^{(m)} Z [ n ] ( m ) , and Z [ n ] ( m ) ⊙ Y [ n ] Z_{[n]}^{(m)} \odot Y_{[n]} Z [ n ] ( m ) ⊙ Y [ n ] . Since Q R ( 1 [ n ] ) = ∣ B R ∣ Q_R(1_{[n]}) = |B_R| Q R ( 1 [ n ] ) = ∣ B R ∣ , the centred statistic in (14) is
T R ( m ) = Q R ( Z [ n ] ( m ) ⊙ Y [ n ] ) − Q R ( Y [ n ] ) Q R ( 1 [ n ] ) Q R ( Z [ n ] ( m ) ) . (19) T_R^{(m)} = Q_R(Z_{[n]}^{(m)} \odot Y_{[n]}) - \frac{Q_R(Y_{[n]})}{Q_R(1_{[n]})}Q_R(Z_{[n]}^{(m)}). \tag*{(19)} T R ( m ) = Q R ( Z [ n ] ( m ) ⊙ Y [ n ] ) − Q R ( 1 [ n ] ) Q R ( Y [ n ] ) Q R ( Z [ n ] ( m ) ) . (19)
The cumulative-sum arrays for 1 [ n ] 1_{[n]} 1 [ n ] and Y [ n ] Y_{[n]} Y [ n ] are computed once. For each global draw m m m , we compute the arrays for Z [ n ] ( m ) Z_{[n]}^{(m)} Z [ n ] ( m ) and Z [ n ] ( m ) ⊙ Y [ n ] Z_{[n]}^{(m)} \odot Y_{[n]} Z [ n ] ( m ) ⊙ Y [ n ] and reuse them across all rectangles. Each array takes O ( n 2 ) O(n^2) O ( n 2 ) time to compute, after which each rectangle statistic takes O ( 1 ) O(1) O ( 1 ) time. However, each coordinate has n ( n + 1 ) / 2 n(n+1)/2 n ( n + 1 ) /2 rank intervals, giving O ( n 4 ) O(n^4) O ( n 4 ) combinations of rectangle boundaries. Computing the upper confidence bound by exhaustive search therefore takes O ( M n 4 ) O(Mn^4) O ( M n 4 ) time.
Geometric limitations. Rectangles have boundaries parallel to the covariate axes, which may be unnatural for local groups on a curved or irregular covariate support. A rectangle covering such a group may also include affected units outside the group. The largest zero-effect rectangle may therefore capture only a small part of a large zero-effect group. A small upper confidence bound for the largest zero-effect rectangle does not rule out large zero-effect groups with other shapes.
Nearest-neighbour formulation
We extend the nearest-neighbour formulation in Section 2. For each unit i i i , we vary the neighbourhood size from 1 1 1 to n n n , forming regions of every size around each observed point. Their shapes depend on the observed covariate points and the chosen distance.
Upper confidence bound
We define nearest neighbours using Euclidean distance between the normalized ranks ( g i 1 / n , g i 2 / n ) (g_{i1}/n, g_{i2}/n) ( g i 1 / n , g i 2 / n ) . For each unit i i i , let j i ( ℓ ) j_i(\ell) j i ( ℓ ) be the index of the ℓ \ell ℓ th nearest unit under this distance, counting unit i i i itself first, so j i ( 1 ) = i j_i(1)=i j i ( 1 ) = i . We break remaining distance ties in favour of the unit with the smaller rank in the first coordinate. Define the neighbourhood of size k k k centred at W i W_i W i by
N i ( k ) : = { j i ( 1 ) , … , j i ( k ) } , i , k ∈ [ n ] . (20) N_i^{(k)} := \{j_i(1),\ldots,j_i(k)\}, \qquad i,k \in[n]. \tag*{(20)} N i ( k ) := { j i ( 1 ) , … , j i ( k )} , i , k ∈ [ n ] . (20)
Each region contains exactly k k k units, and the regions around a given centre W i W_i W i are nested: N i ( k ) ⊂ N i ( k + 1 ) N_i^{(k)} \subset N_i^{(k+1)} N i ( k ) ⊂ N i ( k + 1 ) for k < n k<n k < n . With one covariate, the candidate family is exactly the original collection of contiguous blocks, as shown in (8) .
For each neighbourhood N i ( k ) N_i^{(k)} N i ( k ) , we use the local sharp null in (3) : treatment leaves every unit in the region unaffected. At size k k k , we test the null that at least one candidate neighbourhood contains only unaffected units:
H 0 ( k ) : ∃ i ∈ [ n ] such that H 0 , N i ( k ) holds. H_0^{(k)} : \exists i \in[n]\ \text{such that } H_{0,N_i^{(k)}}\text{ holds.} H 0 ( k ) : ∃ i ∈ [ n ] such that H 0 , N i ( k ) holds.
Some neighbourhoods extend farther from their centres because the covariate points are more spread out. All neighbourhoods of size k k k contain the same fraction k / n k/n k / n of the sample. Our inferential target is the size of the largest zero-effect neighbourhood:
K 0 : = max { k ∈ [ n ] : ∃ i ∈ [ n ] such that H 0 , N i ( k ) holds } , (21) K_0 := \max\left\{k \in[n] : \exists i \in[n]\ \text{such that } H_{0,N_i^{(k)}}\text{ holds}\right\}, \tag*{(21)} K 0 := max { k ∈ [ n ] : ∃ i ∈ [ n ] such that H 0 , N i ( k ) holds } , (21)
with K 0 = 0 K_0=0 K 0 = 0 if the set is empty. Because the neighbourhoods around each centre are nested, H 0 ( k ) H_0^{(k)} H 0 ( k ) holds if and only if K 0 ≥ k K_0 \ge k K 0 ≥ k .
We use the centred statistic in (14) with B = N i ( k ) B=N_i^{(k)} B = N i ( k ) . Draw M M M independent global assignments from the experiment’s joint assignment distribution and reuse them across all centres and sizes. Compute the local p p p -value by (11) and define
p ~ i , k : = p ~ N i ( k ) , M ( O [ n ] ) , p ~ k : = max i ∈ [ n ] p ~ i , k . (22) \widetilde{p}_{i,k}:=\widetilde{p}_{N_i^{(k)},M}(O_{[n]}), \qquad\widetilde{p}_k:=\max_{i\in[n]}\widetilde{p}_{i,k}. \tag*{(22)} p i , k := p N i ( k ) , M ( O [ n ] ) , p k := i ∈ [ n ] max p i , k . (22)
As in (13) , we report the largest non-rejected size:
K ^ 0 U : = max { k ∈ [ n ] : p ~ k > α } = max { k ∈ [ n ] : p ~ k ↑ > α } , (23) \widehat{K}_0^U := \max\{k\in[n]:\widetilde{p}_k>\alpha\}=\max\{k\in[n]:\widetilde{p}_k^{\uparrow}>\alpha\}, \tag*{(23)} K 0 U := max { k ∈ [ n ] : p k > α } = max { k ∈ [ n ] : p k ↑ > α } , (23)
where p ~ k ↑ : = max s ∈ [ n ] : s ≥ k p ~ s \widetilde{p}_k^{\uparrow}:=\max_{s\in[n]:s\ge k}\widetilde{p}_s p k ↑ := max s ∈ [ n ] : s ≥ k p s , and the bound is zero if all sizes are rejected. By the argument in Proposition 1, this is a finite-sample valid ( 1 − α ) (1-\alpha) ( 1 − α ) upper confidence bound for K 0 K_0 K 0 , conditional on the covariates and potential outcomes.
As in § 2.2 , we highlight the covariate points whose indices belong to the union of non-rejected neighbourhoods at the reported size:
D ^ α ( 2 d ) : = ⋃ i : p ~ i , K ^ 0 U > α N i ( K ^ 0 U ) , K ^ 0 U > 0. \widehat{\mathcal{D}}_{\alpha}^{(2d)} := \bigcup_{i:\widetilde{p}_{i,\widehat{K}_{0}^{U}}>\alpha} N_{i}^{(\widehat{K}_{0}^{U})}, \qquad\widehat{K}_{0}^{U}>0. D α ( 2 d ) := i : p i , K 0 U > α ⋃ N i ( K 0 U ) , K 0 U > 0.
We set the display to the empty set when K ^ 0 U = 0 \widehat{K}_{0}^{U}=0 K 0 U = 0 . The nearest-neighbour construction extends to higher dimensions. We focus on two dimensions for interpretability and to avoid the difficulties of defining meaningful neighbourhoods in high dimensions.
Computation using cumulative sums
We compute the region sums from § 3.2 by taking cumulative sums along the neighbour ordering for each centre. Write
Q i , k ( f [ n ] ) : = Q N i ( k ) ( f [ n ] ) = ∑ ℓ = 1 k f j i ( ℓ ) , i , k ∈ [ n ] . (24) Q_{i,k}(f_{[n]}) := Q_{N_i^{(k)}}(f_{[n]}) = \sum_{\ell=1}^{k} f_{j_i(\ell)}, \qquad i,k \in[n]. \tag*{(24)} Q i , k ( f [ n ] ) := Q N i ( k ) ( f [ n ] ) = ℓ = 1 ∑ k f j i ( ℓ ) , i , k ∈ [ n ] . (24)
These sums form a cumulative-sum array with one row for each centre i i i and one column for each neighbourhood size k k k . For each centre i i i , we start with Q i , 0 ( f [ n ] ) = 0 Q_{i,0}(f_{[n]})=0 Q i , 0 ( f [ n ] ) = 0 and compute the sums for k = 1 , … , n k=1,\ldots,n k = 1 , … , n by adding f j i ( k ) f_{j_i(k)} f j i ( k ) to the sum for size k − 1 k-1 k − 1 . Computing the sums for n n n centres takes O ( n 2 ) O(n^2) O ( n 2 ) time.
We form these arrays for Y [ n ] Y_{[n]} Y [ n ] , Z [ n ] ( m ) Z_{[n]}^{(m)} Z [ n ] ( m ) , and Z [ n ] ( m ) ⊙ Y [ n ] Z_{[n]}^{(m)}\odot Y_{[n]} Z [ n ] ( m ) ⊙ Y [ n ] . Since Q i , k ( 1 [ n ] ) = k Q_{i,k}(\mathbf{1}_{[n]})=k Q i , k ( 1 [ n ] ) = k , the outcome mean in N i ( k ) N_i^{(k)} N i ( k ) is Q i , k ( Y [ n ] ) / k Q_{i,k}(Y_{[n]})/k Q i , k ( Y [ n ] ) / k . The statistic in (15) becomes
T i , k ( m ) = Q i , k ( Z [ n ] ( m ) ⊙ Y [ n ] ) − Q i , k ( Y [ n ] ) k Q i , k ( Z [ n ] ( m ) ) . (25) T_{i,k}^{(m)} = Q_{i,k}\left(Z_{[n]}^{(m)}\odot Y_{[n]}\right) - \frac{Q_{i,k}(Y_{[n]})}{k}Q_{i,k}\left(Z_{[n]}^{(m)}\right). \tag*{(25)} T i , k ( m ) = Q i , k ( Z [ n ] ( m ) ⊙ Y [ n ] ) − k Q i , k ( Y [ n ] ) Q i , k ( Z [ n ] ( m ) ) . (25)
For each global draw m m m , we compute the arrays for Z [ n ] ( m ) Z_{[n]}^{(m)} Z [ n ] ( m ) and Z [ n ] ( m ) ⊙ Y [ n ] Z_{[n]}^{(m)}\odot Y_{[n]} Z [ n ] ( m ) ⊙ Y [ n ] and reuse them across all centres and sizes. Each statistic then takes O ( 1 ) O(1) O ( 1 ) time to compute.
Computing all pairwise distances takes O ( n 2 ) O(n^2) O ( n 2 ) time, and sorting the neighbour orders takes O ( n 2 log n ) O(n^2\log n) O ( n 2 log n ) time. These steps are done once. For each global draw, computing the cumulative-sum arrays and updating the Monte Carlo counts across all centres and sizes takes O ( n 2 ) O(n^2) O ( n 2 ) time. The total cost of the full search is O ( n 2 log n + M n 2 ) O(n^2\log n+Mn^2) O ( n 2 log n + M n 2 ) . The Monte Carlo cost is of the same order as the full one-dimensional search.
Descending search. As in § 3.2 , we can check sizes from largest to smallest and stop at the first non-rejection. This computes (23) without requiring monotone p p p -values. The nesting of the nulls alone does not justify bisection; see § 3.3 .
At k = n k=n k = n , all neighbourhoods equal [ n ] [n] [ n ] , so their sums share the same initial values. Moving from k k k to k − 1 k-1 k − 1 removes unit j i ( k ) j_i(k) j i ( k ) from the neighbourhood centred at W i W_i W i . We subtract this unit’s contribution from each of the three sums, for both the observed and simulated assignments. Updating all statistics and Monte Carlo counts at one size takes O ( M n ) O(Mn) O ( M n ) time. If the search checks t t t sizes, the total cost is O ( n 2 log n + M n t ) O(n^2 \log n+Mnt) O ( n 2 log n + M n t ) .
Search under monotonicity. The methods in § 3.3 extend under the same assumption: the computed p p p -values p ~ k \tilde{p}_k p ~ k are non-increasing in k k k , almost surely over the observed and simulated assignments. Bisection then finds the bound in (23) by checking O ( log n ) O(\log n) O ( log n ) sizes. The Gaussian warm-start also applies, using the approximation in Appendix § 10 with B = N i ( k ) B=N_i^{(k)} B = N i ( k ) . However, precomputing the neighbour cumulative-sum arrays for all M M M global draws already costs O ( M n 2 ) O(Mn^2) O ( M n 2 ) time. Thus, these methods do not improve the worst-case order with this implementation. We therefore use descending search, which updates the sums only as needed and stops at the first non-rejection.
Theory
Setup
Let W i = ( W i 1 , … , W i d ) ∈ R d W_i=(W_{i1},\ldots,W_{id})\in\mathbb{R}^d W i = ( W i 1 , … , W i d ) ∈ R d be the covariates used to define neighbourhoods. As in Section 4, we define N i ( k ) N_i^{(k)} N i ( k ) as the neighbourhood of size k k k centred at W i W_i W i , using Euclidean distance between the normalized rank vectors ( g i 1 / n , … , g i d / n ) (g_{i1}/n,\ldots,g_{id}/n) ( g i 1 / n , … , g i d / n ) .
Write τ i : = Y i ( 1 ) − Y i ( 0 ) \tau_i:=Y_i(1)-Y_i(0) τ i := Y i ( 1 ) − Y i ( 0 ) . The local sharp null is H 0 , N i ( k ) : τ j = 0 H_{0,N_i^{(k)}}:\tau_j=0 H 0 , N i ( k ) : τ j = 0 for every j ∈ N i ( k ) j\in N_i^{(k)} j ∈ N i ( k ) . The target is the largest zero-effect neighbourhood size,
K 0 : = max ( { k ∈ [ n ] : ∃ i ∈ [ n ] , H 0 , N i ( k ) holds } ∪ { 0 } ) . (26) K_0:=\max\left(\left\{k\in[n]:\exists i\in[n],\ H_{0,N_i^{(k)}}\ \text{holds}\right\}\cup\{0\}\right). \tag*{(26)} K 0 := max ( { k ∈ [ n ] : ∃ i ∈ [ n ] , H 0 , N i ( k ) holds } ∪ { 0 } ) . (26)
Thus K 0 / n K_0/n K 0 / n is a sample fraction. Both the candidate neighbourhoods and this target depend on the chosen distance and the observed covariates.
Using the cumulative sums in (24) , we write the centred statistic in (14) as
T i , k ( z [ n ] ) : = Q i , k ( z [ n ] ⊙ Y [ n ] ) − Q i , k ( Y [ n ] ) k Q i , k ( z [ n ] ) . (27) T_{i,k}(z_{[n]}):=Q_{i,k}(z_{[n]}\odot Y_{[n]})-\frac{Q_{i,k}(Y_{[n]})}{k}Q_{i,k}(z_{[n]}). \tag*{(27)} T i , k ( z [ n ] ) := Q i , k ( z [ n ] ⊙ Y [ n ] ) − k Q i , k ( Y [ n ] ) Q i , k ( z [ n ] ) . (27)
We compute the local p p p -values p ~ i , k \tilde{p}_{i,k} p ~ i , k and their maxima p ~ k \tilde{p}_k p ~ k as in (22) . As before, we report the largest non-rejected size:
K ^ 0 U : = max ( { k ∈ [ n ] : p ~ k > α } ∪ { 0 } ) . (28) \widehat{K}_0^U:=\max\left(\{k\in[n]:\tilde{p}_k>\alpha\}\cup\{0\}\right). \tag*{(28)} K 0 U := max ( { k ∈ [ n ] : p ~ k > α } ∪ { 0 } ) . (28)
We have the following results for the validity and computation of the confidence bound K ^ 0 U \widehat{K}_0^U K 0 U . The computation includes the cost of forming the neighbour orderings.
Theorem 1 (Validity). For every dimension d ≥ 1 d \ge1 d ≥ 1 , number of simulated assignments M ≥ 1 M \ge1 M ≥ 1 , and level α ∈ ( 0 , 1 ) \alpha\in(0,1) α ∈ ( 0 , 1 ) , the upper confidence bound K ^ 0 U \widehat{K}_0^U K 0 U defined in (28) satisfies
P { K ^ 0 U ≥ K 0 ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≥ 1 − α . \mathbb{P}\left\{\widehat{K}_0^U \ge K_0 \mid X_{[n]},Y_{[n]}(0),Y_{[n]}(1)\right\} \ge1-\alpha. P { K 0 U ≥ K 0 ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≥ 1 − α . Thus, [ 0 , K ^ 0 U / n ] [0,\widehat{K}_0^U/n] [ 0 , K 0 U / n ] is a valid ( 1 − α ) (1-\alpha) ( 1 − α ) -confidence interval for K 0 / n K_0/n K 0 / n .
Proposition 2 (Computation). In a completely randomized experiment, the costs of computing the bound in (28) using cumulative sums are
Full search: O ( d n 2 + n 2 log n + M n 2 ) , Descending search: O ( d n 2 + n 2 log n + M n t ) , \begin{aligned}
\text{Full search:}\quad&O(dn^2+n^2\log n+Mn^2),\\
\text{Descending search:}\quad&O(dn^2+n^2\log n+Mnt),
\end{aligned} Full search: Descending search: O ( d n 2 + n 2 log n + M n 2 ) , O ( d n 2 + n 2 log n + M n t ) , where t t t is the number of sizes checked by descending search.
Power analysis
We condition on X [ n ] X_{[n]} X [ n ] , so the neighbour orderings are fixed. Treatment follows complete randomization with π = n 1 / n ∈ [ π min , 1 − π min ] \pi=n_1/n \in[\pi_{\min},1-\pi_{\min}] π = n 1 / n ∈ [ π m i n , 1 − π m i n ] , where π min > 0 \pi_{\min}>0 π m i n > 0 is fixed.
Assumption 1 (Outcome model).
Y i ( 0 ) = μ 0 ( X i ) + ϵ i , Y i ( 1 ) = Y i ( 0 ) + τ ( X i ) . Y_i(0)=\mu_0(X_i)+\epsilon_i,\qquad Y_i(1)=Y_i(0)+\tau(X_i). Y i ( 0 ) = μ 0 ( X i ) + ϵ i , Y i ( 1 ) = Y i ( 0 ) + τ ( X i ) . Conditional on X [ n ] X_{[n]} X [ n ] , the errors ϵ 1 , … , ϵ n \epsilon_1,\ldots,\epsilon_n ϵ 1 , … , ϵ n are mutually independent, mean-zero and σ \sigma σ -sub-Gaussian, and independent of the treatment assignment. For every i i i ,
∣ μ 0 ( X i ) ∣ ≤ μ max < ∞ , ∣ τ ( X i ) ∣ ≤ τ max < ∞ . |\mu_0(X_i)|\le\mu_{\max}<\infty,\qquad|\tau(X_i)|\le\tau_{\max}<\infty. ∣ μ 0 ( X i ) ∣ ≤ μ m a x < ∞ , ∣ τ ( X i ) ∣ ≤ τ m a x < ∞. Write τ i : = τ ( X i ) \tau_i:=\tau(X_i) τ i := τ ( X i ) and let s Y : = σ + μ max + τ max s_Y:=\sigma+\mu_{\max}+\tau_{\max} s Y := σ + μ m a x + τ m a x denote the overall outcome scale. Define the neighbourhood’s contribution to the sample average treatment effect by
τ ˉ i , k : = 1 n ∑ j ∈ N i ( k ) τ j , i , k ∈ [ n ] . (29) \bar{\tau}_{i,k}:=\frac{1}{n}\sum_{j\in N_i^{(k)}}\tau_j,\qquad i,k\in[n]. \tag*{(29)} τ ˉ i , k := n 1 j ∈ N i ( k ) ∑ τ j , i , k ∈ [ n ] . (29) This equals its local average treatment effect multiplied by its sample fraction k / n k/n k / n .
Let v j = ( g j 1 / n , … , g j d / n ) v_j=(g_{j1}/n,\ldots,g_{jd}/n) v j = ( g j 1 / n , … , g j d / n ) be the normalized rank vector of unit j j j . The distance between units i i i and j j j used to construct the neighbourhoods is ∥ v i − v j ∥ 2 \lVert v_i-v_j\rVert_2 ∥ v i − v j ∥ 2 .
Definition 1 (Zero-effect set). A nonempty closed set Z 0 ⊆ [ 0 , 1 ] d Z_0 \subseteq[0,1]^d Z 0 ⊆ [ 0 , 1 ] d is a zero-effect set in rank space if, for every j ∈ [ n ] j \in[n] j ∈ [ n ] , τ j = 0 \tau_j = 0 τ j = 0 exactly when v j ∈ Z 0 v_j \in Z_0 v j ∈ Z 0 .
Write dist ( v , Z 0 ) : = inf z ∈ Z 0 ∥ v − z ∥ \operatorname{dist}(v,Z_0) := \inf_{z \in Z_0} \lVert v-z\rVert dist ( v , Z 0 ) := inf z ∈ Z 0 ∥ v − z ∥ for the shortest Euclidean distance from v v v to the zero-effect set. The target K 0 K_0 K 0 can also be written as
K 0 = max { k ∈ [ n ] : ∃ i ∈ [ n ] , { v j : j ∈ N i ( k ) } ⊆ Z 0 } ∪ { 0 } } . K_0 = \max\left\{\left.k \in[n] : \exists i \in[n],\ \left\{v_j : j \in N_i^{(k)}\right\} \subseteq Z_0\right\} \cup\{0\}\right\}. K 0 = max { k ∈ [ n ] : ∃ i ∈ [ n ] , { v j : j ∈ N i ( k ) } ⊆ Z 0 } ∪ { 0 } } .
The inclusion { v j : j ∈ N i ( k ) } ⊆ Z 0 \left\{v_j : j \in N_i^{(k)}\right\} \subseteq Z_0 { v j : j ∈ N i ( k ) } ⊆ Z 0 means that every unit in the neighbourhood is unaffected. Thus, K 0 K_0 K 0 is the largest number of units in any candidate neighbourhood whose treatment effects are all zero. We set K 0 = 0 K_0 = 0 K 0 = 0 if no such neighbourhood exists.
By definition of K 0 K_0 K 0 , a neighbourhood larger than K 0 K_0 K 0 contains at least one affected unit, but this alone may not provide enough power. To obtain a nontrivial upper bound for K 0 K_0 K 0 , we require larger neighbourhoods to contain enough affected units with large enough treatment effects. We thus make the following assumption, which bounds treatment effects from below according to their distance from Z 0 Z_0 Z 0 and requires each neighbourhood larger than K 0 K_0 K 0 to contain enough units sufficiently far from Z 0 Z_0 Z 0 .
Assumption 2. For constants λ τ , a , c > 0 \lambda_\tau, a, c > 0 λ τ , a , c > 0 , β ≥ 0 \beta\geq0 β ≥ 0 and ν ≥ 1 \nu\geq1 ν ≥ 1 ,
τ j ≥ λ τ dist ( v j , Z 0 ) β , v j ∉ Z 0 . (30) \tau_j \geq\lambda_\tau\operatorname{dist}(v_j,Z_0)^\beta,\qquad v_j \notin Z_0. \tag*{(30)} τ j ≥ λ τ dist ( v j , Z 0 ) β , v j ∈ / Z 0 . (30) For every i , k ∈ [ n ] i,k \in[n] i , k ∈ [ n ] with k > K 0 k > K_0 k > K 0 , write u k : = ( k − K 0 ) / n u_k := (k-K_0)/n u k := ( k − K 0 ) / n . If β > 0 \beta> 0 β > 0 , suppose
# { j ∈ N i ( k ) : dist ( v j , Z 0 ) ≥ a u k } ≥ c n u k ν . (31) \#\left\{j \in N_i^{(k)} : \operatorname{dist}(v_j,Z_0) \geq a u_k\right\} \geq c n u_k^\nu. \tag*{(31)} # { j ∈ N i ( k ) : dist ( v j , Z 0 ) ≥ a u k } ≥ c n u k ν . (31) If β = 0 \beta= 0 β = 0 , require each such neighbourhood to contain at least c n u k ν c n u_k^\nu c n u k ν affected units.
Assumption 2 requires each neighbourhood of size k > K 0 k > K_0 k > K 0 to contain at least c n u k ν c n u_k^\nu c n u k ν affected units. Smaller c c c or larger ν \nu ν permits fewer affected units. When β > 0 \beta> 0 β > 0 , these units must also lie at distance at least a u k a u_k a u k from Z 0 Z_0 Z 0 . Smaller a a a allows them to lie closer to the zero-effect set, where treatment effects may be small. Larger β \beta β permits effects that grow more slowly near the boundary.
For β > 0 \beta> 0 β > 0 , the counted units lie at distance at least a u k a u_k a u k from Z 0 Z_0 Z 0 . Substituting this distance into (30) gives the lower bound λ τ ( a u k ) β \lambda_\tau(a u_k)^\beta λ τ ( a u k ) β on their treatment effects. For β = 0 \beta= 0 β = 0 , the lower bound is simply λ τ \lambda_\tau λ τ . Since there are at least c n u k ν c n u_k^\nu c n u k ν counted units and all other effects are nonnegative, writing λ : = λ τ c a β \lambda:= \lambda_\tau c a^\beta λ := λ τ c a β and γ : = ν + β \gamma:= \nu+ \beta γ := ν + β gives
τ ˉ i , k ≥ λ ( k − K 0 n ) γ , i ∈ [ n ] , k > K 0 . (32) \bar{\tau}_{i,k} \geq\lambda\left(\frac{k-K_0}{n}\right)^\gamma,\qquad i \in[n],\quad k > K_0. \tag*{(32)} τ ˉ i , k ≥ λ ( n k − K 0 ) γ , i ∈ [ n ] , k > K 0 . (32)
This gives a lower bound on τ ˉ i , k \bar{\tau}_{i,k} τ ˉ i , k in every neighbourhood larger than K 0 K_0 K 0 . Smaller λ \lambda λ or larger γ \gamma γ allows smaller values of τ ˉ i , k \bar{\tau}_{i,k} τ ˉ i , k when k k k is close to K 0 K_0 K 0 .
For a failure probability ζ ∈ ( 0 , 1 ) \zeta\in(0,1) ζ ∈ ( 0 , 1 ) , let L n ( ζ ) : = log ( 32 n 3 / ζ ) L_n(\zeta) := \log(32n^3/\zeta) L n ( ζ ) := log ( 32 n 3 / ζ ) . The following result shows how the growth of τ ˉ i , k \bar{\tau}_{i,k} τ ˉ i , k controls the gap between the bound and its target.
Theorem 2 (Upper bound). Suppose Assumptions 1, 2 and M ≥ ( 12 / α ) log ( 2 n 2 / ζ ) M \ge(12/\alpha)\log(2n^2/\zeta) M ≥ ( 12/ α ) log ( 2 n 2 / ζ ) . Then, with probability at least 1 − ζ 1-\zeta 1 − ζ conditional on X [ n ] X_{[n]} X [ n ] ,
K ^ 0 U − K 0 n ≲ ( s Y 2 K 0 L n ( ζ ) λ 2 n 2 ) 1 / ( 2 γ ) + ( s Y 2 L n ( ζ ) λ 2 n ) 1 / ( 2 γ − 1 ) + 1 n . (33) \frac{\widehat{K}_0^U-K_0}{n}\lesssim\left(\frac{s_Y^2K_0L_n(\zeta)}{\lambda^2n^2}\right)^{1/(2\gamma)}+\left(\frac{s_Y^2L_n(\zeta)}{\lambda^2n}\right)^{1/(2\gamma-1)}+\frac{1}{n}. \tag*{(33)} n K 0 U − K 0 ≲ ( λ 2 n 2 s Y 2 K 0 L n ( ζ ) ) 1/ ( 2 γ ) + ( λ 2 n s Y 2 L n ( ζ ) ) 1/ ( 2 γ − 1 ) + n 1 . (33)
For fixed ζ \zeta ζ , s Y / λ s_Y/\lambda s Y / λ , and γ \gamma γ , the inequality K 0 ≤ n K_0\le n K 0 ≤ n gives, for sufficiently large n n n ,
K ^ 0 U − K 0 n ≲ ( log n n ) 1 / { 2 ( ν + β ) } . (34) \frac{\widehat{K}_0^U-K_0}{n}\lesssim\left(\frac{\log n}{n}\right)^{1/\{2(\nu+\beta)\}}. \tag*{(34)} n K 0 U − K 0 ≲ ( n log n ) 1/ { 2 ( ν + β )} . (34)
Theorem 2 controls how much the reported upper bound K ^ 0 U / n \widehat{K}_0^U/n K 0 U / n can exceed K 0 / n K_0/n K 0 / n , the fraction of the sample contained in the largest zero-effect neighbourhood. The quantity s Y = σ + μ max + τ max s_Y=\sigma+\mu_{\max}+\tau_{\max} s Y = σ + μ m a x + τ m a x accounts for outcome noise and the magnitudes of baseline outcomes and treatment effects. The parameter λ \lambda λ , defined before (32) , controls the lower bound on the treatment effects accumulated as neighbourhoods grow beyond K 0 K_0 K 0 . A smaller ratio s Y / λ s_Y/\lambda s Y / λ therefore gives a tighter bound.
The geometry of the zero-effect set affects power through this accumulation of treatment effects. An irregular or disconnected set may leave neighbourhoods larger than K 0 K_0 K 0 with only a few affected units. If their effects are also small, the local zero-effect null can be difficult to reject. Irregularity or disconnectedness alone does not imply lower power; what matters is how much treatment effect these larger neighbourhoods contain. In (31) , the parameter ν \nu ν controls the lower bound c n u k ν c n u_k^\nu c n u k ν for the number of affected units lying at distance at least a u k a u_k a u k from Z 0 Z_0 Z 0 . Since u k ∈ ( 0 , 1 ] u_k\in(0,1] u k ∈ ( 0 , 1 ] , larger ν \nu ν permits fewer such units. In (30) , larger β \beta β allows smaller treatment effects near the boundary. Both increase γ = ν + β \gamma=\nu+\beta γ = ν + β and give a slower convergence rate in Theorem 2.
There are at most n 2 n^2 n 2 candidate neighbourhoods in every dimension: one for each centre and size. Dimension can nevertheless affect how many affected units these neighbourhoods contain and hence the exponent ν \nu ν in (31) . Appendix § 11 illustrates this through a ball expanding across a flat zero-effect boundary. As the ball expands, its affected part grows more slowly in higher dimensions. This calculation suggests ν = ( d + 1 ) / 2 \nu=(d+1)/2 ν = ( d + 1 ) /2 in Assumption 2. If the assumption holds with this value of ν \nu ν for every sample neighbourhood larger than K 0 K_0 K 0 , Theorem 2 gives the rate ( log n / n ) 1 / ( d + 1 + 2 β ) (\log n/n)^{1/(d+1+2\beta)} ( log n / n ) 1/ ( d + 1 + 2 β ) .
Fix d ≥ 1 d\ge1 d ≥ 1 , σ > 0 \sigma>0 σ > 0 , γ ≥ 1 \gamma\ge1 γ ≥ 1 , and 0 < λ ≤ τ max / ( 16 γ ) 0<\lambda\le\tau_{\max}/(16\gamma) 0 < λ ≤ τ m a x / ( 16 γ ) . We next show that the exponent 1 / ( 2 γ ) 1/(2\gamma) 1/ ( 2 γ ) in Theorem 2 cannot be improved uniformly over the class F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) defined below. For this lower-bound argument only, we use a fixed covariate design and a Gaussian special case of the outcome model in Assumption 1, specified in
Appendix E.4. The class F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) contains all treatment effect vectors in [ 0 , τ max ] n [0,\tau_{\max}]^n [ 0 , τ m a x ] n satisfying Assumption 2 with λ τ c a β = λ \lambda\tau_{\mathrm{ca}}\beta=\lambda λ τ ca β = λ and ν + β = γ \nu+\beta=\gamma ν + β = γ . This class allows irregular treatment effects and zero-effect sets with disconnected parts. Write P τ P_\tau P τ for the law of the observed data and any auxiliary randomness used to compute the bound.
Theorem 3 (Lower bound). Fix α , ζ ∈ ( 0 , 1 ) \alpha,\zeta\in(0,1) α , ζ ∈ ( 0 , 1 ) with α + ζ < 1 \alpha+\zeta<1 α + ζ < 1 . For sufficiently large n n n , any upper confidence bound U U U satisfying
inf τ ∈ F n ( λ , γ ) P τ { U ≥ K 0 ( τ ) } ≥ 1 − α \inf_{\tau\in\mathcal{F}_n(\lambda,\gamma)} P_\tau\{U\ge K_0(\tau)\}\ge1-\alpha τ ∈ F n ( λ , γ ) inf P τ { U ≥ K 0 ( τ )} ≥ 1 − α obeys, for some τ ∈ F n ( λ , γ ) \tau\in\mathcal{F}_n(\lambda,\gamma) τ ∈ F n ( λ , γ ) and with probability greater than ζ \zeta ζ ,
U − K 0 ( τ ) n ≳ n − 1 / ( 2 γ ) . (35) \frac{U-K_0(\tau)}{n}\gtrsim n^{-1/(2\gamma)}. \tag*{(35)} n U − K 0 ( τ ) ≳ n − 1/ ( 2 γ ) . (35)
Theorem 2 bounds the excess fraction at rate ( log n / n ) 1 / ( 2 γ ) (\log n/n)^{1/(2\gamma)} ( log n / n ) 1/ ( 2 γ ) with probability at least 1 − ζ 1-\zeta 1 − ζ . At this probability level, Theorem 3 rules out rates faster than n − 1 / ( 2 γ ) n^{-1/(2\gamma)} n − 1/ ( 2 γ ) for any uniformly valid upper confidence bound. Thus, the rate for the excess of our upper confidence bound over the true size is optimal up to the logarithmic factor ( log n ) 1 / ( 2 γ ) (\log n)^{1/(2\gamma)} ( log n ) 1/ ( 2 γ ) over the allowed covariate designs and treatment effects in F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) .
In the proof of Theorem 3, we obtain the lower bound by constructing alternative models that assign positive effects to a few units at unknown locations within a zero-effect neighbourhood. These models satisfy Assumption 2 with β = 0 \beta=0 β = 0 and ν = γ \nu=\gamma ν = γ , but their values of K 0 K_0 K 0 are smaller than that of the original model by order n 1 − 1 / ( 2 γ ) n^{1-1/(2\gamma)} n 1 − 1/ ( 2 γ ) . A mixture over their data distributions remains close to the original distribution, making this difference in K 0 K_0 K 0 difficult to detect from the observed data.
Experiments
We next test our method using synthetic and real data. In simulations, we assess coverage, power, convergence rates, and computational efficiency. We then apply the method to real data to illustrate how it bounds the size of zero-effect regions across covariates of interest. Code to reproduce the experiments in this article is available at https://github.com/lipengyu88/reach-of-treatment-effects .
Synthetic data experiments
In one dimension, we generate
W i ∼ U ( 0 , 1 ) , Y i ( 0 ) = 0.5 + 2 W i + ϵ i , ϵ i ∼ N ( 0 , 0.5 2 ) . W_i\sim U(0,1),\qquad Y_i(0)=0.5+2W_i+\epsilon_i,\qquad\epsilon_i\sim N(0,0.5^2). W i ∼ U ( 0 , 1 ) , Y i ( 0 ) = 0.5 + 2 W i + ϵ i , ϵ i ∼ N ( 0 , 0. 5 2 ) .
After ordering units by W i W_i W i , we set the treatment effect to zero in a centred block of length L 0 = ⌊ 0.10 n ⌋ L_0 = \lfloor0.10n \rfloor L 0 = ⌊ 0.10 n ⌋ and to δ = 1 \delta= 1 δ = 1 outside it. In two dimensions, we generate
W i ∼ U ( 0 , 1 ) 2 , Y i ( 0 ) = 0.5 + 2 W i 1 + 2 W i 2 + ϵ i , W_i \sim U(0,1)^2,\qquad Y_i(0) = 0.5 + 2W_{i1} + 2W_{i2} + \epsilon_i, W i ∼ U ( 0 , 1 ) 2 , Y i ( 0 ) = 0.5 + 2 W i 1 + 2 W i 2 + ϵ i ,
with the same error distribution. We choose the unit closest to ( 0.5 , 0.5 ) (0.5, 0.5) ( 0.5 , 0.5 ) as the centre and set the effects of its ⌊ 0.10 n ⌋ \lfloor0.10n \rfloor ⌊ 0.10 n ⌋ nearest neighbours, including itself, to zero. Neighbours are defined using the normalized-rank distance in § 4.2.1 . All other units have effect δ = 1 \delta= 1 δ = 1 , so K 0 = ⌊ 0.10 n ⌋ K_0 = \lfloor0.10n \rfloor K 0 = ⌊ 0.10 n ⌋ . In both settings, Y i ( 1 ) = Y i ( 0 ) + τ i Y_i(1) = Y_i(0) + \tau_i Y i ( 1 ) = Y i ( 0 ) + τ i .
Unless stated otherwise, we use complete randomization with half the units treated, α = 0.05 \alpha= 0.05 α = 0.05 , and M = 500 M = 500 M = 500 shared randomization draws. We search over all integer region sizes using descending search and run 200 repetitions for each sample size n n n .
For each candidate region B B B , we compare our method using the uncentred statistic
T B r a w = ∑ i ∈ B ( Z i − π ) Y i T_B^{\mathrm{raw}} = \sum_{i \in B}(Z_i - \pi)Y_i T B raw = i ∈ B ∑ ( Z i − π ) Y i
with our method using the centred statistic in (14) . In both dimensions, the comparison uses the same outcomes, treatment assignment, candidate regions and shared randomization draws in each repetition. Figure 2 shows the union of non-rejected regions for a repetition with n = 7000 n = 7000 n = 7000 . With the uncentred statistic, the union extends beyond the true zero-effect region, especially in two dimensions. Centering reduces this extension and tightens the bound from 14.0% to 10.9% in one dimension and from 22.7% to 11.3% in two dimensions, closer to the true size of 10%.
Figure 2. Non-rejected regions (n = 7000 n = 7000 n = 7000 ). The histogram shows the distribution of W W W in one dimension; the points show normalized covariate ranks in two dimensions. Blue marks the union of non-rejected regions of the size, L ^ n , 0 U \widehat{L}^{U}_{n,0} L n , 0 U in one dimension and K ^ 0 U \widehat{K}^{U}_{0} K 0 U in two dimensions. The dashed lines mark the true zero-effect regions. Histogram bins with at least three quarters of their units in the union are drawn entirely blue.
Coverage and size of the upper bound
Figure 3 shows empirical coverage on the left and mean confidence bounds divided by n n n on the right. Across all simulated sample sizes, empirical coverage is at least the nominal 95% level for both statistics. Centering reduces variation in the statistic caused by differences in the number of treated units across randomization draws, making treatment effects easier to detect in smaller regions.
Figure 3. (a) One dimension. (b) Two dimensions. Coverage and size of the upper bounds using the uncentred and within-region centred statistics. Left: empirical coverage of L 0 L_0 L 0 (K 0 K_0 K 0 ) in one (two) dimensions; the dashed line marks the nominal 0.95 level. Right: means of the bound L ^ n , 0 / n \widehat{L}_{n,0}/n L n , 0 / n (K ^ 0 / n \widehat{K}_0/n K 0 / n ) in one (two) dimensions; the dashed line marks the true value 0.10.
We can see that centering gives much smaller bounds in both dimensions, particularly at small sample sizes. At n = 200 n = 200 n = 200 , it reduces the mean bound divided by n n n from 0.574 to 0.196 in one dimension and from 0.787 to 0.263 in two dimensions. For both statistics, the mean bound approaches the true fraction 0.10 as n n n increases, but it does so much faster with the centred statistic. Appendix § 12 examines convergence under different treatment-effect patterns and zero-effect regions.
Computational time
We compare the computational time of four search methods from Table 1: conditional descending search, shared descending search, shared bisection, and shared bisection with a Gaussian warm-start. The one-dimensional design is the same as above. For the two-dimensional timings, the zero-effect region is a disc of area 0.1 centred at (0.5, 0.5), containing about 10% of the units. We use the centred statistic in both dimensions. We measure CPU time on AMD EPYC 7J13 processors in one dimension and Intel Xeon Platinum 8358 processors in two dimensions.
Figure 4 shows that shared descending search is up to several thousand times faster than conditional descending search in both dimensions. Bisection further reduces computation substantially in one dimension, with a smaller gain in two dimensions. In one dimension, cumulative sums along a single ordering allow each selected length to be tested cheaply. In two dimensions, the implementation first computes cumulative sums for every centre and neighbourhood size, so bisection saves less computation. The Gaussian warm-start saves little at M = 500 M = 500 M = 500 , but gives larger savings when both the sample size n n n and the number of draws M M M are large.
Figure 4. (a) One dimension. (b) Two dimensions. CPU time in minutes, on a logarithmic scale, for the four search methods in Section 3. For methods using shared randomization draws, we report the median time over 10 runs. Conditional search is slower, so we report its time on only one run per sample size.
Real-data experiments
The Gerber–Green–Larimer social-pressure experiment
We analyse the Gerber–Green–Larimer voter-turnout experiment [8 ] , comparing households assigned to receive no mailing (Control) with those assigned to receive a social-pressure mailing (Neighbors). The mailing listed whether members of the household and their neighbours had voted in previous elections and announced that updated records would be circulated after the election. It aimed to encourage voting by making households aware that their neighbours could see whether they voted. Our sample contains n = 119,999 n = 119{,}999 n = 119 , 999 households from 10,000 groups within which treatment was randomized. The outcome is the household turnout rate in the 2006 primary election. We order households by their mean age, breaking ties by group and household identifiers.
We implement our method with the centred statistic, α = 0.05 \alpha= 0.05 α = 0.05 and M = 5000 M = 5000 M = 5000 shared permutations. Each permutation preserves the observed Control and Neighbors counts within every group, following the recorded assignment design.
The global sharp null is rejected, and the mean household turnout difference is 8.48 percentage points (standard error: 0.34 percentage points). Figure 5 shows the union of non-rejected blocks at the largest non-rejected integer length, L ˉ n , 0 = 4286 \bar{L}_{n,0} = 4286 L ˉ n , 0 = 4286 households. holds (3.6% of the sample). This 95% upper confidence bound for L 0 L_0 L 0 complements the global rejection by ruling out contiguous blocks of unaffected households containing more than 3.6% of the sample along the age ordering. We find only one non-rejected block of size L ^ n , 0 U \hat{L}^{U}_{n,0} L ^ n , 0 U , containing households with mean ages between 35.5 and 37 years. Taken together, these findings suggest that the mailing increases turnout on average and that its effects extend broadly across household ages.
Figure 5. Results from the Gerber–Green–Larimer experiment. The histogram shows the distribution of the average age of household members in 2006 across the 119,999 households analysed. The 95% upper confidence bound for the largest zero-effect block is L ^ n , 0 U = 4286 \hat{L}^{U}_{n,0}=4286 L ^ n , 0 U = 4286 households (3.6% of the sample). Blue marks the union of non-rejected blocks of this size. The inset enlarges ages 31–42, shaded in the main panel.
ACTG 175 HIV clinical trial
We analyse data from 1054 patients in the ACTG 175 HIV clinical trial [9 ] , comparing zidovudine alone (control) with the combination of zidovudine and didanosine (treatment). We order the sample by baseline CD4 count and consider the 20-week CD4 count and its change from baseline as outcomes.
We implement our method with the centred statistic, α = 0.05 \alpha= 0.05 α = 0.05 and M = 5000 M = 5000 M = 5000 shared permutations. We permute treatment assignments within three groups defined by patients’ antiretroviral treatment histories, preserving each group’s observed treatment and control counts and assuming that all such assignments are equally likely.
The 95% upper confidence bound for L 0 L_0 L 0 is L n , 0 U = 134 L_{n,0}^{U}=134 L n , 0 U = 134 patients (12.7% of the sample) for the 20-week CD4 count and 149 patients (14.1%) for the change from baseline. These bounds rule out large contiguous groups of unaffected patients over the baseline CD4. For each outcome, Figure 6 shows in blue the only non-rejected block at the reported size. The Baseline CD4 counts in this block range from 302 to 341 cells/mm3 ^{3} 3 for the 20-week outcome and from 474 to 1199 cells/mm3 ^{3} 3 for the change from baseline.
Figure 6. Results from ACTG 175 with patients ordered by baseline CD4 count. The histogram shows the empirical distribution of baseline CD4 counts. The 95% upper confidence bounds for the largest zero-effect block are (a) L ^ n , 0 U = 134 \widehat{L}_{n,0}^{U}=134 L n , 0 U = 134 patients (12.7%) for the 20-week CD4 count and (b) 149 patients (14.1%) for its change from baseline. Blue marks the non-rejected block of the reported size L ^ n , 0 U \widehat{L}_{n,0}^{U} L n , 0 U in each panel. Bins with at least three quarters of their patients in the block are drawn entirely blue.
We define nearest-neighbour regions using baseline CD4 count and age (Figure 7 ). Using the same randomization draws and searching over all integer sizes, we obtain 95% upper confidence bounds of K ^ 0 U = 228 \hat{K}_{0}^{U}=228 K ^ 0 U = 228 patients (21.6%) for the 20-week CD4 count and 294 patients (27.9%) for the change from baseline. Adding age changes the candidate regions and the target: these bounds concern the largest zero-effect neighbourhood defined jointly by baseline CD4 count and age.
Figure 7. Results from ACTG 175 with baseline CD4 count and age as covariates. Points are the normalized ranks of these two covariates. The 95% upper confidence bounds for the largest zero-effect neighbourhood are (a) K ^ 0 U = 228 \widehat{K}_{0}^{U}=228 K 0 U = 228 patients (21.6%) for the 20-week CD4 count and (b) 294 patients (27.9%) for its change from baseline. Blue marks the union of non-rejected neighbourhoods of the size K ^ 0 U \widehat{K}_{0}^{U} K 0 U in each panel.
Discussion
We develop randomization inference for the reach of treatment effects, providing a finite-sample valid upper confidence bound for the size of the largest zero-effect region. The bound and displays of non-rejected regions show how broadly treatment effects extend across covariate values, complementing existing randomization inference methods for average effects and distributions of individual effects.
Obtaining this upper confidence bound requires running randomization tests across many overlapping regions at all locations and region sizes. We make this construction computationally efficient by sharing randomization draws and reusing cumulative sums for linear statistics. Our theoretical analysis shows how the number of affected units, the sizes of their effects, and the geometry of the zero-effect set affect the tightness of the bound. It establishes a minimax optimal rate, up to a logarithmic factor, for the bound’s excess above the true size. Applications to experimental data from several domains demonstrate how the method moves beyond detecting a treatment effect to assessing how broadly it extends across covariate values.
Several extensions could broaden the scope of our method. Studying regions where all effects satisfy ∣ τ i ∣ ≤ δ 0 |\tau_i| \leq\delta_0 ∣ τ i ∣ ≤ δ 0 for a specified tolerance would allow researchers to bound the size of the largest region with no practically meaningful treatment effect. This requires valid tests of composite local nulls. Moreover, detecting mixtures of positive and negative effects without cancellation calls for local statistics beyond the linear statistic considered here. These statistics may not allow shared calculations, creating new computational challenges. Finally, extending inference from region size to region location would require joint error control across candidate regions to provide confidence guarantees for where zero-effect regions may lie.
Appendices
Outcome adjustment in randomization tests
Conditional tests and shared global randomization tests differ in which fitted outcome adjustments they can use. Throughout this appendix, the tested block B B B is chosen using pre-treatment information, and the fitting rule does not use treatment assignments. Any randomness in fitting is held fixed.
Why the local null matters
Consider the alternative adjusted statistic
T B a d j ( z B ; Y [ n ] ) : = ∑ i ∈ B ( z i − π ) ( Y i − Y ^ i ) , T_{B}^{\mathrm{adj}}(z_B; Y_{[n]}) := \sum_{i\in B}(z_i-\pi)(Y_i-\widehat{Y}_i), T B adj ( z B ; Y [ n ] ) := i ∈ B ∑ ( z i − π ) ( Y i − Y i ) ,
where Y ^ i \widehat{Y}_i Y i is a prediction from a model fitted to all observed covariates and outcomes. The observed statistic uses z B = Z B z_B = Z_B z B = Z B ; the randomized statistics hold the observed outcomes and fitted predictions fixed and vary z B z_B z B .
Under the global Fisher sharp null, every observed outcome is unchanged under reassignment. The fitted predictions therefore remain fixed as well, so this adjustment preserves the usual randomization argument without requiring a correctly specified regression model. Under the local sharp null H 0 , B H_{0,B} H 0 , B , only the outcomes within B B B are fixed. Outside outcomes may change with the assignment and affect the fitted predictions. Thus, a fit can depend on the assignment even when treatment is not included as a predictor. Freezing that fit while drawing new global assignments does not necessarily make the observed and randomized statistics exchangeable.
Why conditional tests permit the adjustment
Let Q D Q_D Q D denote the known treatment assignment distribution, and let Z − B Z_{-B} Z − B denote the assignments outside B B B . Conditional on Z − B Z_{-B} Z − B and under H 0 , B H_{0,B} H 0 , B , outcomes inside B B B are fixed by the null, and outcomes outside B B B are fixed by their assignments. All observed outcomes and the fitted predictions are therefore fixed.
Draw Z B ( 1 ) , … , Z B ( M ) Z_B^{(1)}, \ldots, Z_B^{(M)} Z B ( 1 ) , … , Z B ( M ) independently from Q D ( Z B ∣ Z − B ) Q_D(Z_B \mid Z_{-B}) Q D ( Z B ∣ Z − B ) , independently of the observed Z B Z_B Z B conditional on X [ n ] X_{[n]} X [ n ] , Y [ n ] ( 0 ) Y_{[n]}(0) Y [ n ] ( 0 ) , Y [ n ] ( 1 ) Y_{[n]}(1) Y [ n ] ( 1 ) and Z − B Z_{-B} Z − B . Under complete randomization, fixing Z − B Z_{-B} Z − B fixes the number of treated units in B B B , K B = n 1 − ∑ i ∉ B Z i K_B = n_1 - \sum_{i\notin B} Z_i K B = n 1 − ∑ i ∈ / B Z i . The conditional distribution is uniform over the ( ∣ B ∣ K B ) \binom{|B|}{K_B} ( K B ∣ B ∣ ) assignments that treat exactly K B K_B K B units in B B B . This is the usual within-block conditional permutation test. Define
p B , M c o n d : = 1 + ∑ m = 1 M 1 { T B a d j ( Z B ( m ) ; Y [ n ] ) ≥ T B a d j ( Z B ; Y [ n ] ) } M + 1 . p_{B,M}^{\mathrm{cond}} := \frac{1+\sum_{m=1}^{M}\mathbb{1}\left\{T_{B}^{\mathrm{adj}}\left(Z_{B}^{(m)};Y_{[n]}\right)\geq T_{B}^{\mathrm{adj}}\left(Z_{B};Y_{[n]}\right)\right\}}{M+1}. p B , M cond := M + 1 1 + ∑ m = 1 M 1 { T B adj ( Z B ( m ) ; Y [ n ] ) ≥ T B adj ( Z B ; Y [ n ] ) } .
Proposition 3. Suppose H 0 , B H_{0,B} H 0 , B holds. The p p p -value p B , M c o n d p_{B,M}^{\mathrm{cond}} p B , M cond defined above satisfies
P { p B , M c o n d ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) , Z − B } ≤ α , α ∈ [ 0 , 1 ] . \mathbb{P}\left\{p_{B,M}^{\mathrm{cond}}\leq\alpha\mid X_{[n]},Y_{[n]}(0),Y_{[n]}(1),Z_{-B}\right\}\leq\alpha,\qquad\alpha\in[0,1]. P { p B , M cond ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) , Z − B } ≤ α , α ∈ [ 0 , 1 ] .
The proof is given in Appendix § 13 .1. Averaging over Z − B Z_{-B} Z − B gives
P { p B , M c o n d ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≤ α . \mathbb{P}\left\{p_{B,M}^{\mathrm{cond}}\leq\alpha\mid X_{[n]},Y_{[n]}(0),Y_{[n]}(1)\right\}\leq\alpha. P { p B , M cond ≤ α ∣ X [ n ] , Y [ n ] ( 0 ) , Y [ n ] ( 1 ) } ≤ α .
These valid local p p p -values can therefore be combined by the same maximum-p p p construction and inversion used in the main manuscript.
A counterexample for global randomization
Consider six units, exactly three of which are treated. Let B = { 1 , 2 , 3 } B=\{1,2,3\} B = { 1 , 2 , 3 } and set
Y i ( 0 ) = Y i ( 1 ) = 0 ( i ∈ B ) , Y i ( 0 ) = − 1 , Y i ( 1 ) = 1 ( i ∉ B ) . Y_i(0)=Y_i(1)=0\quad(i\in B),\qquad Y_i(0)=-1,\quad Y_i(1)=1\quad(i\notin B). Y i ( 0 ) = Y i ( 1 ) = 0 ( i ∈ B ) , Y i ( 0 ) = − 1 , Y i ( 1 ) = 1 ( i ∈ / B ) .
The local null on B B B is true. Fit an intercept to all six observed outcomes, so Y ^ i = Y ‾ \widehat{Y}_i=\overline{Y} Y i = Y for every unit, where Y ‾ = n − 1 ∑ i = 1 n Y i \overline{Y}=n^{-1}\sum_{i=1}^{n}Y_i Y = n − 1 ∑ i = 1 n Y i . The adjusted statistic is
T B a d j ( Z B ; Y [ n ] ) = ∑ i ∈ B ( Z i − 1 2 ) ( Y i − Y ‾ ) . T_{B}^{\mathrm{adj}}(Z_B;Y_{[n]})=\sum_{i\in B}\left(Z_i-\frac{1}{2}\right)(Y_i-\overline{Y}). T B adj ( Z B ; Y [ n ] ) = i ∈ B ∑ ( Z i − 2 1 ) ( Y i − Y ) .
Writing K = ∑ i ∈ B Z i K=\sum_{i\in B}Z_i K = ∑ i ∈ B Z i , we have
Y ‾ = 3 − 2 K 6 , T B a d j ( Z B ; Y [ n ] ) = ( K − 3 / 2 ) 2 3 . \overline{Y}=\frac{3-2K}{6},\qquad T_{B}^{\mathrm{adj}}(Z_B;Y_{[n]})=\frac{(K-3/2)^2}{3}. Y = 6 3 − 2 K , T B adj ( Z B ; Y [ n ] ) = 3 ( K − 3/2 ) 2 .
For a new global assignment Z ′ Z' Z ′ , let K ′ = ∑ i ∈ B Z i ′ K'=\sum_{i\in B}Z'_i K ′ = ∑ i ∈ B Z i ′ . With the fitted mean held fixed,
T B a d j ( Z B ′ ; Y [ n ] ) = ( K ′ − 3 / 2 ) ( K − 3 / 2 ) 3 . T_{B}^{\mathrm{adj}}(Z'_B;Y_{[n]})=\frac{(K'-3/2)(K-3/2)}{3}. T B adj ( Z B ′ ; Y [ n ] ) = 3 ( K ′ − 3/2 ) ( K − 3/2 ) .
The count K ′ K' K ′ equals 0 , 1 , 2 , 3 0,1,2,3 0 , 1 , 2 , 3 with probabilities 1 / 20 , 9 / 20 , 9 / 20 , 1 / 20 1/20,9/20,9/20,1/20 1/20 , 9/20 , 9/20 , 1/20 , respectively. Holding the observed count K K K fixed, the exact randomization p p p -value is
p B g l o b a l : = P K ′ { ( K ′ − 3 / 2 ) ( K − 3 / 2 ) ≥ ( K − 3 / 2 ) 2 } = { 1 / 20 , K ∈ { 0 , 3 } , 1 / 2 , K ∈ { 1 , 2 } . p_{B}^{\mathrm{global}}:=\mathbb{P}_{K'}\left\{(K'-3/2)(K-3/2)\geq(K-3/2)^2\right\}=
\begin{cases}
1/20,&K\in\{0,3\},\\
1/2,&K\in\{1,2\}.
\end{cases} p B global := P K ′ { ( K ′ − 3/2 ) ( K − 3/2 ) ≥ ( K − 3/2 ) 2 } = { 1/20 , 1/2 , K ∈ { 0 , 3 } , K ∈ { 1 , 2 } .
Thus, P { p B g l o b a l ≤ 0.05 } = 0.10 \mathbb{P}\{p_{B}^{\mathrm{global}}\leq0.05\}=0.10 P { p B global ≤ 0.05 } = 0.10 under H 0 , B H_{0,B} H 0 , B . In contrast, centering by Y ‾ B \overline{Y}_B Y B gives a statistic of zero and a p p p -value of one in this example.
Warm-start using a Gaussian approximation
Under the monotonicity in (16) we use a Gaussian approximation to find a tentative bracket before checking it with shared permutations. Under complete randomization, with the within-block outcomes held fixed, the statistic T B ( m ) T_B^{(m)} T B ( m ) under a simulated assignment has mean zero and variance
σ B 2 : = Var ( T B ( m ) ) = n π ( 1 − π ) n − 1 ∑ i ∈ B ( Y i − Y ˉ B ) 2 . \sigma_B^2 := \operatorname{Var}(T_B^{(m)}) = \frac{n\pi(1-\pi)}{n-1} \sum_{i\in B}(Y_i-\bar{Y}_B)^2. σ B 2 := Var ( T B ( m ) ) = n − 1 nπ ( 1 − π ) i ∈ B ∑ ( Y i − Y ˉ B ) 2 .
The formula simplifies because ∑ i ∈ B ( Y i − Y ˉ B ) = 0 \sum_{i\in B}(Y_i-\bar{Y}_B)=0 ∑ i ∈ B ( Y i − Y ˉ B ) = 0 . Approximating this randomization distribution by N ( 0 , σ B 2 ) N(0,\sigma_B^2) N ( 0 , σ B 2 ) gives the one-sided Gaussian p p p -value
p ^ r : = max B ∈ B r { 1 − Φ ( T B σ B ) } , \hat{p}_r := \max_{B\in\mathcal{B}_r}\left\{1-\Phi\left(\frac{T_B}{\sigma_B}\right)\right\}, p ^ r := B ∈ B r max { 1 − Φ ( σ B T B ) } ,
where Φ \Phi Φ is the standard normal distribution function and T B T_B T B is the observed statistic. If σ B 2 = 0 \sigma_B^2=0 σ B 2 = 0 , then every within-block outcome is equal and both T B T_B T B and T B ( m ) T_B^{(m)} T B ( m ) are zero; we set the corresponding Gaussian block p p p -value to 1. Using
∑ i ∈ B ( Y i − Y ˉ B ) 2 = ∑ i ∈ B Y i 2 − 1 ∣ B ∣ ( ∑ i ∈ B Y i ) 2 , \sum_{i\in B}(Y_i-\bar{Y}_B)^2=\sum_{i\in B}Y_i^2-\frac{1}{|B|}\left(\sum_{i\in B}Y_i\right)^2, i ∈ B ∑ ( Y i − Y ˉ B ) 2 = i ∈ B ∑ Y i 2 − ∣ B ∣ 1 ( i ∈ B ∑ Y i ) 2 ,
we compute the variance from cumulative sums of Y i Y_i Y i and Y i 2 Y_i^2 Y i 2 . Together with the cumulative sums for T B T_B T B , this gives an O ( n ) O(n) O ( n ) cost for evaluating p ^ r \hat{p}_r p ^ r at each length.
Finding a tentative bracket. The Gaussian search considers all lengths r ∈ [ n ] r\in[n] r ∈ [ n ] and starts at r = 1 r=1 r = 1 . If its p p p -value exceeds α \alpha α , we double the length, capping it at n n n . We continue until the Gaussian p p p -value is at most α \alpha α or we reach n n n .
If the first rejection occurs after the initial length, we let r + r_+ r + be that length and r − r_- r − the length evaluated immediately before it. These endpoints satisfy
r − < r + , p ^ r − > α , p ^ r + ≤ α . r_-<r_+,\qquad\hat{p}_{r_-}>\alpha,\qquad\hat{p}_{r_+}\le\alpha. r − < r + , p ^ r − > α , p ^ r + ≤ α .
We narrow the bracket by bisection. At each step, we evaluate the Gaussian p p p -value at ⌊ ( r − + r + ) / 2 ⌋ \lfloor(r_-+r_+)/2\rfloor ⌊( r − + r + ) /2 ⌋ . This length replaces r − r_- r − if its p p p -value exceeds α \alpha α , and r + r_+ r + otherwise. We stop when r + = r − + 1 r_+=r_-+1 r + = r − + 1 . If length 1 is rejected by the Gaussian approximation, or no Gaussian rejection is found, we use the direct Monte Carlo search described below.
We evaluate the Monte Carlo p p p -values at the two endpoints. If they satisfy
p ~ r − > α , p ~ r + ≤ α , (36) \widetilde{p}_{r_-}>\alpha,\qquad\widetilde{p}_{r_+}\le\alpha, \tag*{(36)} p r − > α , p r + ≤ α , (36)
we report r − r_- r − as the upper confidence bound for L 0 L_0 L 0 . The endpoints are adjacent, and the monotonicity in (16) ensures that every larger length is rejected.
If either inequality fails, we use direct Monte Carlo bisection. We first check length 1. If it is rejected, monotonicity implies that all lengths are rejected, and we report zero. Otherwise, we check length n n n . If it is not rejected, we report n n n . In the remaining case, lengths 1 and n n n form a valid Monte Carlo bracket. We use bisection to narrow this bracket, replacing the lower endpoint after a non-rejection and the upper endpoint after a rejection. Once the endpoints are adjacent, we report the lower endpoint. The same direct search is used when the Gaussian search does not produce a bracket.
Computational cost. Let q q q be the number of Gaussian evaluations and k k k the total number of Monte Carlo evaluations, including any fallback search. The total cost is C w a r m = O ( n q + M n k ) C_{\mathrm{warm}} = O(nq + Mn k) C warm = O ( n q + M nk ) . Here q = O ( log n ) q = O(\log n) q = O ( log n ) . If the adjacent Gaussian endpoints satisfy (36) , then k = 2 k = 2 k = 2 and C w a r m = O ( n log n + M n ) C_{\mathrm{warm}} = O(n \log n + Mn) C warm = O ( n log n + M n ) . A poor approximation may require the fallback search, for which k = O ( log n ) k = O(\log n) k = O ( log n ) . The cost then becomes O ( n log n + M n log n ) O(n \log n + Mn \log n) O ( n log n + M n log n ) , removing the saving in Monte Carlo evaluations relative to direct bisection. The Gaussian approximation affects the search cost. The validity of the reported bound follows from the Monte Carlo tests and the monotonicity assumption: under (16) , the search returns the same bound as a search over all lengths r ∈ [ n ] r \in[n] r ∈ [ n ] .
Dimension and neighbourhood geometry
For each of the n n n observed centres, we form one neighbourhood at each size k = 1 , … , n k = 1, \ldots, n k = 1 , … , n . There are therefore at most n 2 n^2 n 2 distinct candidate neighbourhoods in any dimension. Dimension can nevertheless affect how many affected units a growing neighbourhood contains, and hence the exponent ν \nu ν in (31) , which controls the lower bound on the number of units sufficiently far from Z 0 \mathcal{Z}_0 Z 0 .
Figure 8 illustrates this connection. Let P V P_V P V be a continuous covariate distribution in rank space. Suppose all points to the left of a vertical boundary ∂ Z 0 \partial\mathcal{Z}_0 ∂ Z 0 have zero treatment effect, while points to the right are affected. Consider a ball B 0 B_0 B 0 of radius r 0 > 0 r_0 > 0 r 0 > 0 entirely inside Z 0 \mathcal{Z}_0 Z 0 and touching this boundary at one point in Figure 8 (a). Let B s B_s B s have the same centre and radius r 0 + s r_0 + s r 0 + s . Assume these balls lie inside the covariate support, where the density is bounded above and below by positive constants.
Figure 8. Expansion across a zero-effect boundary in two dimensions. (a) The ball B 0 B_0 B 0 lies in Z 0 \mathcal{Z}_0 Z 0 and touches its boundary. (b) Increasing the radius from r 0 r_0 r 0 to r 0 + s r_0+s r 0 + s adds zero-effect area (blue) and an affected cap (olive). The hatched part lies at least s / 2 s/2 s /2 from Z 0 \mathcal{Z}_0 Z 0 . For fixed r 0 r_0 r 0 and small s s s , the band B s ∖ B 0 B_s \setminus B_0 B s ∖ B 0 has area of order s s s . Its affected part, the cap B s ∖ Z 0 B_s \setminus\mathcal{Z}_0 B s ∖ Z 0 , has area of order s 3 / 2 s^{3/2} s 3/2 .
In Figure 8 (b), the cap has horizontal depth s s s . Its width is the distance between the two points where the enlarged circle meets the boundary. Since the centre is at distance r 0 r_0 r 0 from the boundary, the Pythagorean theorem gives
width = 2 ( r 0 + s ) 2 − r 0 2 = 2 2 r 0 s + s 2 ≍ s , \operatorname{width} = 2\sqrt{(r_0+s)^2-r_0^2} = 2\sqrt{2r_0s+s^2} \asymp\sqrt{s}, width = 2 ( r 0 + s ) 2 − r 0 2 = 2 2 r 0 s + s 2 ≍ s ,
for fixed r 0 > 0 r_0>0 r 0 > 0 as s ↓ 0 s \downarrow0 s ↓ 0 . In d ≥ 2 d \ge2 d ≥ 2 dimensions, the cross-section B s ∩ ∂ Z 0 B_s \cap\partial\mathcal{Z}_0 B s ∩ ∂ Z 0 is a ( d − 1 ) (d-1) ( d − 1 ) -dimensional ball with diameter of order s \sqrt{s} s . Its ( d − 1 ) (d-1) ( d − 1 ) -dimensional volume is therefore of order s ( d − 1 ) / 2 s^{(d-1)/2} s ( d − 1 ) /2 . The cap B s ∖ Z 0 B_s \setminus\mathcal{Z}_0 B s ∖ Z 0 extends a distance s s s beyond the boundary. Integrating its cross-sectional volumes over this depth gives
Vol d ( B s ∖ Z 0 ) ≍ s ( d + 1 ) / 2 \operatorname{Vol}_{d}(B_s \setminus\mathcal{Z}_0) \asymp s^{(d+1)/2} Vol d ( B s ∖ Z 0 ) ≍ s ( d + 1 ) /2
The full added band B s ∖ B 0 B_s \setminus B_0 B s ∖ B 0 has volume proportional to ( r 0 + s ) d − r 0 d ≍ s (r_0+s)^d-r_0^d \asymp s ( r 0 + s ) d − r 0 d ≍ s for fixed r 0 > 0 r_0>0 r 0 > 0 as s ↓ 0 s \downarrow0 s ↓ 0 . Thus, under the density bounds above, u s : = P V ( B s ∖ B 0 ) ≍ s u_s := P_V(B_s \setminus B_0) \asymp s u s := P V ( B s ∖ B 0 ) ≍ s . As indicated by the hatched area, a fixed fraction of the cap’s volume lies at distance at least s / 2 s/2 s /2 from Z 0 \mathcal{Z}_0 Z 0 . Consequently, as s ↓ 0 s \downarrow0 s ↓ 0 ,
P V { v ∈ B s : dist ( v , Z 0 ) ≥ s / 2 } ≍ s ( d + 1 ) / 2 ≍ u s ( d + 1 ) / 2 . (37) P_V\{v \in B_s : \operatorname{dist}(v,\mathcal{Z}_0) \ge s/2\} \asymp s^{(d+1)/2} \asymp u_s^{(d+1)/2}. \tag*{(37)} P V { v ∈ B s : dist ( v , Z 0 ) ≥ s /2 } ≍ s ( d + 1 ) /2 ≍ u s ( d + 1 ) /2 . (37)
Since s / 2 ≍ u s s/2 \asymp u_s s /2 ≍ u s , the enlarged ball contains affected mass of order u s ( d + 1 ) / 2 u_s^{(d+1)/2} u s ( d + 1 ) /2 at distance of order u s u_s u s from Z 0 \mathcal{Z}_0 Z 0 . The affected mass grows as the ( d + 1 ) / 2 (d+1)/2 ( d + 1 ) /2 power of the added mass. This corresponds to ν = ( d + 1 ) / 2 \nu=(d+1)/2 ν = ( d + 1 ) /2 in (31) , provided the same lower bound holds uniformly over the sample neighbourhoods.
Applying this calculation to K 0 K_0 K 0 requires the count condition to hold for every sample neighbourhood larger than K 0 K_0 K 0 . If (31) holds uniformly with ν = ( d + 1 ) / 2 \nu=(d+1)/2 ν = ( d + 1 ) /2 , then γ = d + 1 2 + β \gamma= \frac{d+1}{2} + \beta γ = 2 d + 1 + β , defined above (32) . For fixed ζ \zeta ζ and sufficiently large M M M and n n n , Theorem 2 gives, with probability at least 1 − ζ 1-\zeta 1 − ζ conditional on X [ n ] X_{[n]} X [ n ] ,
K ^ 0 U − K 0 n ≲ ( log n n ) 1 / ( d + 1 + 2 β ) . \frac{\widehat{K}_0^U-K_0}{n} \lesssim\left(\frac{\log n}{n}\right)^{1/(d+1+2\beta)}. n K 0 U − K 0 ≲ ( n log n ) 1/ ( d + 1 + 2 β ) .
This illustrates one way that dimension can slow the decrease of the excess-size bound. Other shapes of Z 0 Z_0 Z 0 or of the covariate support can lead to different values of ν \nu ν .
Examples of effect patterns. The class F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) defined before Theorem 3 allows different zero-effect sets and decompositions γ = ν + β \gamma= \nu+ \beta γ = ν + β . This class includes spatial models with abrupt or gradual changes in treatment effects. For example, let Z 0 Z_0 Z 0 be a ball in rank space centred at an observed point v i 0 v_{i_0} v i 0 and containing m ∈ { 1 , … , n − 1 } m \in\{1,\ldots,n-1\} m ∈ { 1 , … , n − 1 } units. Consider piecewise constant treatment effects
τ j = τ ∗ 1 { v j ∉ Z 0 } , 0 < τ ∗ ≤ τ max . \tau_j = \tau_* \mathbf{1}\{v_j \notin Z_0\}, \qquad0 < \tau_* \leq\tau_{\max}. τ j = τ ∗ 1 { v j ∈ / Z 0 } , 0 < τ ∗ ≤ τ m a x .
The m m m unaffected units form N i 0 ( m ) N_{i_0}^{(m)} N i 0 ( m ) , so K 0 = m K_0=m K 0 = m . Every neighbourhood of size k > m k>m k > m contains at least k − m k-m k − m affected units, giving
τ ˉ i , k ≥ τ ∗ k − K 0 n ≥ τ ∗ ( k − K 0 n ) γ . \bar{\tau}_{i,k} \geq\tau_* \frac{k-K_0}{n} \geq\tau_* \left(\frac{k-K_0}{n}\right)^\gamma. τ ˉ i , k ≥ τ ∗ n k − K 0 ≥ τ ∗ ( n k − K 0 ) γ .
Taking β = 0 \beta=0 β = 0 , ν = γ \nu=\gamma ν = γ , a = 1 a=1 a = 1 , λ τ = τ ∗ \lambda_\tau=\tau_* λ τ = τ ∗ , and c = λ / τ ∗ c=\lambda/\tau_* c = λ / τ ∗ verifies membership in F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) whenever λ ≤ τ ∗ \lambda\leq\tau_* λ ≤ τ ∗ . When the covariate sample satisfies (31) , the class also includes continuous treatment effects that increase with distance from a zero-effect region:
τ ( v ) = τ ∗ dist ( v , Z 0 ) β , β > 0 , \tau(v) = \tau_* \operatorname{dist}(v,Z_0)^\beta, \qquad\beta>0, τ ( v ) = τ ∗ dist ( v , Z 0 ) β , β > 0 ,
with τ ∗ > 0 \tau_*>0 τ ∗ > 0 chosen so that the effects are bounded by τ max \tau_{\max} τ m a x . These are two examples of τ [ n ] ∈ F n ( λ , γ ) \tau_{[n]} \in\mathcal{F}_n(\lambda,\gamma) τ [ n ] ∈ F n ( λ , γ ) . The class also includes other patterns satisfying Assumption 2.
Convergence in three settings
We study how treatment-effect strength and the shape of the zero-effect region affect convergence. We simulate data using the outcome model and complete randomization in § 6.1 . The randomization tests use the centred statistic in (14) , with α = 0.05 \alpha=0.05 α = 0.05 and M = 500 M=500 M = 500 shared draws. We search over all integer sizes and run 100 repetitions for each n ∈ { 500 , 1000 , 2000 , 4000 , 8000 , 16000 } n \in\{500,1000,2000,4000,8000,16000\} n ∈ { 500 , 1000 , 2000 , 4000 , 8000 , 16000 } . Let g i ℓ g_{i\ell} g i ℓ be the rank of unit i i i in coordinate ℓ \ell ℓ and write v i = ( g i 1 / n , … , g i d / n ) v_i=(g_{i1}/n,\ldots,g_{id}/n) v i = ( g i 1 / n , … , g i d / n ) . We consider the following three effect patterns: the first two in both one and two dimensions.
Constant effects outside a central region. Let m = ⌊ 0.10 n ⌋ m = \lfloor0.10n\rfloor m = ⌊ 0.10 n ⌋ and q = ⌊ ( n − m ) / 2 ⌋ q = \lfloor(n-m)/2\rfloor q = ⌊( n − m ) /2 ⌋ . Define the treatment effect of unit i i i by
τ i = 1 { i ∉ I 0 } . \tau_i = \mathbb{1}\{i \notin I_0\}. τ i = 1 { i ∈ / I 0 } .
In one dimension, I 0 = { i : q < g i 1 ≤ q + m } I_0 = \{i : q < g_{i1} \le q + m\} I 0 = { i : q < g i 1 ≤ q + m } is the central block of m m m units. In two dimensions, I 0 = N i 0 ( m ) I_0 = N_{i_0}^{(m)} I 0 = N i 0 ( m ) contains the m m m units nearest to unit i 0 i_0 i 0 , including i 0 i_0 i 0 itself, using Euclidean distance between normalized covariate ranks. The centre i 0 i_0 i 0 is chosen as in § 6.1 . Thus, effects are zero inside I 0 I_0 I 0 and one outside it.
Effects increasing from the boundary. Use the same region I 0 I_0 I 0 , but let effects grow linearly with distance to its nearest unit. Specifically, define
τ i = ρ i ρ max , ρ i : = min j ∈ I 0 ∥ v i − v j ∥ 2 , ρ max : = max i ∈ [ n ] ρ i . \tau_i = \frac{\rho_i}{\rho_{\max}}, \qquad\rho_i := \min_{j\in I_0}\lVert v_i-v_j\rVert_2, \qquad\rho_{\max} := \max_{i\in[n]} \rho_i. τ i = ρ m a x ρ i , ρ i := j ∈ I 0 min ∥ v i − v j ∥ 2 , ρ m a x := i ∈ [ n ] max ρ i .
Effects are zero on I 0 I_0 I 0 and reach one at the largest distance. In both central-region patterns, exactly m m m units are unaffected, so K 0 = m K_0 = m K 0 = m , with K 0 = L 0 K_0 = L_0 K 0 = L 0 in one dimension.
A zero-effect band. In two dimensions, the unaffected units are those with the lowest 20% of first-coordinate ranks, regardless of their second-coordinate ranks. Define the treatment effect of unit i i i as τ i = 1 { i ∉ I b a n d } \tau_i = \mathbb{1}\{i \notin I_{\mathrm{band}}\} τ i = 1 { i ∈ / I band } , where
I b a n d = { i : g i 1 ≤ ⌊ 0.20 n ⌋ } , I_{\mathrm{band}} = \{i : g_{i1} \le\lfloor0.20n\rfloor\}, I band = { i : g i 1 ≤ ⌊ 0.20 n ⌋} ,
ends_mid=1 We compute the size of the largest zero-effect neighbourhood as
K 0 = max { k ∈ [ n ] : ∃ i ∈ [ n ] , N i ( k ) ⊆ I b a n d } . K_0 = \max\{k \in[n] : \exists i \in[n],\ N_i^{(k)} \subseteq I_{\mathrm{band}}\}. K 0 = max { k ∈ [ n ] : ∃ i ∈ [ n ] , N i ( k ) ⊆ I band } .
The largest such neighbourhood need not contain the entire zero-effect band.
Results. For each repetition, we report the positive excess
( K ^ 0 U − K 0 ) + n , x + : = max { x , 0 } , \frac{(\widehat{K}_0^U-K_0)_+}{n}, \qquad x_+ := \max\{x,0\}, n ( K 0 U − K 0 ) + , x + := max { x , 0 } ,
where K ^ 0 U = L n , 0 U \widehat{K}_0^U = L_{n,0}^U K 0 U = L n , 0 U in one dimension. Taking the positive part prevents underestimation in some repetitions from offsetting overestimation in others.
Figure 9 shows that the mean excess decreases with sample size in all five settings. It decreases fastest for constant effects outside the central region and slowest when effects grow gradually from the boundary. For comparison with Theorem 2, the dotted lines have slopes − 1 / ( 2 γ ) -1/(2\gamma) − 1/ ( 2 γ ) , using γ = 1 \gamma=1 γ = 1 for constant effects, γ = 2 \gamma=2 γ = 2 for gradually increasing effects, and γ = 3 / 2 \gamma=3/2 γ = 3/2 for the band. The band value is motivated by the geometric calculation in Appendix § 11 . These are illustrative comparisons: the theorem bounds the excess with high probability, whereas the figure reports its mean.
Figure 9. Convergence under different treatment-effect patterns. Mean positive excess ( K ^ 0 U − K 0 ) + / n (\widehat{K}_0^U-K_0)_+/n ( K 0 U − K 0 ) + / n , with ± 2 \pm2 ± 2 standard errors over 100 repetitions, on logarithmic axes. Dotted lines show reference slopes − 1 / 2 -1/2 − 1/2 for constant effects outside the central region, − 1 / 4 -1/4 − 1/4 for effects that grow linearly with distance, and − 1 / 3 -1/3 − 1/3 for the strip.
Technical proofs
Validity
This subsection proves Proposition 1, Theorem 1, and Proposition 3. Throughout, condition on X [ n ] X_{[n]} X [ n ] , Y [ n ] ( 0 ) Y_{[n]}(0) Y [ n ] ( 0 ) , Y [ n ] ( 1 ) Y_{[n]}(1) Y [ n ] ( 1 ) and the known design. Candidate regions and their ordering are therefore fixed. All probabilities below use this conditioning; additional conditioning is displayed when needed. Fix M ≥ 1 M \ge1 M ≥ 1 and α ∈ [ 0 , 1 ] \alpha\in[0,1] α ∈ [ 0 , 1 ] .
Proof. 1. Local tests. Fix a region B B B whose local sharp null holds. Then
Y j ( z j ) = Y j ∗ : = Y j ( 0 ) = Y j ( 1 ) , j ∈ B , Y_j(z_j)=Y_j^*:=Y_j(0)=Y_j(1), \qquad j \in B, Y j ( z j ) = Y j ∗ := Y j ( 0 ) = Y j ( 1 ) , j ∈ B ,
so the centered statistic is the fixed function
t B ( z ) = ∑ j ∈ B ( z j − π ) ( Y j ∗ − Y ‾ B ∗ ) , Y ‾ B ∗ = 1 ∣ B ∣ ∑ j ∈ B Y j ∗ . t_B(z)=\sum_{j\in B}(z_j-\pi)(Y_j^*-\overline{Y}_B^*), \qquad\overline{Y}_B^*=\frac{1}{|B|}\sum_{j\in B}Y_j^*. t B ( z ) = j ∈ B ∑ ( z j − π ) ( Y j ∗ − Y B ∗ ) , Y B ∗ = ∣ B ∣ 1 j ∈ B ∑ Y j ∗ .
Let Z ( 0 ) = Z Z^{(0)}=Z Z ( 0 ) = Z and draw Z ( 1 ) , … , Z ( M ) Z^{(1)},\ldots,Z^{(M)} Z ( 1 ) , … , Z ( M ) independently from the same distribution as Z Z Z . The vector with entries V m : = t B ( Z ( m ) ) , m = 0 , … , M V_m:=t_B(Z^{(m)}),\ m=0,\ldots,M V m := t B ( Z ( m ) ) , m = 0 , … , M , is exchangeable. Let R m R_m R m be the rank of V m V_m V m among V 0 , … , V M V_0,\ldots,V_M V 0 , … , V M , ordered from largest to smallest, with tied values assigned the largest rank occupied by their group. Then
R m = ∑ ℓ = 0 M 1 { V ℓ ≥ V m } , p ~ B , M = R 0 M + 1 . R_m=\sum_{\ell=0}^{M}1\{V_\ell\ge V_m\},\qquad\widetilde p_{B,M}=\frac{R_0}{M+1}. R m = ℓ = 0 ∑ M 1 { V ℓ ≥ V m } , p B , M = M + 1 R 0 .
A value in position j j j , counting from largest to smallest, has rank at least j j j , because the first j j j values are all at least as large as it. Therefore, only the first a a a positions can have rank at most a a a , so
∑ m = 0 M 1 { R m ≤ a } ≤ a , a ∈ { 0 , … , M + 1 } . \sum_{m=0}^{M}1\{R_m\le a\}\le a,\qquad a\in\{0,\ldots,M+1\}. m = 0 ∑ M 1 { R m ≤ a } ≤ a , a ∈ { 0 , … , M + 1 } .
Exchangeability and a = ⌊ α ( M + 1 ) ⌋ a=\lfloor\alpha(M+1)\rfloor a = ⌊ α ( M + 1 )⌋ give
P { p ~ B , M ≤ α } = 1 M + 1 ∑ m = 0 M P { R m ≤ a } = 1 M + 1 E [ ∑ m = 0 M 1 { R m ≤ a } ] ≤ a M + 1 ≤ α . (38) \mathbb{P}\{\widetilde p_{B,M}\le\alpha\}=\frac{1}{M+1}\sum_{m=0}^{M}\mathbb{P}\{R_m\le a\}
=\frac{1}{M+1}\mathbb{E}\left[\sum_{m=0}^{M}1\{R_m\le a\}\right]\le\frac{a}{M+1}\le\alpha. \tag*{(38)} P { p B , M ≤ α } = M + 1 1 m = 0 ∑ M P { R m ≤ a } = M + 1 1 E [ m = 0 ∑ M 1 { R m ≤ a } ] ≤ M + 1 a ≤ α . (38)
This includes ties and uses no null hypothesis outside B B B . For exact randomization, list the distinct values of t B ( Z ) t_B(Z) t B ( Z ) as v 1 > ⋯ > v J v_1>\cdots>v_J v 1 > ⋯ > v J , with positive probabilities q 1 , … , q J q_1,\ldots,q_J q 1 , … , q J . If t B ( Z ) = v j t_B(Z)=v_j t B ( Z ) = v j , its upper-tail p p p -value is p B = ∑ ℓ ≤ j q ℓ p_B=\sum_{\ell\le j}q_\ell p B = ∑ ℓ ≤ j q ℓ . Thus
P { p B ≤ α } = ∑ j : ∑ ℓ ≤ j q ℓ ≤ α q j ≤ α . \mathbb{P}\{p_B\le\alpha\}=\sum_{j:\sum_{\ell\le j}q_\ell\le\alpha}q_j\le\alpha. P { p B ≤ α } = j : ∑ ℓ ≤ j q ℓ ≤ α ∑ q j ≤ α .
The inequality holds because the selected indices form an initial segment. Hence both exact and Monte Carlo local tests are valid.
Conditional tests with fitted adjustment
For Proposition 3, condition additionally on Z − B Z_{-B} Z − B . Under the local null,
Y j = { Y j ∗ , j ∈ B , Y j ( Z j ) , j ∉ B , ⟹ Y [ n ] and Y ^ [ n ] are fixed . Y_j=
\begin{cases}
Y_j^*, & j\in B,\\
Y_j(Z_j), & j\notin B,
\end{cases}
\quad\Longrightarrow\quad
Y_{[n]}\text{ and }\widehat{Y}_{[n]}\text{ are fixed}. Y j = { Y j ∗ , Y j ( Z j ) , j ∈ B , j ∈ / B , ⟹ Y [ n ] and Y [ n ] are fixed .
Here the fit uses only covariates and observed outcomes, with any independent fitting randomness held fixed. Therefore
z B ⟼ t B a d j ( z B ) : = ∑ j ∈ B ( z j − π ) ( Y j − Y ^ j ) z_B\longmapsto t_B^{\mathrm{adj}}(z_B):=\sum_{j\in B}(z_j-\pi)(Y_j-\widehat{Y}_j) z B ⟼ t B adj ( z B ) := j ∈ B ∑ ( z j − π ) ( Y j − Y j )
is a fixed function. The observed Z B Z_B Z B and simulated assignments are independent draws from the distribution Q D ( Z B ∣ Z − B ) Q_D(Z_B \mid Z_{-B}) Q D ( Z B ∣ Z − B ) . The rank calculation in part 1 now gives
P { p B , M c o n d ≤ α ∣ Z − B } ≤ α , P { p B , M c o n d ≤ α } = E [ P { p B , M c o n d ≤ α ∣ Z − B } ] ≤ α . \mathbb{P}\{p^{\mathrm{cond}}_{B,M} \le\alpha\mid Z_{-B}\} \le\alpha,\qquad\mathbb{P}\{p^{\mathrm{cond}}_{B,M} \le\alpha\} = \mathbb{E}\left[\mathbb{P}\{p^{\mathrm{cond}}_{B,M} \le\alpha\mid Z_{-B}\}\right] \le\alpha. P { p B , M cond ≤ α ∣ Z − B } ≤ α , P { p B , M cond ≤ α } = E [ P { p B , M cond ≤ α ∣ Z − B } ] ≤ α .
This proves the validity both conditional on Z − B Z_{-B} Z − B and after averaging over Z − B Z_{-B} Z − B . Under complete randomization, the conditional distribution Q D Q_D Q D is given by
K B = n 1 − ∑ j ∉ B Z j , Q D ( z B ∣ Z − B ) = ( ∣ B ∣ K B ) − 1 1 { ∑ j ∈ B z j = K B } . K_B = n_1-\sum_{j\notin B} Z_j,\qquad Q_D(z_B\mid Z_{-B}) = \binom{|B|}{K_B}^{-1}\mathbb{1}\left\{\sum_{j\in B}z_j=K_B\right\}. K B = n 1 − j ∈ / B ∑ Z j , Q D ( z B ∣ Z − B ) = ( K B ∣ B ∣ ) − 1 1 ⎩ ⎨ ⎧ j ∈ B ∑ z j = K B ⎭ ⎬ ⎫ .
3. Maximum p p p -values. Let R k \mathcal{R}_k R k be any nonempty finite family of candidate regions at size k k k on a finite grid K \mathcal{K} K , and let p B p_B p B be any valid local p p p -value. Define
P k : = max B ∈ R k p B , P_k := \max_{B\in\mathcal{R}_k} p_B, P k := B ∈ R k max p B ,
k 0 : = max ( { k ∈ K : ∃ B ∈ R k , H 0 , B holds } ∪ { 0 } ) , k_0 := \max\left(\{k\in\mathcal{K}:\exists B\in\mathcal{R}_k,\ H_{0,B}\text{ holds}\}\cup\{0\}\right), k 0 := max ( { k ∈ K : ∃ B ∈ R k , H 0 , B holds } ∪ { 0 } ) ,
k ^ U : = max ( { k ∈ K : P k > α } ∪ { 0 } ) . \widehat{k}^{\,U} := \max\left(\{k\in\mathcal{K}:P_k>\alpha\}\cup\{0\}\right). k U := max ( { k ∈ K : P k > α } ∪ { 0 } ) .
If the union null at size k k k is true, choose one true-null region B 0 ∈ R k B_0\in\mathcal{R}_k B 0 ∈ R k . Then
{ P k ≤ α } ⊆ { p B 0 ≤ α } ⟹ P { P k ≤ α } ≤ α . \{P_k\le\alpha\}\subseteq\{p_{B_0}\le\alpha\}\quad\Longrightarrow\quad\mathbb{P}\{P_k\le\alpha\}\le\alpha. { P k ≤ α } ⊆ { p B 0 ≤ α } ⟹ P { P k ≤ α } ≤ α .
When k 0 > 0 k_0>0 k 0 > 0 , apply this at the fixed true size k 0 k_0 k 0 :
{ k ^ U < k 0 } ⊆ { P k 0 ≤ α } ⊆ { p B 0 ≤ α } , P { k ^ U ≥ k 0 } ≥ 1 − α . (39) \{\widehat{k}^{\,U}<k_0\}\subseteq\{P_{k_0}\le\alpha\}\subseteq\{p_{B_0}\le\alpha\},\qquad\mathbb{P}\{\widehat{k}^{\,U}\ge k_0\}\ge1-\alpha. \tag*{(39)} { k U < k 0 } ⊆ { P k 0 ≤ α } ⊆ { p B 0 ≤ α } , P { k U ≥ k 0 } ≥ 1 − α . (39)
For k 0 = 0 k_0=0 k 0 = 0 , coverage is automatic. An empty grid also gives both quantities equal to zero. No independence across regions is needed. Equivalently, since
P k ↑ : = max s ∈ K : s ≥ k P s , P k ↑ > α ⟺ ∃ s ∈ K : s ≥ k , P s > α . P_k^{\uparrow}:=\max_{s\in\mathcal{K}:s\ge k}P_s,\qquad P_k^{\uparrow}>\alpha\Longleftrightarrow\exists s\in\mathcal{K}:s\ge k,\ P_s>\alpha. P k ↑ := s ∈ K : s ≥ k max P s , P k ↑ > α ⟺ ∃ s ∈ K : s ≥ k , P s > α .
Taking the largest k k k on either side returns k ^ U \widehat{k}^{\,U} k U . The choices
Table 1 (PDF p. 40).
(K = [ n ] \mathcal{K}=[n] K = [ n ] ) prove Proposition 1 and Theorem 1. The same argument covers the rectangular construction with R k = { B R : ∣ B R ∣ ≥ k } \mathcal{R}_k=\{B_R:|B_R|\ge k\} R k = { B R : ∣ B R ∣ ≥ k } and k 0 = L 0 , r e c t k_0=L_{0,\mathrm{rect}} k 0 = L 0 , rect .
Proof of Proposition 2
Proof. Recall that for each centre i i i , let j i ( 1 ) , … , j i ( n ) j_i(1),\ldots,j_i(n) j i ( 1 ) , … , j i ( n ) be the unit indices ordered by Euclidean distance between the normalized rank vectors, with the prescribed tie rule. In the following, we write Z ( 0 ) = Z Z^{(0)}=Z Z ( 0 ) = Z for the observed assignment.
Neighbour orderings. Ranking the n n n units in each of the d d d coordinates takes O ( d n log n ) O(dn\log n) O ( d n log n ) time. Computing all pairwise squared distances takes O ( d n 2 ) O(dn^2) O ( d n 2 ) time, and sorting the n n n distances at each of the n n n centres takes O ( n 2 log n ) O(n^2\log n) O ( n 2 log n ) time. The total preprocessing cost is therefore O ( d n 2 + n 2 log n ) O(dn^2+n^2\log n) O ( d n 2 + n 2 log n ) . We generate each simulated assignment by drawing a uniform random permutation and treating the first n 1 n_1 n 1 units. This takes O ( n ) O(n) O ( n ) time per assignment, or O ( M n ) O(Mn) O ( M n ) for all M M M assignments.
Full search. For m = 0 , … , M m=0,\ldots,M m = 0 , … , M , maintain
S i , k : = ∑ ℓ = 1 k Y j i ( ℓ ) , C i , k ( m ) : = ∑ ℓ = 1 k Z j i ( ℓ ) ( m ) , U i , k ( m ) : = ∑ ℓ = 1 k Z j i ( ℓ ) ( m ) Y j i ( ℓ ) . S_{i,k}:=\sum_{\ell=1}^{k}Y_{j_i(\ell)},\qquad C_{i,k}^{(m)}:=\sum_{\ell=1}^{k}Z_{j_i(\ell)}^{(m)},\qquad U_{i,k}^{(m)}:=\sum_{\ell=1}^{k}Z_{j_i(\ell)}^{(m)}Y_{j_i(\ell)}. S i , k := ℓ = 1 ∑ k Y j i ( ℓ ) , C i , k ( m ) := ℓ = 1 ∑ k Z j i ( ℓ ) ( m ) , U i , k ( m ) := ℓ = 1 ∑ k Z j i ( ℓ ) ( m ) Y j i ( ℓ ) .
Starting from zero, the updates and statistic are
S i , k = S i , k − 1 + Y j i ( k ) , C i , k ( m ) = C i , k − 1 ( m ) + Z j i ( k ) ( m ) , U i , k ( m ) = U i , k − 1 ( m ) + Z j i ( k ) ( m ) Y j i ( k ) , T i , k ( m ) = U i , k ( m ) − S i , k k C i , k ( m ) . \begin{aligned}
S_{i,k}&=S_{i,k-1}+Y_{j_i(k)},\\
C_{i,k}^{(m)}&=C_{i,k-1}^{(m)}+Z_{j_i(k)}^{(m)},\\
U_{i,k}^{(m)}&=U_{i,k-1}^{(m)}+Z_{j_i(k)}^{(m)}Y_{j_i(k)},\\
T_{i,k}^{(m)}&=U_{i,k}^{(m)}-\frac{S_{i,k}}{k}C_{i,k}^{(m)}.
\end{aligned} S i , k C i , k ( m ) U i , k ( m ) T i , k ( m ) = S i , k − 1 + Y j i ( k ) , = C i , k − 1 ( m ) + Z j i ( k ) ( m ) , = U i , k − 1 ( m ) + Z j i ( k ) ( m ) Y j i ( k ) , = U i , k ( m ) − k S i , k C i , k ( m ) .
Thus all M + 1 M+1 M + 1 statistics and the count ∑ m = 1 M 1 { T i , k ( m ) ≥ T i , k ( 0 ) } \sum_{m=1}^{M}\mathbb{1}\{T_{i,k}^{(m)}\ge T_{i,k}^{(0)}\} ∑ m = 1 M 1 { T i , k ( m ) ≥ T i , k ( 0 ) } cost O ( M ) O(M) O ( M ) per pair ( i , k ) (i,k) ( i , k ) . With n 2 n^2 n 2 pairs ( i , k ) (i,k) ( i , k ) , computing all observed and simulated statistics and the corresponding Monte Carlo p p p -values costs n 2 O ( M ) n^2O(M) n 2 O ( M ) . Generating the M M M simulated assignments costs O ( M n ) O(Mn) O ( M n ) . Taking the maximum p p p -value over the n n n centres at each of the n n n sizes adds n O ( n ) nO(n) n O ( n ) . The total cost is therefore
O ( M n ) + n 2 O ( M ) + n O ( n ) = O ( M n 2 ) . O(Mn)+n^2O(M)+nO(n)=O(Mn^2). O ( M n ) + n 2 O ( M ) + n O ( n ) = O ( M n 2 ) .
Descending search. At k = n k=n k = n , all neighbourhoods equal [ n ] [n] [ n ] . Initialize their sums:
S i , n = ∑ j Y j , C i , n ( m ) = ∑ j Z j ( m ) , U i , n ( m ) = ∑ j Z j ( m ) Y j . S_{i,n}=\sum_jY_j,\qquad C_{i,n}^{(m)}=\sum_jZ_j^{(m)},\qquad U_{i,n}^{(m)}=\sum_jZ_j^{(m)}Y_j. S i , n = j ∑ Y j , C i , n ( m ) = j ∑ Z j ( m ) , U i , n ( m ) = j ∑ Z j ( m ) Y j .
This costs O ( M n ) O(Mn) O ( M n ) , including copying the values to all centres.
After this, each decrease in size uses
S i , k − 1 = S i , k − Y j i ( k ) , C i , k − 1 ( m ) = C i , k ( m ) − Z j i ( k ) ( m ) , U i , k − 1 ( m ) = U i , k ( m ) − Z j i ( k ) ( m ) Y j i ( k ) . \begin{aligned}
S_{i,k-1}&=S_{i,k}-Y_{j_i(k)},\\
C_{i,k-1}^{(m)}&=C_{i,k}^{(m)}-Z_{j_i(k)}^{(m)},\\
U_{i,k-1}^{(m)}&=U_{i,k}^{(m)}-Z_{j_i(k)}^{(m)}Y_{j_i(k)}.
\end{aligned} S i , k − 1 C i , k − 1 ( m ) U i , k − 1 ( m ) = S i , k − Y j i ( k ) , = C i , k ( m ) − Z j i ( k ) ( m ) , = U i , k ( m ) − Z j i ( k ) ( m ) Y j i ( k ) .
Updating the statistics, counts, and maximum costs O ( M n ) O(Mn) O ( M n ) per size. For t ≥ 1 t \ge1 t ≥ 1 checked sizes, the total is O ( M n ) + t O ( M n ) = O ( M n t ) O(Mn) + tO(Mn) = O(Mnt) O ( M n ) + tO ( M n ) = O ( M n t ) . The first non-rejected size is the largest one because all larger sizes have already been rejected; if there is none, the bound is zero. Adding the preprocessing cost proves both claims. □ \square □
Proof of Theorem 2
Notation. For brevity, write Y = Y [ n ] Y = Y_{[n]} Y = Y [ n ] , Z = Z [ n ] Z = Z_{[n]} Z = Z [ n ] , and z = z [ n ] z = z_{[n]} z = z [ n ] . For each candidate neighbourhood B B B , use the shorthand
T B ( z ) : = T B ( O B ( z B ) ) = ∑ j ∈ B ( z j − π ) ( Y j − Y ˉ B ) , Y ˉ B : = 1 ∣ B ∣ ∑ j ∈ B Y j . T_B(z) := T_B(O_B(z_B)) = \sum_{j \in B}(z_j-\pi)(Y_j-\bar{Y}_B), \qquad\bar{Y}_B := \frac{1}{|B|}\sum_{j \in B}Y_j. T B ( z ) := T B ( O B ( z B )) = j ∈ B ∑ ( z j − π ) ( Y j − Y ˉ B ) , Y ˉ B := ∣ B ∣ 1 j ∈ B ∑ Y j .
The observed outcomes Y B Y_B Y B are held fixed when evaluating this function at different assignments. Thus, T B ( Z ) = T B ( O B ) T_B(Z)=T_B(O_B) T B ( Z ) = T B ( O B ) is the observed statistic, whereas T B ( Z ′ ) T_B(Z') T B ( Z ′ ) is the randomized statistic for an independent assignment Z ′ Z' Z ′ drawn from the same design. We write p B p_B p B and p ~ B \tilde{p}_B p ~ B for the corresponding exact and Monte Carlo p p p -values; when B = N i ( k ) B=N_i^{(k)} B = N i ( k ) , p ~ B \tilde{p}_B p ~ B is p ~ i , k \tilde{p}_{i,k} p ~ i , k from the main text.
Proof. We condition on X [ n ] X_{[n]} X [ n ] throughout, so the neighbourhoods, effects, and K 0 K_0 K 0 are fixed. Complete randomization gives π = n 1 / n ∈ [ π min , 1 − π min ] \pi=n_1/n \in[\pi_{\min},1-\pi_{\min}] π = n 1 / n ∈ [ π m i n , 1 − π m i n ] . Write
μ j = μ 0 ( X j ) , s Y = σ + μ max + τ max , L = log ( 32 n 3 / ζ ) , κ = π min ( 1 − π min ) . \mu_j=\mu_0(X_j), \qquad s_Y=\sigma+\mu_{\max}+\tau_{\max}, \qquad L=\log(32n^3/\zeta), \qquad\kappa=\pi_{\min}(1-\pi_{\min}). μ j = μ 0 ( X j ) , s Y = σ + μ m a x + τ m a x , L = log ( 32 n 3 / ζ ) , κ = π m i n ( 1 − π m i n ) .
Let N \mathcal{N} N be the family of distinct candidate neighbourhoods, with ∣ N ∣ ≤ n 2 |\mathcal{N}| \le n^2 ∣ N ∣ ≤ n 2 . We first control the observed and randomized statistics, then the Monte Carlo error, and finally the largest non-rejected size. We assumed that 0 ≤ τ j ≤ τ max 0 \le\tau_j \le\tau_{\max} 0 ≤ τ j ≤ τ m a x and
A i , k : = ∑ j ∈ N i ( k ) τ j ≥ n λ u k γ , u k = k − K 0 n > 0 , λ = λ τ c α β , γ = ν + β ≥ 1. A_{i,k}:=\sum_{j \in N_i^{(k)}}\tau_j \ge n\lambda u_k^\gamma, \qquad u_k=\frac{k-K_0}{n}>0, \qquad\lambda=\lambda_\tau c\alpha^\beta, \qquad\gamma=\nu+\beta\ge1. A i , k := j ∈ N i ( k ) ∑ τ j ≥ nλ u k γ , u k = n k − K 0 > 0 , λ = λ τ c α β , γ = ν + β ≥ 1.
For β > 0 \beta>0 β > 0 , this follows by multiplying the count c n u k ν cnu_k^\nu c n u k ν by the effect bound λ τ ( a u k ) β \lambda_\tau(au_k)^\beta λ τ ( a u k ) β . For β = 0 \beta=0 β = 0 , use the affected-unit count and the effect bound λ τ \lambda_\tau λ τ . If K 0 = n K_0=n K 0 = n , the theorem is immediate. Otherwise at least one effect is positive, so s Y > 0 s_Y>0 s Y > 0 .
Simultaneous concentration. Fix B ∈ N B \in\mathcal{N} B ∈ N , write k = ∣ B ∣ k=|B| k = ∣ B ∣ , and let ∣ a j ∣ ≤ A |a_j| \le A ∣ a j ∣ ≤ A . We derive a concentration bound using Hoeffding’s inequality and conditioning.
Let ξ 1 , … , ξ n \xi_1,\ldots,\xi_n ξ 1 , … , ξ n be independent Bernoulli( π ) (\pi) ( π ) variables, where π = n 1 / n \pi=n_1/n π = n 1 / n . Conditional on ∑ j = 1 n ξ j = n 1 \sum_{j=1}^n \xi_j=n_1 ∑ j = 1 n ξ j = n 1 , their joint distribution is exactly the complete-randomization distribution of Z [ n ] Z_{[n]} Z [ n ] . Each variable ( ξ j − π ) a j (\xi_j-\pi)a_j ( ξ j − π ) a j has mean zero and lies in an interval of length ∣ a j ∣ ≤ A |a_j| \le A ∣ a j ∣ ≤ A . Hence, for A > 0 A > 0 A > 0 , Hoeffding’s inequality gives
P { ∣ ∑ j ∈ B ( ξ j − π ) a j ∣ > t } ≤ 2 exp ( − 2 t 2 k A 2 ) , t > 0. \mathbb{P}\left\{\left|\sum_{j\in B}(\xi_j-\pi)a_j\right|>t\right\}\le2\exp\left(-\frac{2t^2}{kA^2}\right),\qquad t>0. P ⎩ ⎨ ⎧ j ∈ B ∑ ( ξ j − π ) a j > t ⎭ ⎬ ⎫ ≤ 2 exp ( − k A 2 2 t 2 ) , t > 0.
The count ∑ j = 1 n ξ j \sum_{j=1}^n \xi_j ∑ j = 1 n ξ j has a Binomial( n , π ) (n,\pi) ( n , π ) distribution. Then,
P { ∑ j = 1 n ξ j = n 1 } = ( n n 1 ) π n 1 ( 1 − π ) n − n 1 ≥ 1 n + 1 . \mathbb{P}\left\{\sum_{j=1}^n \xi_j=n_1\right\}=\binom{n}{n_1}\pi^{n_1}(1-\pi)^{n-n_1}\ge\frac{1}{n+1}. P { j = 1 ∑ n ξ j = n 1 } = ( n 1 n ) π n 1 ( 1 − π ) n − n 1 ≥ n + 1 1 .
The inequality follows because n 1 n_1 n 1 is a most probable count among the n + 1 n+1 n + 1 possible values. We use this simple lower bound to simplify the subsequent bound. Therefore,
P { ∣ ∑ j ∈ B ( Z j − π ) a j ∣ > t } = P { ∣ ∑ j ∈ B ( ξ j − π ) a j ∣ > t | ∑ j = 1 n ξ j = n 1 } ≤ P { ∣ ∑ j ∈ B ( ξ j − π ) a j ∣ > t } P { ∑ j = 1 n ξ j = n 1 } ≤ 2 ( n + 1 ) exp ( − 2 t 2 k A 2 ) . \begin{aligned}
\mathbb{P}\left\{\left|\sum_{j\in B}(Z_j-\pi)a_j\right|>t\right\}
&=\mathbb{P}\left\{\left|\sum_{j\in B}(\xi_j-\pi)a_j\right|>t\ \middle|\ \sum_{j=1}^n\xi_j=n_1\right\}\\
&\le\frac{\mathbb{P}\left\{\left|\sum_{j\in B}(\xi_j-\pi)a_j\right|>t\right\}}{\mathbb{P}\left\{\sum_{j=1}^n\xi_j=n_1\right\}}\\
&\le2(n+1)\exp\left(-\frac{2t^2}{kA^2}\right).
\end{aligned} P ⎩ ⎨ ⎧ j ∈ B ∑ ( Z j − π ) a j > t ⎭ ⎬ ⎫ = P ⎩ ⎨ ⎧ j ∈ B ∑ ( ξ j − π ) a j > t j = 1 ∑ n ξ j = n 1 ⎭ ⎬ ⎫ ≤ P { ∑ j = 1 n ξ j = n 1 } P { ∑ j ∈ B ( ξ j − π ) a j > t } ≤ 2 ( n + 1 ) exp ( − k A 2 2 t 2 ) .
Setting t = A k x / 2 t=A\sqrt{kx/2} t = A k x /2 yields
P { ∣ ∑ j ∈ B ( Z j − π ) a j ∣ > A k x 2 } ≤ 2 ( n + 1 ) e − x , x > 0. (40) \mathbb{P}\left\{\left|\sum_{j\in B}(Z_j-\pi)a_j\right|>A\sqrt{\frac{kx}{2}}\right\}\le2(n+1)e^{-x},\qquad x>0. \tag*{(40)} P ⎩ ⎨ ⎧ j ∈ B ∑ ( Z j − π ) a j > A 2 k x ⎭ ⎬ ⎫ ≤ 2 ( n + 1 ) e − x , x > 0. (40)
If A = 0 A=0 A = 0 , the sum is identically zero and the bound holds directly.
For a block B B B with k = ∣ B ∣ k=|B| k = ∣ B ∣ , define its average baseline mean by
μ ˉ B : = k − 1 ∑ j ∈ B μ j , \bar{\mu}_B:=k^{-1}\sum_{j\in B}\mu_j, μ ˉ B := k − 1 j ∈ B ∑ μ j ,
and its proportion of treated units by
Z ˉ B : = k − 1 ∑ j ∈ B Z j . \bar{Z}_B:=k^{-1}\sum_{j\in B}Z_j. Z ˉ B := k − 1 j ∈ B ∑ Z j .
Also define
A B : = ∑ j ∈ B τ j , D B : = ∑ j ∈ B ( Z j − π ) , E B : = ∑ j ∈ B ( Z j − π ) τ j . A_B:=\sum_{j\in B}\tau_j,\qquad D_B:=\sum_{j\in B}(Z_j-\pi),\qquad E_B:=\sum_{j\in B}(Z_j-\pi)\tau_j. A B := j ∈ B ∑ τ j , D B := j ∈ B ∑ ( Z j − π ) , E B := j ∈ B ∑ ( Z j − π ) τ j .
Here A B A_B A B is the total treatment effect within B B B , while D B D_B D B and E B E_B E B are the deviations of ∑ j ∈ B Z j \sum_{j\in B} Z_j ∑ j ∈ B Z j and ∑ j ∈ B Z j τ j \sum_{j\in B} Z_j\tau_j ∑ j ∈ B Z j τ j from their respective expectations.
A neighbourhood is rejected when its observed statistic is sufficiently large relative to its randomization distribution. A large total treatment effect contributes positively to the observed statistic, but random assignment can offset this contribution. We next control these random deviations simultaneously for all candidate neighbourhoods.
Apply (40) with x = L x=L x = L and a j = 1 a_j=1 a j = 1 , a j = τ j a_j=\tau_j a j = τ j , and a j = μ j − μ ˉ B a_j=\mu_j-\bar{\mu}_B a j = μ j − μ ˉ B , bounded respectively by 1 1 1 , τ max \tau_{\max} τ m a x , and 2 μ max 2\mu_{\max} 2 μ m a x in absolute value. For each choice and each neighbourhood, the resulting bound fails with probability at most 2 ( n + 1 ) e − L 2(n+1)e^{-L} 2 ( n + 1 ) e − L . A union bound over the three choices and at most n 2 n^2 n 2 candidate neighbourhoods shows that the following event has probability at least 1 − 6 n 2 ( n + 1 ) e − L 1-6n^2(n+1)e^{-L} 1 − 6 n 2 ( n + 1 ) e − L :
E 1 : = ⋂ B ∈ N { ∣ D B ∣ ≤ k L / 2 , ∣ E B ∣ ≤ τ max k L / 2 , ∣ ∑ j ∈ B ( Z j − π ) ( μ j − μ ˉ B ) ∣ ≤ 2 μ max k L / 2 } . \mathcal{E}_1 := \bigcap_{B\in\mathcal{N}}\left\{
\begin{aligned}
|D_B| &\le\sqrt{kL/2},\\
|E_B| &\le\tau_{\max}\sqrt{kL/2},\\
\left|\sum_{j\in B}(Z_j-\pi)(\mu_j-\bar{\mu}_B)\right| &\le2\mu_{\max}\sqrt{kL/2}
\end{aligned}
\right\}. E 1 := B ∈ N ⋂ ⎩ ⎨ ⎧ ∣ D B ∣ ∣ E B ∣ j ∈ B ∑ ( Z j − π ) ( μ j − μ ˉ B ) ≤ k L /2 , ≤ τ m a x k L /2 , ≤ 2 μ m a x k L /2 ⎭ ⎬ ⎫ .
Conditional on the assignment, independence and sub-Gaussianity of the errors give
E [ exp { t ∑ j ∈ B ( Z j − Z ˉ B ) ϵ j } | Z [ n ] ] ≤ exp { σ 2 t 2 2 ∑ j ∈ B ( Z j − Z ˉ B ) 2 } ≤ e σ 2 t 2 k / 2 . \mathbb{E}\left[\exp\left\{t\sum_{j\in B}(Z_j-\bar{Z}_B)\epsilon_j\right\}\middle|Z_{[n]}\right]
\le\exp\left\{\frac{\sigma^2t^2}{2}\sum_{j\in B}(Z_j-\bar{Z}_B)^2\right\}
\le e^{\sigma^2t^2k/2}. E exp ⎩ ⎨ ⎧ t j ∈ B ∑ ( Z j − Z ˉ B ) ϵ j ⎭ ⎬ ⎫ Z [ n ] ≤ exp ⎩ ⎨ ⎧ 2 σ 2 t 2 j ∈ B ∑ ( Z j − Z ˉ B ) 2 ⎭ ⎬ ⎫ ≤ e σ 2 t 2 k /2 .
By the sub-Gaussian tail bound and union bounds, the following events fail with probabilities at most 2 n 2 e − L 2n^2e^{-L} 2 n 2 e − L and 2 n e − L 2ne^{-L} 2 n e − L , respectively:
E 2 : = ⋂ B ∈ N { ∣ ∑ j ∈ B ( Z j − Z ˉ B ) ϵ j ∣ ≤ σ 2 k L } , \mathcal{E}_2 := \bigcap_{B\in\mathcal{N}}\left\{
\left|\sum_{j\in B}(Z_j-\bar{Z}_B)\epsilon_j\right|\le\sigma\sqrt{2kL}
\right\}, E 2 := B ∈ N ⋂ ⎩ ⎨ ⎧ j ∈ B ∑ ( Z j − Z ˉ B ) ϵ j ≤ σ 2 k L ⎭ ⎬ ⎫ ,
E 3 : = { max j ∈ [ n ] ∣ ϵ j ∣ ≤ σ 2 L } . \mathcal{E}_3 := \left\{\max_{j\in[n]}|\epsilon_j|\le\sigma\sqrt{2L}\right\}. E 3 := { j ∈ [ n ] max ∣ ϵ j ∣ ≤ σ 2 L } .
These statements also hold when σ = 0 \sigma=0 σ = 0 .
Here, E 1 \mathcal{E}_1 E 1 controls the deviations caused by treatment assignment, E 2 \mathcal{E}_2 E 2 controls the error contribution to each neighbourhood’s statistic, and E 3 \mathcal{E}_3 E 3 bounds every individual error. Let E : = E 1 ∩ E 2 ∩ E 3 \mathcal{E}:=\mathcal{E}_1\cap\mathcal{E}_2\cap\mathcal{E}_3 E := E 1 ∩ E 2 ∩ E 3 . By the union bound,
P ( E c ) = P ( E 1 c ∪ E 2 c ∪ E 3 c ) ≤ P ( E 1 c ) + P ( E 2 c ) + P ( E 3 c ) ≤ { 6 n 2 ( n + 1 ) + 2 n 2 + 2 n } e − L ≤ 16 n 3 e − L = ζ / 2. (41) \begin{aligned}
\mathbb{P}(\mathcal{E}^c)
&=\mathbb{P}(\mathcal{E}_1^c\cup\mathcal{E}_2^c\cup\mathcal{E}_3^c)\\
&\le\mathbb{P}(\mathcal{E}_1^c)+\mathbb{P}(\mathcal{E}_2^c)+\mathbb{P}(\mathcal{E}_3^c)\\
&\le\{6n^2(n+1)+2n^2+2n\}e^{-L}\\
&\le16n^3e^{-L}=\zeta/2. \tag*{(41)}
\end{aligned} P ( E c ) = P ( E 1 c ∪ E 2 c ∪ E 3 c ) ≤ P ( E 1 c ) + P ( E 2 c ) + P ( E 3 c ) ≤ { 6 n 2 ( n + 1 ) + 2 n 2 + 2 n } e − L ≤ 16 n 3 e − L = ζ /2. (41)
where the last line uses n ≥ 2 n\ge2 n ≥ 2 and L = log ( 32 n 3 / ζ ) L=\log(32n^3/\zeta) L = log ( 32 n 3 / ζ ) .
Exact randomization tests
For B ∈ N B \in\mathcal{N} B ∈ N , write Y ˉ B = k − 1 ∑ j ∈ B Y j \bar{Y}_B = k^{-1}\sum_{j\in B}Y_j Y ˉ B = k − 1 ∑ j ∈ B Y j and T B ( z ) = ∑ j ∈ B ( z j − π ) ( Y j − Y ˉ B ) T_B(z) = \sum_{j\in B}(z_j-\pi)(Y_j-\bar{Y}_B) T B ( z ) = ∑ j ∈ B ( z j − π ) ( Y j − Y ˉ B ) . Since Y j = μ j + Z j τ j + ϵ j Y_j=\mu_j+Z_j\tau_j+\epsilon_j Y j = μ j + Z j τ j + ϵ j ,
T B ( Z ) = ∑ j ∈ B ( Z j − π ) ( μ j − μ ˉ B ) + ∑ j ∈ B ( Z j − Z ˉ B ) ϵ j + ( 1 − Z ˉ B ) ∑ j ∈ B Z j τ j , T_B(Z)=\sum_{j\in B}(Z_j-\pi)(\mu_j-\bar{\mu}_B)+\sum_{j\in B}(Z_j-\bar{Z}_B)\epsilon_j+(1-\bar{Z}_B)\sum_{j\in B}Z_j\tau_j, T B ( Z ) = j ∈ B ∑ ( Z j − π ) ( μ j − μ ˉ B ) + j ∈ B ∑ ( Z j − Z ˉ B ) ϵ j + ( 1 − Z ˉ B ) j ∈ B ∑ Z j τ j ,
where
( 1 − Z ˉ B ) ∑ j ∈ B Z j τ j = π ( 1 − π ) A B + ( 1 − Z ˉ B ) E B − π A B k D B . (1-\bar{Z}_B)\sum_{j\in B}Z_j\tau_j=\pi(1-\pi)A_B+(1-\bar{Z}_B)E_B-\frac{\pi A_B}{k}D_B. ( 1 − Z ˉ B ) j ∈ B ∑ Z j τ j = π ( 1 − π ) A B + ( 1 − Z ˉ B ) E B − k π A B D B .
Using 0 ≤ Z ˉ B ≤ 1 0\leq\bar{Z}_B\leq1 0 ≤ Z ˉ B ≤ 1 , A B / k ≤ τ max A_B/k\leq\tau_{\max} A B / k ≤ τ m a x , and the bounds on E \mathcal{E} E , we obtain
T B ( Z ) ≥ κ A B − 2 s Y k L , B ∈ N . (42) T_B(Z)\geq\kappa A_B-\sqrt{2}\,s_Y\sqrt{kL},\qquad B\in\mathcal{N}. \tag*{(42)} T B ( Z ) ≥ κ A B − 2 s Y k L , B ∈ N . (42)
Let D = ( Y , Z ) \mathcal{D}=(Y,Z) D = ( Y , Z ) denote the observed outcomes and assignments. Conditional on D \mathcal{D} D , complete randomization gives Var ( Z j ′ ) = π ( 1 − π ) \operatorname{Var}(Z'_j)=\pi(1-\pi) Var ( Z j ′ ) = π ( 1 − π ) and Cov ( Z j ′ , Z ℓ ′ ) = − π ( 1 − π ) / ( n − 1 ) \operatorname{Cov}(Z'_j,Z'_\ell)=-\pi(1-\pi)/(n-1) Cov ( Z j ′ , Z ℓ ′ ) = − π ( 1 − π ) / ( n − 1 ) for j ≠ ℓ j\ne\ell j = ℓ . Since the centered coefficients sum to zero,
E { T B ( Z ′ ) ∣ D } = 0 , \mathbb{E}\{T_B(Z')\mid\mathcal{D}\}=0, E { T B ( Z ′ ) ∣ D } = 0 ,
Var { T B ( Z ′ ) ∣ D } = n π ( 1 − π ) n − 1 ∑ j ∈ B ( Y j − Y ˉ B ) 2 . (43) \operatorname{Var}\{T_B(Z')\mid\mathcal{D}\}=\frac{n\pi(1-\pi)}{n-1}\sum_{j\in B}(Y_j-\bar{Y}_B)^2. \tag*{(43)} Var { T B ( Z ′ ) ∣ D } = n − 1 nπ ( 1 − π ) j ∈ B ∑ ( Y j − Y ˉ B ) 2 . (43)
On E \mathcal{E} E , ∣ Y j ∣ ≤ 2 L s Y |Y_j|\leq\sqrt{2L}\,s_Y ∣ Y j ∣ ≤ 2 L s Y . Therefore
Var { T B ( Z ′ ) ∣ D } ≤ 1 2 ∑ j ∈ B Y j 2 ≤ s Y 2 k L . \operatorname{Var}\{T_B(Z')\mid\mathcal{D}\}\leq\frac{1}{2}\sum_{j\in B}Y_j^2\leq s_Y^2kL. Var { T B ( Z ′ ) ∣ D } ≤ 2 1 j ∈ B ∑ Y j 2 ≤ s Y 2 k L .
Set C 0 = ( 2 + 2 / α ) / κ C_0=(\sqrt{2}+2/\sqrt{\alpha})/\kappa C 0 = ( 2 + 2/ α ) / κ . Whenever
A B > C 0 s Y k L , (44) A_B>C_0s_Y\sqrt{kL}, \tag*{(44)} A B > C 0 s Y k L , (44)
the observed statistic T B ( Z ) T_B(Z) T B ( Z ) exceeds 2 s Y k L / α 2s_Y\sqrt{kL/\alpha} 2 s Y k L / α . Then by Chebyshev’s inequality and (43) , simultaneously on E \mathcal{E} E ,
p B : = P { T B ( Z ′ ) ≥ T B ( Z ) ∣ D } ≤ Var { T B ( Z ′ ) ∣ D } T B ( Z ) 2 < s Y 2 k L ( 2 s Y k L / α ) 2 = α 4 . p_B:=\mathbb{P}\{T_B(Z')\geq T_B(Z)\mid\mathcal{D}\}\leq\frac{\operatorname{Var}\{T_B(Z')\mid\mathcal{D}\}}{T_B(Z)^2}<\frac{s_Y^2kL}{\left(2s_Y\sqrt{kL/\alpha}\right)^2}=\frac{\alpha}{4}. p B := P { T B ( Z ′ ) ≥ T B ( Z ) ∣ D } ≤ T B ( Z ) 2 Var { T B ( Z ′ ) ∣ D } < ( 2 s Y k L / α ) 2 s Y 2 k L = 4 α .
Monte-Carlo tests
An explicit sufficient choice is
M ≥ 12 α log ( 2 n 2 ζ ) . (45) M\geq\frac{12}{\alpha}\log\left(\frac{2n^2}{\zeta}\right). \tag*{(45)} M ≥ α 12 log ( ζ 2 n 2 ) . (45)
For M M M independent randomized assignments, let C B C_B C B count the randomized statistics that are at least as large as T B ( Z ) T_B(Z) T B ( Z ) . Thus, conditional on D \mathcal{D} D , C B ∼ Binomial ( M , p B ) C_B \sim\operatorname{Binomial}(M,p_B) C B ∼ Binomial ( M , p B ) , and we can write the Monte-Carlo p p p -value as
p ~ B = ( 1 + C B ) / ( M + 1 ) . \widetilde{p}_B=(1+C_B)/(M+1). p B = ( 1 + C B ) / ( M + 1 ) .
Since M α ≥ 2 M\alpha\ge2 M α ≥ 2 ,
p ~ B > α ⟹ C B > α ( M + 1 ) − 1 ≥ M α / 2. \widetilde{p}_B>\alpha\quad\Longrightarrow\quad C_B>\alpha(M+1)-1\ge M\alpha/2. p B > α ⟹ C B > α ( M + 1 ) − 1 ≥ M α /2.
For p B ≤ α / 4 p_B\le\alpha/4 p B ≤ α /4 , a Chernoff bound with t = log 2 t=\log2 t = log 2 gives
P { p ~ B > α ∣ D } ≤ 2 − M α / 2 E ( 2 C B ∣ D ) = 2 − M α / 2 ( 1 + p B ) M = exp { − M α 2 log 2 } ( 1 + p B ) M ( 2 x = e x log 2 ) ≤ exp { − M α 2 log 2 + M p B } ( 1 + x ≤ e x ) ≤ exp { − M α 2 log 2 + M α 4 } ( p B ≤ α / 4 ) ≤ e − M α / 12 . \begin{aligned}
\mathbb{P}\{\widetilde{p}_B>\alpha\mid\mathcal{D}\}
&\le2^{-M\alpha/2}\mathbb{E}(2^{C_B}\mid\mathcal{D})\\
&=2^{-M\alpha/2}(1+p_B)^M\\
&=\exp\left\{-\frac{M\alpha}{2}\log2\right\}(1+p_B)^M
\qquad(2^x=e^{x\log2})\\
&\le\exp\left\{-\frac{M\alpha}{2}\log2+Mp_B\right\}
\qquad(1+x\le e^x)\\
&\le\exp\left\{-\frac{M\alpha}{2}\log2+\frac{M\alpha}{4}\right\}
\qquad(p_B\le\alpha/4)\\
&\le e^{-M\alpha/12}.
\end{aligned} P { p B > α ∣ D } ≤ 2 − M α /2 E ( 2 C B ∣ D ) = 2 − M α /2 ( 1 + p B ) M = exp { − 2 M α log 2 } ( 1 + p B ) M ( 2 x = e x l o g 2 ) ≤ exp { − 2 M α log 2 + M p B } ( 1 + x ≤ e x ) ≤ exp { − 2 M α log 2 + 4 M α } ( p B ≤ α /4 ) ≤ e − M α /12 .
With E \mathcal{E} E as defined above, let
E ∗ : = E ∩ ⋂ A B > C 0 s Y ∣ B ∣ L { p ~ B ≤ α } . \mathcal{E}_*:=\mathcal{E}\cap\bigcap_{A_B>C_0s_Y\sqrt{|B|L}}\{\widetilde{p}_B\le\alpha\}. E ∗ := E ∩ A B > C 0 s Y ∣ B ∣ L ⋂ { p B ≤ α } .
Thus, E ∗ \mathcal{E}_* E ∗ is the event that all concentration bounds defining E \mathcal{E} E hold and every neighbourhood satisfying (44) is rejected. On E \mathcal{E} E , the preceding Monte Carlo bound applies to each such neighbourhood. Combining (41) with a union bound over at most n 2 n^2 n 2 neighbourhoods gives
P ( E ∗ ) ≥ 1 − ζ / 2 − n 2 e − M α / 12 ≥ 1 − ζ . \mathbb{P}(\mathcal{E}_*)\ge1-\zeta/2-n^2e^{-M\alpha/12}\ge1-\zeta. P ( E ∗ ) ≥ 1 − ζ /2 − n 2 e − M α /12 ≥ 1 − ζ .
The excess-size bound
For u = ( k − K 0 ) / n > 0 u=(k-K_0)/n>0 u = ( k − K 0 ) / n > 0 , the geometry bound gives
A i , k s Y k L ≥ λ n s Y L u γ K 0 / n + u . (46) \frac{A_{i,k}}{s_Y\sqrt{kL}}\ge\frac{\lambda\sqrt{n}}{s_Y\sqrt{L}}\frac{u^\gamma}{\sqrt{K_0/n+u}}. \tag*{(46)} s Y k L A i , k ≥ s Y L λ n K 0 / n + u u γ . (46)
Define
u ∗ : = max { ( 4 C 0 2 s Y 2 K 0 L λ 2 n 2 ) 1 / ( 2 γ ) , ( 4 C 0 2 s Y 2 L λ 2 n ) 1 / ( 2 γ − 1 ) } > 0. u_*:=\max\left\{\left(\frac{4C_0^2s_Y^2K_0L}{\lambda^2n^2}\right)^{1/(2\gamma)},\left(\frac{4C_0^2s_Y^2L}{\lambda^2n}\right)^{1/(2\gamma-1)}\right\}>0. u ∗ := max { ( λ 2 n 2 4 C 0 2 s Y 2 K 0 L ) 1/ ( 2 γ ) , ( λ 2 n 4 C 0 2 s Y 2 L ) 1/ ( 2 γ − 1 ) } > 0.
Then
u ∗ 2 γ ≥ 4 C 0 2 s Y 2 L λ 2 n K 0 n , u ∗ 2 γ ≥ 4 C 0 2 s Y 2 L λ 2 n u ∗ . (47) u_*^{2\gamma} \ge\frac{4C_0^2s_Y^2L}{\lambda^2 n}\frac{K_0}{n}, \qquad u_*^{2\gamma} \ge\frac{4C_0^2s_Y^2L}{\lambda^2 n}u_*. \tag*{(47)} u ∗ 2 γ ≥ λ 2 n 4 C 0 2 s Y 2 L n K 0 , u ∗ 2 γ ≥ λ 2 n 4 C 0 2 s Y 2 L u ∗ . (47)
Adding the two inequalities in (47) , dividing by two, and then taking square roots and rearranging gives
λ n s Y L u ∗ γ K 0 / n + u ∗ ≥ 2 C 0 > C 0 . (48) \frac{\lambda\sqrt{n}}{s_Y\sqrt{L}}\frac{u_*^\gamma}{\sqrt{K_0/n+u_*}} \ge\sqrt{2}C_0 > C_0. \tag*{(48)} s Y L λ n K 0 / n + u ∗ u ∗ γ ≥ 2 C 0 > C 0 . (48)
Moreover,
d d u log ( u γ K 0 / n + u ) = 2 γ K 0 / n + ( 2 γ − 1 ) u 2 u ( K 0 / n + u ) > 0. \frac{d}{du}\log\left(\frac{u^\gamma}{\sqrt{K_0/n+u}}\right)=\frac{2\gamma K_0/n+(2\gamma-1)u}{2u(K_0/n+u)}>0. d u d log ( K 0 / n + u u γ ) = 2 u ( K 0 / n + u ) 2 γ K 0 / n + ( 2 γ − 1 ) u > 0.
The positive derivative shows that u γ / K 0 / n + u u^\gamma/\sqrt{K_0/n+u} u γ / K 0 / n + u is increasing for u > 0 u>0 u > 0 . Therefore, whenever u = ( k − K 0 ) / n ≥ u ∗ u=(k-K_0)/n\ge u_* u = ( k − K 0 ) / n ≥ u ∗ , the bounds in (46) and (48) gives, for every centre i i i ,
A i , k s Y k L ≥ λ n s Y L u ∗ γ K 0 / n + u ∗ ≥ 2 C 0 > C 0 . \frac{A_{i,k}}{s_Y\sqrt{kL}}\ge\frac{\lambda\sqrt{n}}{s_Y\sqrt{L}}\frac{u_*^\gamma}{\sqrt{K_0/n+u_*}}\ge\sqrt{2}C_0>C_0. s Y k L A i , k ≥ s Y L λ n K 0 / n + u ∗ u ∗ γ ≥ 2 C 0 > C 0 .
Thus A i , k > C 0 s Y k L A_{i,k}>C_0s_Y\sqrt{kL} A i , k > C 0 s Y k L , which is the condition in (44) for the neighbourhood N i ( k ) N_i^{(k)} N i ( k ) .
Put h ∗ = ⌈ n u ∗ ⌉ h_*=\lceil nu_*\rceil h ∗ = ⌈ n u ∗ ⌉ . For every k ∈ [ n ] k\in[n] k ∈ [ n ] with k ≥ K 0 + h ∗ k\ge K_0+h_* k ≥ K 0 + h ∗ ,
k − K 0 n ≥ h ∗ n ≥ u ∗ . \frac{k-K_0}{n}\ge\frac{h_*}{n}\ge u_*. n k − K 0 ≥ n h ∗ ≥ u ∗ .
Every neighbourhood at such a size therefore satisfies (44) . By the definition of E ∗ \mathcal{E}_* E ∗ , all these neighbourhoods are rejected on E ∗ \mathcal{E}_* E ∗ , giving
p ~ k = max i ∈ [ n ] p ~ i , k ≤ α . \widetilde{p}_k=\max_{i\in[n]}\widetilde{p}_{i,k}\le\alpha. p k = i ∈ [ n ] max p i , k ≤ α .
If K 0 + h ∗ ≤ n K_0+h_*\le n K 0 + h ∗ ≤ n , the largest non-rejected size therefore satisfies K ^ 0 U ≤ K 0 + h ∗ − 1 \widehat{K}_0^U\le K_0+h_*-1 K 0 U ≤ K 0 + h ∗ − 1 . If K 0 + h ∗ > n K_0+h_*>n K 0 + h ∗ > n , the same inequality follows from K ^ 0 U ≤ n ≤ K 0 + h ∗ − 1 \widehat{K}_0^U\le n\le K_0+h_*-1 K 0 U ≤ n ≤ K 0 + h ∗ − 1 , since K 0 + h ∗ K_0+h_* K 0 + h ∗ and n n n are integers. Thus, in both cases, on E ∗ \mathcal{E}_* E ∗ ,
K ^ 0 U − K 0 n ≤ h ∗ − 1 n < u ∗ , \frac{\widehat{K}_0^U-K_0}{n}\le\frac{h_*-1}{n}<u_*, n K 0 U − K 0 ≤ n h ∗ − 1 < u ∗ ,
by h ∗ − 1 < n u ∗ h_*-1<nu_* h ∗ − 1 < n u ∗ . By the definition of u ∗ u_* u ∗ , since γ ≥ 1 \gamma\ge1 γ ≥ 1 and 4 C 0 2 > 1 4C_0^2>1 4 C 0 2 > 1 ,
u ∗ ≤ 4 C 0 2 { ( s Y 2 K 0 L λ 2 n 2 ) 1 / ( 2 γ ) + ( s Y 2 L λ 2 n ) 1 / ( 2 γ − 1 ) } . u_*\le4C_0^2\left\{\left(\frac{s_Y^2K_0L}{\lambda^2n^2}\right)^{1/(2\gamma)}+\left(\frac{s_Y^2L}{\lambda^2n}\right)^{1/(2\gamma-1)}\right\}. u ∗ ≤ 4 C 0 2 { ( λ 2 n 2 s Y 2 K 0 L ) 1/ ( 2 γ ) + ( λ 2 n s Y 2 L ) 1/ ( 2 γ − 1 ) } .
This proves (33) , with an implicit constant depending only on π min \pi_{\min} π m i n and α \alpha α . The probability includes the errors and the observed and simulated assignments.
For the simplified asymptotic rate, hold ζ \zeta ζ , s Y / λ s_Y/\lambda s Y / λ , and γ \gamma γ fixed. Then L = O ( log n ) L=O(\log n) L = O ( log n ) and K 0 ≤ n K_0\le n K 0 ≤ n , so the first term is O { ( log n / n ) 1 / ( 2 γ ) } O\{(\log n/n)^{1/(2\gamma)}\} O {( log n / n ) 1/ ( 2 γ ) } . The other terms are of no larger order because γ ≥ 1 \gamma\ge1 γ ≥ 1 . Substituting γ = ν + β \gamma=\nu+\beta γ = ν + β gives the final display.
Proof of Theorem 3
Setup. Fix d ≥ 1 d \ge1 d ≥ 1 , σ > 0 \sigma> 0 σ > 0 , γ ≥ 1 \gamma\ge1 γ ≥ 1 , and 0 < λ ≤ τ max / ( 16 γ ) 0 < \lambda\le\tau_{\max}/(16\gamma) 0 < λ ≤ τ m a x / ( 16 γ ) . For this lower-bound argument, use the normalized ranks v j v_j v j as the fixed covariates
W j = v j = ( j / n , … , j / n ) , j ∈ [ n ] , W_j = v_j = (j/n,\ldots,j/n), \qquad j \in[n], W j = v j = ( j / n , … , j / n ) , j ∈ [ n ] ,
and the Gaussian outcome model
Y j ( 0 ) = ϵ j , Y j ( 1 ) = ϵ j + τ j , ϵ j ∼ i . i . d . N ( 0 , σ 2 ) . Y_j(0) = \epsilon_j, \qquad Y_j(1) = \epsilon_j + \tau_j, \qquad\epsilon_j \mathrel{\overset{\mathrm{i.i.d.}}{\sim}} N(0,\sigma^2). Y j ( 0 ) = ϵ j , Y j ( 1 ) = ϵ j + τ j , ϵ j ∼ i.i.d. N ( 0 , σ 2 ) .
This is a special case of Assumption 1, used only to prove the lower bound.
Treatment follows the same complete-randomization distribution under every model and is independent of the errors. Write P τ \mathbb{P}_{\tau} P τ for the law of the observed data, with Y j = Z j τ j + ϵ j Y_j = Z_j\tau_j + \epsilon_j Y j = Z j τ j + ϵ j , and any auxiliary randomization used to compute U U U . The conditional law of this auxiliary randomization given the data does not depend on τ \tau τ . All probabilities condition on the fixed covariates.
Since ∥ v i − v j ∥ 2 = d ∣ i − j ∣ / n \lVert v_i-v_j\rVert_2 = \sqrt{d}\lvert i-j\rvert/n ∥ v i − v j ∥ 2 = d ∣ i − j ∣ / n , each nearest-neighbour set is a contiguous block. Conversely, with distance ties broken in favour of the smaller rank,
{ s , … , s + k − 1 } = N s + ⌊ k / 2 ⌋ ( k ) , 1 ≤ s ≤ n − k + 1. \{s,\ldots,s+k-1\} = N_{s+\lfloor k/2\rfloor}^{(k)}, \qquad1 \le s \le n-k+1. { s , … , s + k − 1 } = N s + ⌊ k /2 ⌋ ( k ) , 1 ≤ s ≤ n − k + 1.
Thus the candidate family consists of all contiguous blocks, and K 0 ( τ ) K_0(\tau) K 0 ( τ ) is the longest run of zero entries in τ \tau τ .
For this design, F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) contains all τ ∈ [ 0 , τ max ] n \tau\in[0,\tau_{\max}]^n τ ∈ [ 0 , τ m a x ] n satisfying Assumption 2 for some nonempty closed zero-effect set and parameters with λ τ c α β = λ \lambda_{\tau}c\alpha^\beta= \lambda λ τ c α β = λ and ν + β = γ \nu+\beta=\gamma ν + β = γ .
Our construction uses β = 0 \beta=0 β = 0 and ν = γ \nu=\gamma ν = γ . In this case, the assumption requires a nonempty closed set Z 0 ⊆ [ 0 , 1 ] d \mathcal{Z}_0 \subseteq[0,1]^d Z 0 ⊆ [ 0 , 1 ] d and constants λ τ , c > 0 \lambda_{\tau},c>0 λ τ , c > 0 with λ τ c = λ \lambda_{\tau}c=\lambda λ τ c = λ such that
{ τ j = 0 , v j ∈ Z 0 , j ∈ [ n ] , λ τ ≤ τ j ≤ τ max , v j ∉ Z 0 , \begin{cases}
\tau_j = 0, & v_j \in\mathcal{Z}_0,\quad j \in[n],\\
\lambda_{\tau} \le\tau_j \le\tau_{\max}, & v_j \notin\mathcal{Z}_0,
\end{cases} { τ j = 0 , λ τ ≤ τ j ≤ τ m a x , v j ∈ Z 0 , j ∈ [ n ] , v j ∈ / Z 0 ,
and, for every contiguous block I I I with ∣ I ∣ > K 0 \lvert I\rvert>K_0 ∣ I ∣ > K 0 ,
# { j ∈ I : τ j > 0 } ≥ c n ( ∣ I ∣ − K 0 n ) γ . \#\{j \in I:\tau_j>0\} \ge cn\left(\frac{\lvert I\rvert-K_0}{n}\right)^\gamma. # { j ∈ I : τ j > 0 } ≥ c n ( n ∣ I ∣ − K 0 ) γ .
We verify a lower bound on each positive effect and on the number of affected units in every block larger than K 0 K_0 K 0 . No condition on their distances from Z 0 \mathcal{Z}_0 Z 0 is required.
Proof. Roadmap. Let U U U satisfy the coverage condition in the theorem. We first construct a reference model and alternatives whose targets differ by h h h , then verify that they belong to F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) . We next show that a mixture of the alternative distributions is close to the reference distribution. Coverage under the reference model then forces U − K 0 ≥ h U-K_0 \ge h U − K 0 ≥ h with probability greater than ζ \zeta ζ under at least one alternative.
Construction of the models
Write Δ : = τ max \Delta:= \tau_{\max} Δ := τ m a x and c γ : = 1 / ( 16 γ ) c_\gamma:= 1/(16\gamma) c γ := 1/ ( 16 γ ) . Let m = ⌊ n / 4 ⌋ m = \lfloor n/4\rfloor m = ⌊ n /4 ⌋ and choose an integer 1 ≤ h ≤ m / 2 1 \le h \le m/2 1 ≤ h ≤ m /2 ; we specify h h h in part 4. We construct a reference model with K 0 = m + h K_0 = m+h K 0 = m + h and alternatives with K 0 = m K_0 = m K 0 = m . Define the blocks
A : = { 1 , … , m } , D : = { m + 1 , … , 2 m } , B : = { 2 m + 1 , … , 3 m + h } . A := \{1,\ldots,m\}, \qquad D := \{m+1,\ldots,2m\}, \qquad B := \{2m+1,\ldots,3m+h\}. A := { 1 , … , m } , D := { m + 1 , … , 2 m } , B := { 2 m + 1 , … , 3 m + h } .
Use the superscript ( 0 ) (0) ( 0 ) to label the reference model. Its treatment-effect vector and data distribution are
τ j ( 0 ) : = Δ 1 { j ∉ A ∪ B } , P 0 : = P τ ( 0 ) . \tau_j^{(0)} := \Delta1\{j \notin A\cup B\}, \qquad\mathbb{P}_0 := \mathbb{P}_{\tau^{(0)}}. τ j ( 0 ) := Δ1 { j ∈ / A ∪ B } , P 0 := P τ ( 0 ) .
Thus, units in A ∪ B A\cup B A ∪ B have zero effects, and all other units have effect Δ \Delta Δ . The zero-effect blocks A A A and B B B have lengths m m m and m + h m+h m + h , separated by the affected block D D D . Hence K 0 ( τ ( 0 ) ) = m + h K_0(\tau^{(0)}) = m+h K 0 ( τ ( 0 ) ) = m + h .
We obtain alternatives by adding positive effects inside B B B . To ensure that its remaining zero-effect blocks have length at most m m m , choose the added units from
J : = { 2 m + h + 1 , … , 3 m } , ℓ : = ∣ J ∣ = m − h , J := \{2m+h+1,\ldots,3m\}, \qquad\ell:= |J| = m-h, J := { 2 m + h + 1 , … , 3 m } , ℓ := ∣ J ∣ = m − h ,
and let their number be
s : = ⌈ c γ n ( h / n ) γ ⌉ . s := \lceil c_\gamma n(h/n)^\gamma\rceil. s := ⌈ c γ n ( h / n ) γ ⌉ .
Since γ ≥ 1 \gamma\ge1 γ ≥ 1 and h ≤ m / 2 h \le m/2 h ≤ m /2 ,
0 < c γ n ( h / n ) γ = c γ h ( h / n ) γ − 1 ≤ h , 1 ≤ s ≤ h ≤ ℓ . 0 < c_\gamma n(h/n)^\gamma= c_\gamma h(h/n)^{\gamma-1} \le h, \qquad1 \le s \le h \le\ell. 0 < c γ n ( h / n ) γ = c γ h ( h / n ) γ − 1 ≤ h , 1 ≤ s ≤ h ≤ ℓ .
Each alternative is indexed by a subset S ⊆ J S\subseteq J S ⊆ J with ∣ S ∣ = s |S|=s ∣ S ∣ = s . The set S S S identifies the units whose effects we change from zero to Δ \Delta Δ ; all other effects remain as in the reference model. Write τ ( S ) \tau^{(S)} τ ( S ) for the resulting treatment-effect vector and P S \mathbb{P}_S P S for its data distribution:
τ j ( S ) : = τ j ( 0 ) + Δ 1 { j ∈ S } , P S : = P τ ( S ) . \tau_j^{(S)} := \tau_j^{(0)} + \Delta1\{j\in S\}, \qquad\mathbb{P}_S := \mathbb{P}_{\tau^{(S)}}. τ j ( S ) := τ j ( 0 ) + Δ1 { j ∈ S } , P S := P τ ( S ) .
Every subinterval of B B B with more than m m m units starts at or before 2 m + h 2m+h 2 m + h and ends at or after 3 m + 1 3m+1 3 m + 1 . It therefore contains J J J , and hence all the affected units in S S S . No zero-effect block can cross D D D or the affected units outside A ∪ B A\cup B A ∪ B . Since A A A remains unaffected,
K 0 ( τ ( S ) ) = m , K 0 ( τ ( 0 ) ) − K 0 ( τ ( S ) ) = h . (49) K_0(\tau^{(S)}) = m, \qquad K_0(\tau^{(0)}) - K_0(\tau^{(S)}) = h. \tag*{(49)} K 0 ( τ ( S ) ) = m , K 0 ( τ ( 0 ) ) − K 0 ( τ ( S ) ) = h . (49)
Verification of the assumptions
All positive effects equal Δ \Delta Δ . We now check that every block larger than K 0 K_0 K 0 contains enough affected units. For a block I I I , let n + ( I ) : = # { j ∈ I : τ j > 0 } n_+(I) := \#\{j\in I:\tau_j>0\} n + ( I ) := # { j ∈ I : τ j > 0 } under the model being considered, and define
F ( t ) : = c γ n ( t / n ) γ , 0 ≤ t ≤ n . F(t) := c_\gamma n(t/n)^\gamma, \qquad0\le t\le n. F ( t ) := c γ n ( t / n ) γ , 0 ≤ t ≤ n .
For 0 < t ≤ n 0 < t \le n 0 < t ≤ n , we have
0 ≤ F ( t ) ≤ c γ t ≤ t , 0 ≤ F ′ ( t ) = c γ γ ( t / n ) γ − 1 ≤ 1 / 16. 0 \le F(t) \le c_\gamma t \le t,\qquad0 \le F'(t) = c_\gamma\gamma(t/n)^{\gamma-1} \le1/16. 0 ≤ F ( t ) ≤ c γ t ≤ t , 0 ≤ F ′ ( t ) = c γ γ ( t / n ) γ − 1 ≤ 1/16.
We will show that every constructed model satisfies
n + ( I ) ≥ F ( ∣ I ∣ − K 0 ) = c γ n ( ∣ I ∣ − K 0 n ) γ whenever ∣ I ∣ > K 0 . (50) n_+(I) \ge F(|I|-K_0) = c_\gamma n \left(\frac{|I|-K_0}{n}\right)^\gamma\qquad\text{whenever } |I| > K_0. \tag*{(50)} n + ( I ) ≥ F ( ∣ I ∣ − K 0 ) = c γ n ( n ∣ I ∣ − K 0 ) γ whenever ∣ I ∣ > K 0 . (50)
First consider an alternative τ ( S ) \tau^{(S)} τ ( S ) . For a block I I I of length k > m k > m k > m , put t = k − m t = k-m t = k − m . There are three cases. If I I I meets both A A A and B B B , it contains all of D D D , so for n ≥ 8 n \ge8 n ≥ 8 ,
n + ( I ) ≥ m = ⌊ n / 4 ⌋ ≥ n / 8 ≥ c γ n ≥ F ( t ) . n_+(I) \ge m = \lfloor n/4\rfloor\ge n/8 \ge c_\gamma n \ge F(t). n + ( I ) ≥ m = ⌊ n /4 ⌋ ≥ n /8 ≥ c γ n ≥ F ( t ) .
If I I I meets at most one of A , B A,B A , B and ∣ I ∩ B ∣ ≤ m |I \cap B| \le m ∣ I ∩ B ∣ ≤ m , it contains at most m m m unaffected units, giving
n + ( I ) ≥ k − m = t ≥ F ( t ) . n_+(I) \ge k-m = t \ge F(t). n + ( I ) ≥ k − m = t ≥ F ( t ) .
In the remaining case, I I I meets B B B but not A A A and ∣ I ∩ B ∣ > m |I \cap B| > m ∣ I ∩ B ∣ > m . Part 1 shows that I ∩ B I \cap B I ∩ B contains J J J , so I I I contains all s s s affected units in S S S . Every unit of I I I outside B B B is also affected. Writing x + : = max { x , 0 } x_+ := \max\{x,0\} x + := max { x , 0 } , we obtain
n + ( I ) ≥ s + { k − ( m + h ) } + ≥ F ( h ) + ( t − h ) + ≥ F ( t ) . n_+(I) \ge s + \{k-(m+h)\}_+ \ge F(h) + (t-h)_+ \ge F(t). n + ( I ) ≥ s + { k − ( m + h ) } + ≥ F ( h ) + ( t − h ) + ≥ F ( t ) .
For t ≤ h t \le h t ≤ h , the last inequality follows from F ( h ) ≥ F ( t ) F(h) \ge F(t) F ( h ) ≥ F ( t ) . For t > h t > h t > h , it follows from
F ( t ) − F ( h ) = ∫ h t F ′ ( u ) d u ≤ t − h . F(t)-F(h) = \int_h^t F'(u)\,\mathrm{d}u \le t-h. F ( t ) − F ( h ) = ∫ h t F ′ ( u ) d u ≤ t − h .
This proves (50) for every alternative.
For the reference model, take k > m + h k > m+h k > m + h and set t = k − ( m + h ) t = k-(m+h) t = k − ( m + h ) . If I I I meets at most one of A , B A,B A , B , it contains at most m + h m+h m + h unaffected units, so n + ( I ) ≥ t ≥ F ( t ) n_+(I) \ge t \ge F(t) n + ( I ) ≥ t ≥ F ( t ) . If it meets both, it contains D D D and n + ( I ) ≥ m ≥ F ( t ) n_+(I) \ge m \ge F(t) n + ( I ) ≥ m ≥ F ( t ) as above. Thus (50) also holds for the reference model.
For each constructed vector τ \tau τ , choose
Z 0 : = { v j : τ j = 0 } , λ τ = Δ , a = 1 , c = λ / Δ , β = 0 , ν = γ . \mathcal{Z}_0 := \{v_j:\tau_j=0\},\qquad\lambda_\tau= \Delta,\qquad a=1,\qquad c=\lambda/\Delta,\qquad\beta=0,\qquad\nu=\gamma. Z 0 := { v j : τ j = 0 } , λ τ = Δ , a = 1 , c = λ /Δ , β = 0 , ν = γ .
The set Z 0 \mathcal{Z}_0 Z 0 is nonempty and finite, hence closed, and contains exactly the sampled zero-effect points. Every positive effect equals Δ = λ τ \Delta=\lambda_\tau Δ = λ τ , and
c = λ / Δ ≤ c γ , λ τ c a β = λ , ν + β = γ . c = \lambda/\Delta\le c_\gamma,\qquad\lambda_\tau c a^\beta= \lambda,\qquad\nu+\beta=\gamma. c = λ /Δ ≤ c γ , λ τ c a β = λ , ν + β = γ .
Consequently, (50) implies the required count bound with constant c c c . These parameters do not depend on n n n , and
τ ( 0 ) , τ ( S ) ∈ F n ( λ , γ ) for every S . (51) \tau^{(0)},\tau^{(S)} \in\mathcal{F}_n(\lambda,\gamma)\qquad\text{for every }S. \tag*{(51)} τ ( 0 ) , τ ( S ) ∈ F n ( λ , γ ) for every S . (51)
Distance between the distributions
Choose S S S uniformly from the ( ℓ s ) \binom{\ell}{s} ( s ℓ ) subsets of J J J containing exactly s s s units, and then generate the data under the corresponding alternative model P S \mathbb{P}_S P S . Denote the resulting distribution by P ‾ \overline{\mathbb{P}} P . Thus, for any measurable event E E E ,
P ‾ ( E ) : = 1 ( ℓ s ) ∑ S ⊂ J ∣ S ∣ = s P S ( E ) . \overline{\mathbb{P}}(E) := \frac{1}{\binom{\ell}{s}} \sum_{\substack{S\subset J\\ |S|=s}} \mathbb{P}_S(E). P ( E ) := ( s ℓ ) 1 S ⊂ J ∣ S ∣ = s ∑ P S ( E ) .
We compare this mixture with the reference distribution P 0 \mathbb{P}_0 P 0 . For probability laws P , Q P,Q P , Q , their total variation distance is TV ( P , Q ) : = sup E ∣ P ( E ) − Q ( E ) ∣ \operatorname{TV}(P,Q) := \sup_E |P(E)-Q(E)| TV ( P , Q ) := sup E ∣ P ( E ) − Q ( E ) ∣ , with the supremum over measurable events E E E . We bound this distance to compare the probability of { U ≥ m + h } \{U \ge m+h\} { U ≥ m + h } under the reference model and the mixture in part 4.
The assignment law is the same under both models. Conditional on Z [ n ] Z_{[n]} Z [ n ] , the outcomes are independent, and for j ∈ S j\in S j ∈ S ,
Y j ∼ { N ( 0 , σ 2 ) , under P 0 , N ( Z j Δ , σ 2 ) , under P S . Y_j \sim\begin{cases}
N(0,\sigma^2), & \text{under }\mathbb{P}_0,\\
N(Z_j\Delta,\sigma^2), & \text{under }\mathbb{P}_S.
\end{cases} Y j ∼ { N ( 0 , σ 2 ) , N ( Z j Δ , σ 2 ) , under P 0 , under P S .
The outcome distributions outside S S S are identical under the two models. Thus, the assignment probabilities and the outcome-density factors outside S S S cancel, giving
L S : = d P S d P 0 = ∏ j ∈ S exp { − ( Y j − Z j Δ ) 2 / ( 2 σ 2 ) } exp { − Y j 2 / ( 2 σ 2 ) } = exp { 1 2 σ 2 ∑ j ∈ S [ Y j 2 − ( Y j − Z j Δ ) 2 ] } = exp { 1 2 σ 2 ∑ j ∈ S ( 2 Δ Z j Y j − Δ 2 Z j 2 ) } = exp { Δ σ 2 ∑ j ∈ S Z j Y j − Δ 2 2 σ 2 ∑ j ∈ S Z j } , \begin{aligned}
L_S := \frac{d\mathbb{P}_S}{d\mathbb{P}_0}
= \prod_{j\in S}\frac{\exp\{-(Y_j-Z_j\Delta)^2/(2\sigma^2)\}}{\exp\{-Y_j^2/(2\sigma^2)\}}
= \exp\left\{\frac{1}{2\sigma^2}\sum_{j\in S}\left[Y_j^2-(Y_j-Z_j\Delta)^2\right]\right\} \\
&= \exp\left\{\frac{1}{2\sigma^2}\sum_{j\in S}\left(2\Delta Z_jY_j-\Delta^2Z_j^2\right)\right\}
= \exp\left\{\frac{\Delta}{\sigma^2}\sum_{j\in S}Z_jY_j-\frac{\Delta^2}{2\sigma^2}\sum_{j\in S}Z_j\right\},
\end{aligned} L S := d P 0 d P S = j ∈ S ∏ exp { − Y j 2 / ( 2 σ 2 )} exp { − ( Y j − Z j Δ ) 2 / ( 2 σ 2 )} = exp ⎩ ⎨ ⎧ 2 σ 2 1 j ∈ S ∑ [ Y j 2 − ( Y j − Z j Δ ) 2 ] ⎭ ⎬ ⎫ = exp ⎩ ⎨ ⎧ 2 σ 2 1 j ∈ S ∑ ( 2Δ Z j Y j − Δ 2 Z j 2 ) ⎭ ⎬ ⎫ = exp ⎩ ⎨ ⎧ σ 2 Δ j ∈ S ∑ Z j Y j − 2 σ 2 Δ 2 j ∈ S ∑ Z j ⎭ ⎬ ⎫ ,
where the last equality uses Z j 2 = Z j Z_j^2=Z_j Z j 2 = Z j . Under P 0 \mathbb{P}_0 P 0 , conditional on Z [ n ] Z_{[n]} Z [ n ] , the outcomes on J J J are independent N ( 0 , σ 2 ) N(0,\sigma^2) N ( 0 , σ 2 ) . Write E 0 \mathbb{E}_0 E 0 for expectation under P 0 \mathbb{P}_0 P 0 and b : = Δ 2 / σ 2 b:=\Delta^2/\sigma^2 b := Δ 2 / σ 2 . Using the Gaussian identity E e t ϵ j = e σ 2 t 2 / 2 \mathbb{E}e^{t\epsilon_j}=e^{\sigma^2t^2/2} E e t ϵ j = e σ 2 t 2 /2 gives
E 0 { L S L S ′ ∣ Z [ n ] } = ∏ j ∈ S ∩ S ′ e b Z j = exp { b ∑ j ∈ S ∩ S ′ Z j } . \mathbb{E}_0\{L_SL_{S'}\mid Z_{[n]}\}
= \prod_{j\in S\cap S'}e^{bZ_j}
= \exp\left\{b\sum_{j\in S\cap S'}Z_j\right\}. E 0 { L S L S ′ ∣ Z [ n ] } = j ∈ S ∩ S ′ ∏ e b Z j = exp ⎩ ⎨ ⎧ b j ∈ S ∩ S ′ ∑ Z j ⎭ ⎬ ⎫ .
A unit appearing in only one of the two sets contributes expectation one; a unit in both contributes e b Z j e^{bZ_j} e b Z j . No independence between treatment indicators is required.
Let S , S ′ S,S' S , S ′ be independent uniform subsets of size s s s in J J J , independent of the data. The mixture likelihood ratio is
L ‾ : = d P ‾ d P 0 = E S L S . \overline{L}:=\frac{\mathrm{d}\overline{P}}{\mathrm{d}P_0}=\mathbb{E}_S L_S. L := d P 0 d P = E S L S .
Write E Z \mathbb{E}_Z E Z for expectation over the common assignment law. Expanding the square and using Z j ≤ 1 Z_j\le1 Z j ≤ 1 , we obtain
E 0 L ‾ 2 = E S , S ′ E 0 ( L S L S ′ ) = E S , S ′ E Z exp { b ∑ j ∈ S ∩ S ′ Z j } ≤ E S , S ′ e b ∣ S ∩ S ′ ∣ . \begin{aligned}
\mathbb{E}_0\overline{L}^{\,2}
&=\mathbb{E}_{S,S'}\mathbb{E}_0(L_SL_{S'})\\
&=\mathbb{E}_{S,S'}\mathbb{E}_Z\exp\left\{b\sum_{j\in S\cap S'}Z_j\right\}\\
&\le\mathbb{E}_{S,S'}e^{b|S\cap S'|}.
\end{aligned} E 0 L 2 = E S , S ′ E 0 ( L S L S ′ ) = E S , S ′ E Z exp ⎩ ⎨ ⎧ b j ∈ S ∩ S ′ ∑ Z j ⎭ ⎬ ⎫ ≤ E S , S ′ e b ∣ S ∩ S ′ ∣ .
To bound the overlap, put H : = ∣ S ∩ S ′ ∣ H:=|S\cap S'| H := ∣ S ∩ S ′ ∣ . For fixed S S S , each of its ( s r ) \binom{s}{r} ( r s ) subsets of size r r r is contained in S ′ S' S ′ with probability ( ℓ − r s − r ) / ( ℓ s ) \binom{\ell-r}{s-r}/\binom{\ell}{s} ( s − r ℓ − r ) / ( s ℓ ) . Therefore, for r = 0 , … , s r=0,\ldots,s r = 0 , … , s ,
E ( H r ) = ( s r ) ( ℓ − r s − r ) ( ℓ s ) = ( s r ) ∏ q = 0 r − 1 s − q ℓ − q ≤ ( s r ) ( s / ℓ ) r . \mathbb{E}\binom{H}{r}
=\binom{s}{r}\frac{\binom{\ell-r}{s-r}}{\binom{\ell}{s}}
=\binom{s}{r}\prod_{q=0}^{r-1}\frac{s-q}{\ell-q}
\le\binom{s}{r}(s/\ell)^r. E ( r H ) = ( r s ) ( s ℓ ) ( s − r ℓ − r ) = ( r s ) q = 0 ∏ r − 1 ℓ − q s − q ≤ ( r s ) ( s / ℓ ) r .
The empty product for r = 0 r=0 r = 0 equals one, and the inequality uses ( s − q ) / ( ℓ − q ) ≤ s / ℓ (s-q)/(\ell-q)\le s/\ell ( s − q ) / ( ℓ − q ) ≤ s / ℓ . By the binomial theorem,
E e b H = E { 1 + ( e b − 1 ) } H = ∑ r = 0 s ( e b − 1 ) r E ( H r ) ≤ ∑ r = 0 s ( s r ) { s ℓ ( e b − 1 ) } r = { 1 + s ℓ ( e b − 1 ) } s ≤ exp { ( e b − 1 ) s 2 ℓ } , \begin{aligned}
\mathbb{E}e^{bH}
&=\mathbb{E}\{1+(e^b-1)\}^H\\
&=\sum_{r=0}^{s}(e^b-1)^r\mathbb{E}\binom{H}{r}\\
&\le\sum_{r=0}^{s}\binom{s}{r}\left\{\frac{s}{\ell}(e^b-1)\right\}^{r}\\
&=\left\{1+\frac{s}{\ell}(e^b-1)\right\}^{s}
\le\exp\left\{(e^b-1)\frac{s^2}{\ell}\right\},
\end{aligned} E e b H = E { 1 + ( e b − 1 ) } H = r = 0 ∑ s ( e b − 1 ) r E ( r H ) ≤ r = 0 ∑ s ( r s ) { ℓ s ( e b − 1 ) } r = { 1 + ℓ s ( e b − 1 ) } s ≤ exp { ( e b − 1 ) ℓ s 2 } ,
where the last inequality uses 1 + x ≤ e x 1+x\le e^x 1 + x ≤ e x . Since E 0 L ‾ = 1 \mathbb{E}_0\overline{L}=1 E 0 L = 1 , Cauchy–Schwarz now gives
TV ( P ‾ , P 0 ) = 1 2 E 0 ∣ L ‾ − 1 ∣ ≤ 1 2 E 0 ( L ‾ − 1 ) 2 = 1 2 E 0 L ‾ 2 − 1 ≤ 1 2 [ exp { ( e b − 1 ) s 2 ℓ } − 1 ] 1 / 2 . (52) \begin{aligned}
\operatorname{TV}(\overline{P},P_0)
&=\frac{1}{2}\mathbb{E}_0|\overline{L}-1|\\
&\le\frac{1}{2}\sqrt{\mathbb{E}_0(\overline{L}-1)^2}
=\frac{1}{2}\sqrt{\mathbb{E}_0\overline{L}^{\,2}-1}\\
&\le\frac{1}{2}\left[\exp\left\{(e^b-1)\frac{s^2}{\ell}\right\}-1\right]^{1/2}. \tag*{(52)}
\end{aligned} TV ( P , P 0 ) = 2 1 E 0 ∣ L − 1∣ ≤ 2 1 E 0 ( L − 1 ) 2 = 2 1 E 0 L 2 − 1 ≤ 2 1 [ exp { ( e b − 1 ) ℓ s 2 } − 1 ] 1/2 . (52)
Adding the auxiliary randomization cannot increase this distance, because its conditional law given the data is the same under all models. Thus the bound also applies to events involving U U U .
Lower bound on the excess
Set η : = ( 1 − α − ζ ) / 2 > 0 \eta:= (1-\alpha-\zeta)/2 > 0 η := ( 1 − α − ζ ) /2 > 0 and choose
h = ⌊ b 0 n 1 − 1 / ( 2 γ ) ⌋ h = \left\lfloor b_0 n^{1-1/(2\gamma)} \right\rfloor h = ⌊ b 0 n 1 − 1/ ( 2 γ ) ⌋
for a sufficiently small constant b 0 > 0 b_0 > 0 b 0 > 0 . Since h → ∞ h \to\infty h → ∞ and h / n → 0 h/n \to0 h / n → 0 , we have 1 ≤ h ≤ m / 2 1 \le h \le m/2 1 ≤ h ≤ m /2 for all sufficiently large n n n . Recall from part 1 that
s = ⌈ c γ n ( h / n ) γ ⌉ , ℓ = m − h , m = ⌊ n / 4 ⌋ . s = \left\lceil c_\gamma n(h/n)^\gamma\right\rceil,\qquad\ell= m-h,\qquad m = \lfloor n/4\rfloor. s = ⌈ c γ n ( h / n ) γ ⌉ , ℓ = m − h , m = ⌊ n /4 ⌋ .
With h = ⌊ b 0 n 1 − 1 / ( 2 γ ) ⌋ h = \left\lfloor b_0n^{1-1/(2\gamma)} \right\rfloor h = ⌊ b 0 n 1 − 1/ ( 2 γ ) ⌋ chosen above, these definitions give
s n ⟶ c γ b 0 γ , ℓ n ⟶ 1 4 , s 2 ℓ = ( s / n ) 2 ℓ / n ⟶ 4 c γ 2 b 0 2 γ . \frac{s}{\sqrt{n}} \longrightarrow c_\gamma b_0^\gamma,\qquad\frac{\ell}{n} \longrightarrow\frac14,\qquad\frac{s^2}{\ell} = \frac{(s/\sqrt{n})^2}{\ell/n} \longrightarrow4c_\gamma^2b_0^{2\gamma}. n s ⟶ c γ b 0 γ , n ℓ ⟶ 4 1 , ℓ s 2 = ℓ / n ( s / n ) 2 ⟶ 4 c γ 2 b 0 2 γ .
Choose b 0 b_0 b 0 small enough that
1 2 [ exp { 4 ( e b − 1 ) c γ 2 b 0 2 γ } − 1 ] 1 / 2 < η . \frac12\left[\exp\left\{4(e^b-1)c_\gamma^2b_0^{2\gamma}\right\}-1\right]^{1/2}<\eta. 2 1 [ exp { 4 ( e b − 1 ) c γ 2 b 0 2 γ } − 1 ] 1/2 < η .
Then (52) gives TV ( P ‾ , P 0 ) < η \operatorname{TV}(\overline{\mathbb{P}},\mathbb{P}_0)<\eta TV ( P , P 0 ) < η for sufficiently large n n n .
The reference vector belongs to F n ( λ , γ ) \mathcal{F}_n(\lambda,\gamma) F n ( λ , γ ) by (51) , so the coverage condition gives
P 0 { U ≥ m + h } ≥ 1 − α . \mathbb{P}_0\{U\ge m+h\}\ge1-\alpha. P 0 { U ≥ m + h } ≥ 1 − α .
By the definition of total variation,
P ‾ { U ≥ m + h } ≥ P 0 { U ≥ m + h } − TV ( P ‾ , P 0 ) > 1 − α − η = 1 − α + ζ 2 > ζ . \begin{aligned}
\overline{\mathbb{P}}\{U\ge m+h\}\ge\mathbb{P}_0\{U\ge m+h\}-\operatorname{TV}(\overline{\mathbb{P}},\mathbb{P}_0) \\
&>1-\alpha-\eta=\frac{1-\alpha+\zeta}{2}>\zeta.
\end{aligned} P { U ≥ m + h } ≥ P 0 { U ≥ m + h } − TV ( P , P 0 ) > 1 − α − η = 2 1 − α + ζ > ζ .
The mixture probability is the average of the probabilities under the alternatives. Since this average exceeds ζ \zeta ζ , at least one S S S satisfies P S { U ≥ m + h } > ζ \mathbb{P}_S\{U\ge m+h\}>\zeta P S { U ≥ m + h } > ζ . For this alternative, (49) gives K 0 ( τ ( S ) ) = m K_0(\tau^{(S)})=m K 0 ( τ ( S ) ) = m , and therefore
P S { U − K 0 ( τ ( S ) ) ≥ h } > ζ . \mathbb{P}_S\{U-K_0(\tau^{(S)})\ge h\}>\zeta. P S { U − K 0 ( τ ( S ) ) ≥ h } > ζ .
For sufficiently large n n n , h / n ≥ ( b 0 / 2 ) n − 1 / ( 2 γ ) h/n\ge(b_0/2)n^{-1/(2\gamma)} h / n ≥ ( b 0 /2 ) n − 1/ ( 2 γ ) . Taking c ∗ : = b 0 / 2 c_*:=b_0/2 c ∗ := b 0 /2 yields
sup τ ∈ F n ( λ , γ ) P τ { U − K 0 ( τ ) n ≥ c ∗ n − 1 / ( 2 γ ) } > ζ . \sup_{\tau\in\mathcal{F}_n(\lambda,\gamma)}\mathbb{P}_\tau\left\{\frac{U-K_0(\tau)}{n}\ge c_*n^{-1/(2\gamma)}\right\}>\zeta. τ ∈ F n ( λ , γ ) sup P τ { n U − K 0 ( τ ) ≥ c ∗ n − 1/ ( 2 γ ) } > ζ .
This proves the theorem. The constant c ∗ c_* c ∗ depends only on α \alpha α , ζ \zeta ζ , γ \gamma γ , σ \sigma σ , and τ max \tau_{\max} τ m a x , and is independent of n n n , U U U , and the dimension d d d .
Supporting calculations
Equivalence with contiguous blocks in one dimension
We prove (8) . Index the units by their covariate ranks and use distance ∣ i − j ∣ / n |i-j|/n ∣ i − j ∣/ n , breaking distance ties in favour of the smaller rank. Fix a centre i i i and a size r r r . Its nearest-neighbour set contains i i i . If this set contained two ranks with a missing rank between them, that missing rank would be closer to i i i than a selected rank on the same side of i i i . This contradicts the definition of the nearest neighbours. Thus every N i ( r ) N_i^{(r)} N i ( r ) is a contiguous block of length r r r .
Conversely, consider B s ( r ) = { s , … , s + r − 1 } B_s^{(r)} = \{s, \ldots, s+r-1\} B s ( r ) = { s , … , s + r − 1 } and put c = s + ⌊ r / 2 ⌋ c=s+\lfloor r/2\rfloor c = s + ⌊ r /2 ⌋ . If r = 2 q + 1 r=2q+1 r = 2 q + 1 , the block consists of the centre c c c and the q q q ranks on each side. All ranks outside the block have strictly greater distance from c c c . If r = 2 q r=2q r = 2 q , the block is { c − q , … , c + q − 1 } \{c-q,\ldots,c+q-1\} { c − q , … , c + q − 1 } . Its two possible boundary candidates at distance q / n q/n q / n are c − q c-q c − q and c + q c+q c + q ; the tie rule selects c − q c-q c − q . The other 2 q − 1 2q-1 2 q − 1 selected ranks have smaller distance. This argument also applies when one of the outside candidates does not exist at the sample boundary. Hence N c ( r ) = B s ( r ) N_c^{(r)}=B_s^{(r)} N c ( r ) = B s ( r ) in both cases, proving
{ N i ( r ) : i ∈ [ n ] } = B r . \{N_i^{(r)}: i\in[n]\}=B_r. { N i ( r ) : i ∈ [ n ]} = B r .
Repeated sets do not change a maximum. Therefore the local-null families, maximum p p p -values, largest zero-effect sizes, and inverted bounds agree. For Monte Carlo tests, the equality is exact when both formulations use the same shared assignments: the same subset then has the same observed and randomized statistics.
Derivation of the one-dimensional computational costs
We justify Table 1. These costs start from the common covariate ordering; forming this ordering costs an additional O ( n log n ) O(n\log n) O ( n log n ) time. The implementation of conditional tests considered here generates assignments separately for each block and sums its statistic from scratch, at cost O ( M r ) O(Mr) O ( M r ) for a block of length r r r . There are n − r + 1 n-r+1 n − r + 1 such blocks. Therefore the full conditional search costs
O ( M ∑ r = 1 n r ( n − r + 1 ) ) = O ( M n ( n + 1 ) ( n + 2 ) 6 ) = O ( M n 3 ) . O\left(M\sum_{r=1}^{n}r(n-r+1)\right)=O\left(M\frac{n(n+1)(n+2)}{6}\right)=O(Mn^3). O ( M r = 1 ∑ n r ( n − r + 1 ) ) = O ( M 6 n ( n + 1 ) ( n + 2 ) ) = O ( M n 3 ) .
For a descending search checking the t t t largest lengths, write s = n − r + 1 s=n-r+1 s = n − r + 1 . The corresponding cost is
O ( M ∑ s = 1 t s ( n − s + 1 ) ) = O ( M t ( t + 1 ) ( 3 n + 2 − 2 t ) 6 ) = O ( M n t 2 ) . O\left(M\sum_{s=1}^{t}s(n-s+1)\right)=O\left(M\frac{t(t+1)(3n+2-2t)}{6}\right)=O(Mnt^2). O ( M s = 1 ∑ t s ( n − s + 1 ) ) = O ( M 6 t ( t + 1 ) ( 3 n + 2 − 2 t ) ) = O ( M n t 2 ) .
These costs describe the implementation just specified. They are not lower bounds for every implementation of conditional tests.
For shared tests, form the global cumulative sums of the outcomes, treatment indicators, and their products in O ( M n ) O(Mn) O ( M n ) time, including the observed assignment. The differences between cumulative sums in (15) give each block statistic in constant time per assignment. At a fixed length r r r , all statistics and Monte Carlo comparisons therefore cost O { M ( n − r + 1 ) } O\{M(n-r+1)\} O { M ( n − r + 1 )} time. Since ∑ r = 1 n ( n − r + 1 ) = n ( n + 1 ) / 2 \sum_{r=1}^{n}(n-r+1)=n(n+1)/2 ∑ r = 1 n ( n − r + 1 ) = n ( n + 1 ) /2 , the full search costs O ( M n 2 ) O(Mn^2) O ( M n 2 ) . Checking t t t arbitrary lengths costs at most O ( M n t ) O(Mnt) O ( M n t ) , including preprocessing. For the t t t largest lengths, the sharper count is O ( M n + M t 2 ) O(Mn+Mt^2) O ( M n + M t 2 ) , which is also O ( M n t ) O(Mnt) O ( M n t ) because 1 ≤ t ≤ n 1\leq t\leq n 1 ≤ t ≤ n .
Under (16) , non-rejection occurs at all lengths up to some value, and rejection occurs at every larger length. After checking the endpoints, bisection halves the remaining interval at each step and finds the largest non-rejected length by testing O ( log n ) O(\log n) O ( log n ) lengths. Testing all blocks at one length costs at most O ( M n ) O(Mn) O ( M n ) , giving O ( M n log n ) O(Mn\log n) O ( M n log n ) time. This algorithm returns exactly the largest non-rejected length.
The Gaussian approximation uses one additional cumulative sum of Y i 2 Y_i^2 Y i 2 . The variance identity established below gives all Gaussian block p p p -values at a length in O ( n ) O(n) O ( n ) time. Evaluating O ( log n ) O(\log n) O ( log n ) lengths therefore costs O ( n log n ) O(n\log n) O ( n log n ) . If the subsequent Monte Carlo checks and bracket refinements use k k k length evaluations, their cost is O ( M n k ) O(Mnk) O ( M nk ) , for a total of O ( n log n + M n k ) O(n\log n+Mnk) O ( n log n + M nk ) . Here k k k counts every Monte Carlo evaluation, including endpoint checks. If two adjacent endpoints satisfy (36) , monotonicity makes those two checks sufficient, giving k = 2 k=2 k = 2 . No accuracy guarantee for the Gaussian approximation is needed for this accounting: the final bracket is checked using the Monte Carlo tests.
The bisection costs rely on the one-dimensional common ordering. For nearest-neighbour regions in higher dimensions, evaluating the tests at selected sizes using this implementation requires cumulative sums for each centre. Constructing all of those sums already costs O ( M n 2 ) O(Mn^2) O ( M n 2 ) , so testing fewer sizes does not by itself give the same computational saving.
Cost of an exhaustive rectangle search
An ordered coordinate has n ( n + 1 ) / 2 n(n+1)/2 n ( n + 1 ) /2 contiguous rank intervals. Taking one interval in each of two coordinates gives
{ n ( n + 1 ) 2 } 2 = O ( n 4 ) \left\{\frac{n(n+1)}{2}\right\}^{2}=O(n^{4}) { 2 n ( n + 1 ) } 2 = O ( n 4 )
grid rectangles. Distinct rectangles may contain the same units, and some rectangles may be empty; the count describes the exhaustive grid enumeration and does not require the induced unit sets to be distinct.
On the n × n n\times n n × n rank grid, accumulate cell counts, outcome sums, treatment sums, and treatment–outcome product sums. Counts and outcome sums are fixed across assignments. For each assignment, the corresponding two-dimensional cumulative sums can be formed in O ( n 2 ) O(n^2) O ( n 2 ) time, including zero entries for empty cells. Each rectangle sum is then obtained from four cumulative-sum entries. For a nonempty rectangle, its mean, centred statistic, and Monte Carlo comparison take constant time. Empty rectangles are skipped. Exhaustively testing all enumerated rectangles therefore costs O ( M n 4 ) O(Mn^4) O ( M n 4 ) time. This is an algorithmic upper bound for the full enumeration; it does not assert that every algorithm for rectangular regions must have quartic cost.
Exact variance of the shared randomized statistic
Suppose n ≥ 2 n \ge2 n ≥ 2 and treatment is assigned by complete randomization with 0 < n 1 < n 0 < n_1 < n 0 < n 1 < n and π = n 1 / n \pi= n_1/n π = n 1 / n . Hold the observed outcomes fixed, as required when computing the reference distribution. For a nonempty region B B B , define a i = 1 { i ∈ B } ( Y i − Y ‾ B ) a_i = 1\{i \in B\}(Y_i-\overline{Y}_B) a i = 1 { i ∈ B } ( Y i − Y B ) , so ∑ i = 1 n a i = 0 \sum_{i=1}^{n} a_i=0 ∑ i = 1 n a i = 0 and T B ( Z ( m ) ) = ∑ i a i Z i ( m ) T_B(Z^{(m)})=\sum_i a_iZ_i^{(m)} T B ( Z ( m ) ) = ∑ i a i Z i ( m ) . Under a fresh complete-randomization assignment,
E Z i ( m ) = π , Var ( Z i ( m ) ) = π ( 1 − π ) , Cov ( Z i ( m ) , Z j ( m ) ) = − π ( 1 − π ) n − 1 ( i ≠ j ) . \mathbb{E}Z_i^{(m)}=\pi,\qquad\operatorname{Var}(Z_i^{(m)})=\pi(1-\pi),\qquad\operatorname{Cov}(Z_i^{(m)},Z_j^{(m)})=-\frac{\pi(1-\pi)}{n-1}\quad(i\ne j). E Z i ( m ) = π , Var ( Z i ( m ) ) = π ( 1 − π ) , Cov ( Z i ( m ) , Z j ( m ) ) = − n − 1 π ( 1 − π ) ( i = j ) .
The covariance formula follows from E ( Z i ( m ) Z j ( m ) ) = n 1 ( n 1 − 1 ) / { n ( n − 1 ) } \mathbb{E}(Z_i^{(m)}Z_j^{(m)})=n_1(n_1-1)/\{n(n-1)\} E ( Z i ( m ) Z j ( m ) ) = n 1 ( n 1 − 1 ) / { n ( n − 1 )} . Consequently the reference mean is zero and
Var { T B ( Z ( m ) ) } = π ( 1 − π ) ∑ i a i 2 − π ( 1 − π ) n − 1 ∑ i ≠ j a i a j = n π ( 1 − π ) n − 1 ∑ i a i 2 = n π ( 1 − π ) n − 1 { ∑ i ∈ B Y i 2 − 1 ∣ B ∣ ( ∑ i ∈ B Y i ) 2 } . \begin{aligned}
\operatorname{Var}\{T_B(Z^{(m)})\}=\pi(1-\pi)\sum_i a_i^2-\frac{\pi(1-\pi)}{n-1}\sum_{i\ne j}a_i a_j \\
&=\frac{n\pi(1-\pi)}{n-1}\sum_i a_i^2 \\
&=\frac{n\pi(1-\pi)}{n-1}\left\{\sum_{i\in B}Y_i^2-\frac{1}{|B|}\left(\sum_{i\in B}Y_i\right)^2\right\}.
\end{aligned} Var { T B ( Z ( m ) )} = π ( 1 − π ) i ∑ a i 2 − n − 1 π ( 1 − π ) i = j ∑ a i a j = n − 1 nπ ( 1 − π ) i ∑ a i 2 = n − 1 nπ ( 1 − π ) ⎩ ⎨ ⎧ i ∈ B ∑ Y i 2 − ∣ B ∣ 1 ( i ∈ B ∑ Y i ) 2 ⎭ ⎬ ⎫ .
The second equality uses ∑ i ≠ j a i a j = ( ∑ i a i ) 2 − ∑ i a i 2 = − ∑ i a i 2 \sum_{i\ne j}a_i a_j=(\sum_i a_i)^2-\sum_i a_i^2=-\sum_i a_i^2 ∑ i = j a i a j = ( ∑ i a i ) 2 − ∑ i a i 2 = − ∑ i a i 2 . The factor involves the full sample size n n n , because the shared assignment is sampled on the full experiment. The variance identity is exact; approximating the reference distribution by a Gaussian is a separate step. If the variance is zero, all outcomes within B B B are equal, every centred statistic is zero, and its exact and Monte Carlo upper-tail p p p -values equal one.
The boundary-cap calculation in Appendix C
We derive (37) for the continuous geometric example. This calculation motivates the exponent ν = ( d + 1 ) / 2 \nu=(d+1)/2 ν = ( d + 1 ) /2 in Assumption 2. Theorem 2 assumes that the corresponding count condition holds for every sample neighbourhood larger than K 0 K_0 K 0 .
Translate and rotate coordinates so that the zero-effect half-space is { x : x 1 ≤ 0 } \{x : x_1 \le0\} { x : x 1 ≤ 0 } and the ball centre is ( − r 0 , 0 , … , 0 ) (-r_0, 0, \ldots, 0) ( − r 0 , 0 , … , 0 ) , where r 0 > 0 r_0 > 0 r 0 > 0 is fixed. Write a point in the affected cap as ( x 1 , x ′ ) (x_1, x') ( x 1 , x ′ ) , with 0 < x 1 ≤ s 0 < x_1 \le s 0 < x 1 ≤ s and x ′ ∈ R d − 1 x' \in\mathbb{R}^{d-1} x ′ ∈ R d − 1 . The enlarged ball condition is
( x 1 + r 0 ) 2 + ∥ x ′ ∥ 2 ≤ ( r 0 + s ) 2 . (x_1 + r_0)^2 + \lVert x' \rVert^2 \le(r_0 + s)^2. ( x 1 + r 0 ) 2 + ∥ x ′ ∥ 2 ≤ ( r 0 + s ) 2 .
For d ≥ 2 d \ge2 d ≥ 2 , its cross-section at depth x 1 x_1 x 1 is a ( d − 1 ) (d-1) ( d − 1 ) -dimensional ball of squared radius
( r 0 + s ) 2 − ( r 0 + x 1 ) 2 = ( s − x 1 ) ( 2 r 0 + s + x 1 ) . (r_0 + s)^2 - (r_0 + x_1)^2 = (s - x_1)(2r_0 + s + x_1). ( r 0 + s ) 2 − ( r 0 + x 1 ) 2 = ( s − x 1 ) ( 2 r 0 + s + x 1 ) .
If 0 < s ≤ r 0 0 < s \le r_0 0 < s ≤ r 0 , then 2 r 0 ≤ 2 r 0 + s + x 1 ≤ 4 r 0 2r_0 \le2r_0 + s + x_1 \le4r_0 2 r 0 ≤ 2 r 0 + s + x 1 ≤ 4 r 0 throughout the cap. Writing ω d − 1 \omega_{d-1} ω d − 1 for the volume of the unit ball in R d − 1 \mathbb{R}^{d-1} R d − 1 , its full volume is therefore
Vol d ( B s ∖ Z 0 ) = ω d − 1 ∫ 0 s [ ( s − x 1 ) ( 2 r 0 + s + x 1 ) ] ( d − 1 ) / 2 d x 1 ≍ ∫ 0 s ( s − x 1 ) ( d − 1 ) / 2 d x 1 = 2 d + 1 s ( d + 1 ) / 2 . \operatorname{Vol}_d(B_s \setminus Z_0) = \omega_{d-1} \int_0^s [(s - x_1)(2r_0 + s + x_1)]^{(d-1)/2} \, dx_1
\mathrel{\asymp} \int_0^s (s - x_1)^{(d-1)/2} \, dx_1 = \frac{2}{d+1}s^{(d+1)/2}. Vol d ( B s ∖ Z 0 ) = ω d − 1 ∫ 0 s [( s − x 1 ) ( 2 r 0 + s + x 1 ) ] ( d − 1 ) /2 d x 1 ≍ ∫ 0 s ( s − x 1 ) ( d − 1 ) /2 d x 1 = d + 1 2 s ( d + 1 ) /2 .
The constants may depend on d d d and r 0 r_0 r 0 , but not on s s s . The distance to the half-space is x 1 x_1 x 1 when x 1 > 0 x_1 > 0 x 1 > 0 . Restricting the same integral to s / 2 ≤ x 1 ≤ s s/2 \le x_1 \le s s /2 ≤ x 1 ≤ s gives
Vol d { x ∈ B s : dist ( x , Z 0 ) ≥ s / 2 } ≍ ∫ s / 2 s ( s − x 1 ) ( d − 1 ) / 2 d x 1 ≍ s ( d + 1 ) / 2 . \operatorname{Vol}_d\{x \in B_s : \operatorname{dist}(x, Z_0) \ge s/2\} \mathrel{\asymp} \int_{s/2}^s (s - x_1)^{(d-1)/2} \, dx_1 \mathrel{\asymp} s^{(d+1)/2}. Vol d { x ∈ B s : dist ( x , Z 0 ) ≥ s /2 } ≍ ∫ s /2 s ( s − x 1 ) ( d − 1 ) /2 d x 1 ≍ s ( d + 1 ) /2 .
Thus the part of the cap at distance at least s / 2 s/2 s /2 from Z 0 Z_0 Z 0 has the same order of volume as the full cap. In dimension one these two lengths are s s s and s / 2 s/2 s /2 , which gives the same formula with exponent ( d + 1 ) / 2 = 1 (d+1)/2 = 1 ( d + 1 ) /2 = 1 .
The full added band has volume
ω d { ( r 0 + s ) d − r 0 d } ≍ s . \omega_d\{(r_0 + s)^d - r_0^d\} \mathrel{\asymp} s. ω d {( r 0 + s ) d − r 0 d } ≍ s .
For example, the mean value theorem writes the expression in braces as d ( r 0 + θ s ) d − 1 s d(r_0+\theta s)^{d-1}s d ( r 0 + θ s ) d − 1 s for some θ ∈ ( 0 , 1 ) \theta\in(0,1) θ ∈ ( 0 , 1 ) . If the covariate density is between positive finite constants on the balls, every displayed volume comparison also holds for probability mass. It follows that u s = P V ( B s ∖ B 0 ) ≍ s u_s = P_V(B_s \setminus B_0) \mathrel{\asymp} s u s = P V ( B s ∖ B 0 ) ≍ s and
P V { v ∈ B s : dist ( v , Z 0 ) ≥ s / 2 } ≍ u s ( d + 1 ) / 2 , P_V\{v \in B_s : \operatorname{dist}(v, Z_0) \ge s/2\} \mathrel{\asymp} u_s^{(d+1)/2}, P V { v ∈ B s : dist ( v , Z 0 ) ≥ s /2 } ≍ u s ( d + 1 ) /2 ,
which is (37) . In particular, s / 2 s/2 s /2 is bounded below by a fixed positive multiple of u s u_s u s .
If the corresponding count bound holds uniformly over all sample neighbourhoods larger than K 0 K_0 K 0 , Assumption 2 can be applied with ν = ( d + 1 ) / 2 \nu= (d+1)/2 ν = ( d + 1 ) /2 . Then 2 γ = d + 1 + 2 β 2\gamma= d+1+2\beta 2 γ = d + 1 + 2 β , and substituting this identity in Theorem 2 gives the displayed rate ( log n / n ) 1 / ( d + 1 + 2 β ) (\log n/n)^{1/(d+1+2\beta)} ( log n / n ) 1/ ( d + 1 + 2 β ) . The continuous calculation by itself neither establishes this uniform sample condition nor supplies a lower bound for that more restricted geometric model.