Skip to main content

Module repeat_stats

Module repeat_stats 

Source
Expand description

Repeat statistics, case-clustered bootstrap intervals and noise bands (spec 029, 3.3.2 to 3.5).

Pure functions over per-case measures: a metric’s contribution from each case in each run, in manifest order and run order. Every value is determined by the measures, the configuration and the seed, through the in-crate generator, exact integer ranks and binary64 addition, subtraction, multiplication, division and square root in the fixed orders stated here: no fused multiply-add and no transcendental function, so the figures are bit-identical on every target.

Nothing is dropped or defaulted: an unknown run value makes the across-run statistics unknown, an undefined resample makes the interval unknown with its count, and an unknown input makes a band unknown, never the floor or zero.

Structs§

Bootstrap
The bootstrap’s declared inputs (3.3.1).
MetricCases
A metric’s contributions: cases[case][run], None where the case did not enter the metric’s denominator in that run.
RunStats
Per-run values and the across-run statistics of one metric (3.3.2, 3.3.3).

Enums§

Band
A noise band, or why there is none.
Basis
Where a band came from (3.5.4).
Contribution
One case’s contribution to one metric in one run.
Figure
A figure, or why there is none.
Form
How a metric decomposes into per-case contributions (3.2.2).
Interval
A percentile interval, or why there is none.
StatsError
Why statistics were refused.

Constants§

MAX_BOOTSTRAP_WORK
The most work one cohort’s bootstrap may take: B * C * N (3.4.8).
MAX_DENOMINATOR
The largest denominator one case contributes in one run. Integer sums are kept in u128: at most u32::MAX per contribution, 64 runs and fewer than 2^64 drawn cases stay below 2^102, so no sum can overflow, whatever the number of cases.
MAX_LEVEL_UNITS
MAX_RUNS
The most runs in a repeat set (3.1.1).
MIN_LEVEL_UNITS
The level’s bounds in Decimal units, [0.5, 0.999] (3.3.1).

Functions§

across_runs
mean, sd, min and max of per-run values (3.3.2), in run order. Any unknown value makes all four unknown, naming the runs; sd of a single run is unknown except for deterministic replay (3.5.3).
band
max(derived, floor) (3.5.1 to 3.5.3). An unknown input is an unknown band, never the floor or zero. For a replay set a k_sd band is the floor with basis deterministic_replay: replaying the same retained outputs varies by nothing.
check_shape
Every case has exactly runs entries and every contribution has the metric’s form.
intervals
Case-clustered percentile bootstrap intervals for every metric of one cohort (3.4.1, 3.4.5, 3.4.7). All metrics share the cohort’s cases and its stream cohort/<name>, so they use the same B resamples.
percentile_ranks
One-based ranks of the lower and upper percentile bounds among B sorted values, in exact integer arithmetic (3.4.7).
run_stats
Per-run values, mean, sd, min, max and pooled of one metric over its cohort (3.3.2, 3.3.3). deterministic is the replay source, whose sd is exactly 0 for a single run (3.5.3).