sharpebench-stats — deterministic backtest-honesty statistics
The pure statistics core extracted from sharpebench-core: moment and normal
primitives ([stats]), the deflated / probabilistic Sharpe family
([deflated_sharpe]), the data-snooping bootstrap family — White's Reality
Check, Hansen's SPA, and Romano-Wolf step-down ([significance]) — and
selection-axis luck control ([selection]).
Design invariants carried over verbatim from the original modules:
- Pure. No I/O, no system clock, no ambient randomness. Any randomness (the significance bootstrap) takes an explicit seed argument.
- Deterministic. Plain
f64math, fixed reduction order, no parallel float sums. The same input yields byte-identical output on any platform. - No
unsafe.
Example: is this Sharpe real?
use ;
// A per-period (NOT annualized) excess-return series.
let returns = ;
let sr = sharpe_ratio; // observed, per-period
let psr = probabilistic_sharpe_ratio; // P(true Sharpe > 0)
// Deflate for the 200 strategies tried, with ~0.5 cross-trial Sharpe dispersion:
let dsr = deflated_sharpe_ratio; // P(skill survives the search)
assert!;
assert!;
assert!;
assert!; // deflating for the search never raises the probability