How this calculation works
A global rank-envelope test compares one observed curve with null-simulated curves on a shared grid. Extreme pointwise ranks order whole curves, producing a simultaneous envelope and a tie-aware p-value interval. Exchangeability under a justified simple null is essential; the calculator does not generate or validate the null simulations.
R_i=min_grid min(lower_rank_i,upper_rank_i); p_liberal=#{R_j<R_obs}/(s+1), p_conservative=#{R_j≤R_obs}/(s+1), with all observed and simulated curves included.A worked example
For nineteen illustrative constant null curves at levels−9through9and an observed zero curve on three grid points, the observed curve ties for the least extreme rank. The conservative p-value is1and liberal p-value0.9; the90%rank envelope is[−8,8]at each grid point under the stated strict-rank exclusion convention.
Good to know
One observed curve plus19–999 supplied null curves on a shared2–200 point grid, at most100000 scalar curve values, alpha0.01–0.2. Two-sided extreme-rank ordering with conservative/liberal p interval for ties and the matching rank envelope. Null curves must be exchangeable with the observed curve under a fully specified simple null; no built-in simulation or automatic composite-null adjustment, FDR envelope or pointwise-to-global reinterpretation.
Reference: Myllymäki et al., Global envelope tests for spatial processes (opens in a new tab) ↗
Test an entire discretized function
A curve has several coordinates, and an unusual departure may occur at any grid location. Testing each point separately and drawing ordinary pointwise intervals does not automatically control the chance of any excursion across the whole grid. A global envelope instead orders complete observed and simulated functions under one declared rule and calibrates the corresponding whole-function comparison.
The grid can represent distances, times or another ordered argument. The initial input is numerical curves already evaluated on that grid. This page neither simulates a spatial process nor computes a summary such as Ripley K from raw locations. Those external steps must produce curves appropriate for the scientific null being assessed.
Compare this with the Empirical CDF confidence band calculator using DKW. Compare an observed function with exchangeable null-simulated functions using extreme pointwise ranks to construct a global Monte Carlo envelope and a tie-aware p-value interval. Existing DKW bands estimate one unknown CDF from IID observations and do not accept simulated curves or carry out a global functional null test.
Require comparable null simulations
The observed curve and null curves must be exchangeable under the tested simple null. That requirement is straightforward for properly generated simulations from a fully specified null, but can fail when parameters are estimated from the observed data and then treated as known without adjustment. More null simulations do not correct a misspecified or nonexchangeable simulation mechanism.
All curves must share the same grid length and coordinate meaning. Reordering the grid consistently leaves an extreme-rank statistic unchanged, although it changes the visual order of the plot. Interpolating some curves differently or selecting a favorable grid region after viewing results changes the test definition. Retain the original supplied grid and simulation procedure with the output.
Order curves by extreme pointwise ranks
At each grid coordinate, rank the observed and simulated values together. Two-sided pointwise ranks measure closeness to either the lower or upper tail. A curve’s extreme rank is the smallest of its pointwise ranks across the grid. This retains the location of its most extreme departure without pretending each coordinate provides an independent test.
Extreme ranks often tie because they are discrete. The method therefore reports a liberal and conservative p-value rather than hiding the ambiguity behind a randomly selected tie order. Any single tie-breaking extension, such as extreme-rank length, would need its own explicitly named implementation. The initial page retains the transparent interval and matching rank-envelope convention.
Read the constant-curve example
The illustrative null input contains nineteen constant curves with levels minus nine through nine. The observed curve is identically zero, on the same three-point grid. There are twenty curves in the combined rank calculation. The observed zero curve and the simulated zero curve share the central ranks, making both less extreme than the remaining eighteen curves.
The liberal p-value is therefore eighteen divided by twenty, or0.9, and the conservative value is twenty divided by twenty, or one. At alpha0.1the rank envelope excludes the two outermost level curves and spans minus eight to eight at each coordinate under the declared rule. The observed zero curve remains comfortably inside; the example checks ties and ranking, not evidence of a real fitted process.
Connect the envelope with the test convention
The envelope is built from curves retained by the chosen whole-curve rank threshold. Its endpoints can vary across the grid even though the threshold is one global rank value. A departure beyond the band identifies where an observed function is extreme under that ordering. It should not be interpreted as a separate unadjusted local p-value at the crossing point.
Discrete rank resolution limits which alpha values can be represented exactly. Small simulation counts and extensive ties can leave a substantial p-value interval or a conservative envelope. Such limitations should remain visible. A smooth visual band should not be substituted for the computed rank envelope merely to conceal steps, missing resolution or tied critical curves.
Validate ranks independently of plotting
For a small matrix, write out the combined coordinate ranks and calculate every curve’s minimum two-sided rank by hand or an independent routine. Then count curves strictly less extreme and no more extreme than the observation using the declared ordering direction. A reversed comparison can produce plausible-looking p-values with the opposite meaning.
Compare matched examples with the GETpackage’s rank test and its explicit tie conventions. Test all identical curves, a clearly extreme observation, repeated values, permutation of simulation rows and one-coordinate monotone transformations. The envelope and p-value interval should remain consistent with the rank definition; the plotted line alone is not a sufficient verification.
Keep scope separate from other functional bands
DKWbands describe uncertainty about a CDFfrom an IIDsample and do not require supplied simulated curves. Global rank envelopes instead compare an observed multivariate or functional summary against exchangeable null functions. Neither procedure can be relabeled as the other merely because both draw a shaded band around a line.
The initial page does not provide an FDRenvelope, a composite-null adjustment or a guarantee between unobserved grid locations. If the scientific claim concerns a continuous curve, discretization must be justified independently. Report the null simulation mechanism, number of simulations, grid, sidedness, rank convention, alpha and tie-related p-value interval with any graphical conclusion.
A few questions, answered
Are these pointwise confidence intervals?
No. The envelope is calibrated through a whole-curve rank ordering across the supplied grid.
Why report a p-value interval?
Discrete extreme ranks can tie. Liberal and conservative counts expose the resulting ambiguity without an undisclosed random tie break.
Can I fit the null to the observation and simulate directly?
Composite-null fitting may require an additional adjustment. The initial simple-null test assumes the supplied curves justify exchangeability.
Does the test cover between grid points?
The calculation applies to the entered discretized coordinates. A continuous-function interpretation needs an appropriate grid and further justification.