Synopsis

One-Sample Estimators

Two-Sample Estimators

Randomization

The table below maps each toolkit function to the underlying algorithm and its complexity.

One-Sample Estimators

FunctionAlgorithmComplexity
Center⁡\operatorname{Center}Monahan’s implicit-matrix selectionO(nlog⁡n)O(n \log n)
CenterBounds⁡\operatorname{CenterBounds}Binary search over pairwise averages + SignedRankMarginO(nlog⁡n)O(n \log n)
Spread⁡\operatorname{Spread}Monahan’s selection adapted for differencesO(nlog⁡n)O(n \log n)
SpreadBounds⁡\operatorname{SpreadBounds}Disjoint-pair sign-test inversionO(nlog⁡n)O(n \log n)
Compare1⁡\operatorname{Compare1}Composition: CenterBounds/SpreadBounds + threshold validation + verdict logicDepends on bounds complexity

Two-Sample Estimators

FunctionAlgorithmComplexity
Shift⁡\operatorname{Shift}Value-space binary search over pairwise differencesO((n+m)log⁡L)O((n+m) \log L)
ShiftBounds⁡\operatorname{ShiftBounds}PairwiseMargin + Shift quantile selectionO((n+m)log⁡L)O((n+m) \log L)
Ratio⁡\operatorname{Ratio}Log-exp transform + ShiftO((n+m)log⁡L)O((n+m) \log L)
RatioBounds⁡\operatorname{RatioBounds}Log-exp transform + ShiftBoundsO((n+m)log⁡L)O((n+m) \log L)
Disparity⁡\operatorname{Disparity}Composition: Shift⁡/AvgSpread⁡\operatorname{Shift} / \operatorname{AvgSpread}O((n+m)log⁡L+nlog⁡n+mlog⁡m)O((n+m) \log L + n \log n + m \log m)
DisparityBounds⁡\operatorname{DisparityBounds}Bonferroni split: ShiftBounds + AvgSpreadBoundsO((n+m)log⁡L+nlog⁡n+mlog⁡m)O((n+m) \log L + n \log n + m \log m)
Compare2⁡\operatorname{Compare2}Composition: ShiftBounds/RatioBounds/DisparityBounds + threshold validation + verdict logicDepends on bounds complexity

Randomization

FunctionAlgorithmComplexity
UniformFloat⁡\operatorname{UniformFloat}53-bit extraction from xoshiro256++ outputO(1)O(1) per draw
UniformInt⁡\operatorname{UniformInt}Modulo reduction of raw 64-bit outputO(1)O(1) per draw
Sample⁡\operatorname{Sample}Fan–Muller–Rezucha selection samplingO(n)O(n)
Resample⁡\operatorname{Resample}Uniform integer sampling with replacementO(k)O(k)
Shuffle⁡\operatorname{Shuffle}Fisher–Yates (Knuth shuffle)O(n)O(n)

Auxiliary

FunctionAlgorithmComplexity
AvgSpread⁡\operatorname{AvgSpread}Weighted average of two Spread callsO(nlog⁡n+mlog⁡m)O(n \log n + m \log m)
AvgSpreadBounds⁡\operatorname{AvgSpreadBounds}Bonferroni combination of two SpreadBoundsO(nlog⁡n+mlog⁡m)O(n \log n + m \log m)
Median⁡\operatorname{Median}Sort + pick middleO(nlog⁡n)O(n \log n)
SignMargin⁡\operatorname{SignMargin}Binomial CDF inversion + randomized cutoffO(n)O(n)
PairwiseMargin⁡\operatorname{PairwiseMargin}Löffler recurrence (exact) / Edgeworth (approx)O((c∗)2+c∗(n+m))O((c^*)^2 + c^*(n+m)) (worst case O((nm)2)O((n m)^2)) / O(log⁡(nm))O(\log(n m))
SignedRankMargin⁡\operatorname{SignedRankMargin}Dynamic programming (exact) / Edgeworth (approx)O(n3)O(n^3) / O(log⁡n)O(\log n)

Here c∗c^* denotes the first dominance index where the exact CDF reaches misrate/2\mathrm{misrate}/2.