Skip to main content

Module bootstrap

Module bootstrap 

Source
Expand description

Bootstrap resampling for paired statistics.

Given n paired observations and a statistic function, resample n pairs with replacement, apply the statistic, repeat iterations times (1000 by default), and return the 2.5 / 50 / 97.5 percentile of the resulting distribution.

Every axis in the nine axes in README.md uses this primitive to turn a sample into a median + 95% CI — implemented once here instead of per-axis.

Structs§

CiResult
Percentile-based 95% CI plus the sample median.

Constants§

DEFAULT_ITERATIONS
Default number of bootstrap iterations. Set on the high side of the bias/variance tradeoff; pair-resamples are cheap (O(n) per iter) so 1000 is fine even for n=1k samples.

Functions§

median
Compute the median of a slice of floats. Handles even-length lists by averaging the two central values. The input is cloned; the caller’s slice is untouched.
paired_ci
Bootstrap the statistic over paired samples.