/** * The statistics the run review stands on (DES-RUNS-REVIEW-001 ยง4). Pure and deterministic: the same inputs give * the same numbers, byte for byte, so a review can be re-derived. * * - Rates: Wilson score interval (95 %), which stays inside [0, 1] and is honest at small n. * - Long-tailed data (durations, spend, retries): the median and percentiles, never the mean. The interval is a * bootstrap 95 % CI of the median: 1,000 resamples from a SEEDED generator (mulberry32), so it is reproducible. * - Below {@link MIN_SAMPLE} no trend is called: the comparison says "too few runs to tell". */ /** The smallest sample a trend may be called on, in the window and in the baseline. */ export declare const MIN_SAMPLE = 5; export declare const BOOTSTRAP_RESAMPLES = 1000; export interface Interval { lo: number; hi: number; } /** Wilson score interval for `successes` of `n` (95 %). `null` when n is 0. */ export declare function wilson(successes: number, n: number, z?: number): Interval | null; /** Linear-interpolated percentile (q in [0, 1]) of an ALREADY SORTED array. `null` when empty. */ export declare function percentileSorted(sorted: readonly number[], q: number): number | null; export declare function sortedCopy(values: readonly number[]): number[]; export declare function median(values: readonly number[]): number | null; /** mulberry32: a small, well-mixed 32-bit PRNG. Seeded, so every bootstrap is reproducible. */ export declare function mulberry32(seed: number): () => number; /** A stable 32-bit seed from a label (FNV-1a), so each metric's bootstrap has its own reproducible stream. */ export declare function seedOf(label: string): number; /** Bootstrap 95 % percentile CI of the median. `null` when empty. */ export declare function bootstrapMedianCI(values: readonly number[], seed: number, resamples?: number): Interval | null; /** What a comparison against the baseline concluded. */ export type Verdict = 'too-few' | 'no-change' | 'improved' | 'regressed'; /** * Compare a window value (with its interval) against a baseline point value. Notable only when BOTH samples reach * {@link MIN_SAMPLE} and the window's interval EXCLUDES the baseline value. `higherIsBetter` gives the direction. */ export declare function compare(windowN: number, windowInterval: Interval | null, baselineN: number, baselineValue: number | null, higherIsBetter: boolean): Verdict; /** Round for display and storage (a review is read by people; 4 significant decimals are plenty). */ export declare function round(v: number | null, places?: number): number | null; //# sourceMappingURL=stats.d.ts.map