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}Monahans implicit-matrix selectionO(nlogn)O(n \log n)
CenterBounds\operatorname{CenterBounds}Binary search over pairwise averages + SignedRankMarginO(nlogn)O(n \log n)
Spread\operatorname{Spread}Monahans selection adapted for differencesO(nlogn)O(n \log n)
SpreadBounds\operatorname{SpreadBounds}Disjoint-pair sign-test inversionO(nlogn)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)logL)O((n+m) \log L)
ShiftBounds\operatorname{ShiftBounds}PairwiseMargin + Shift quantile selectionO((n+m)logL)O((n+m) \log L)
Ratio\operatorname{Ratio}Log-exp transform + ShiftO((n+m)logL)O((n+m) \log L)
RatioBounds\operatorname{RatioBounds}Log-exp transform + ShiftBoundsO((n+m)logL)O((n+m) \log L)
Disparity\operatorname{Disparity}Composition: Shift/AvgSpread\operatorname{Shift} / \operatorname{AvgSpread}O((n+m)logL+nlogn+mlogm)O((n+m) \log L + n \log n + m \log m)
DisparityBounds\operatorname{DisparityBounds}Bonferroni split: ShiftBounds + AvgSpreadBoundsO((n+m)logL+nlogn+mlogm)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(nlogn+mlogm)O(n \log n + m \log m)
AvgSpreadBounds\operatorname{AvgSpreadBounds}Bonferroni combination of two SpreadBoundsO(nlogn+mlogm)O(n \log n + m \log m)
Median\operatorname{Median}Sort + pick middleO(nlogn)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(logn)O(\log n)

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