stats

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package stats holds the small deterministic statistics skillet tools need. It is a faithful port of the pure functions in cc-thinking-skills' evals/lib/stats.js. Pure: values in, values out, no I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func McNemar added in v0.3.0

func McNemar(improved, regressed int) (stat float64, significant bool)

McNemar runs McNemar's test over paired before/after binary outcomes: improved is the count that flipped fail→pass, regressed the count that flipped pass→fail. It returns the continuity-corrected χ² statistic and whether it clears the χ²(1, .05) critical value. With no discordant pairs there is no evidence of a difference. Pure.

func Wilson

func Wilson(k, n int) (lo, hi float64)

Wilson returns the Wilson score interval [lo, hi] for k successes out of n Bernoulli trials at 95% confidence. It requires 0 <= k <= n. n == 0 returns the maximally-uncertain [0, 1]; otherwise the bounds lie in [0, 1] and bracket k/n. Pure.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL