Synopsis
One-Sample Estimators
Two-Sample Estimators
- Shift(x,y) — robust difference
- ShiftBounds(x,y,misrate) — confidence interval for shift
- Ratio(x,y) — robust ratio
- RatioBounds(x,y,misrate) — confidence interval for ratio
- Disparity(x,y) — robust effect size =Shift/AvgSpread
- DisparityBounds(x,y,misrate) — confidence interval for disparity
Randomization
- r←Rng(s) — random number generator with seed s
- r.UniformFloat() — uniform random value in [0,1)
- r.UniformInt(a,b) — uniform random integer in [a,b)
- r.Sample(x,k) — select k elements without replacement
- r.Resample(x,k) — select k elements with replacement
- r.Shuffle(x) — uniformly random permutation
The table below maps each toolkit function to the underlying algorithm and its complexity.
One-Sample Estimators
| Function | Algorithm | Complexity |
|---|
| Center | Monahans implicit-matrix selection | O(nlogn) |
| CenterBounds | Binary search over pairwise averages + SignedRankMargin | O(nlogn) |
| Spread | Monahans selection adapted for differences | O(nlogn) |
| SpreadBounds | Disjoint-pair sign-test inversion | O(nlogn) |
Two-Sample Estimators
| Function | Algorithm | Complexity |
|---|
| Shift | Value-space binary search over pairwise differences | O((n+m)logL) |
| ShiftBounds | PairwiseMargin + Shift quantile selection | O((n+m)logL) |
| Ratio | Log-exp transform + Shift | O((n+m)logL) |
| RatioBounds | Log-exp transform + ShiftBounds | O((n+m)logL) |
| Disparity | Composition: AvgSpreadShift | O((n+m)logL+nlogn+mlogm) |
| DisparityBounds | Bonferroni split: ShiftBounds + AvgSpreadBounds | O((n+m)logL+nlogn+mlogm) |
Randomization
| Function | Algorithm | Complexity |
|---|
| UniformFloat | 53-bit extraction from xoshiro256++ output | O(1) per draw |
| UniformInt | Modulo reduction of raw 64-bit output | O(1) per draw |
| Sample | Fan-Muller-Rezucha selection sampling | O(n) |
| Resample | Uniform integer sampling with replacement | O(k) |
| Shuffle | Fisher-Yates (Knuth shuffle) | O(n) |
Auxiliary
| Function | Algorithm | Complexity |
|---|
| AvgSpread | Weighted average of two Spread calls | O(nlogn+mlogm) |
| AvgSpreadBounds | Bonferroni combination of two SpreadBounds | O(nlogn+mlogm) |
| Median | Sort + pick middle | O(nlogn) |
| SignMargin | Binomial CDF inversion + randomized cutoff | O(n) |
| PairwiseMargin | Löffler recurrence (exact) / Edgeworth (approx) | O(nm) / O(log(nm)) |
| SignedRankMargin | Dynamic programming (exact) / Edgeworth (approx) | O(n3) / O(logn) |