stats

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Z-distribution confidence values
	Z90  = 1.645
	Z95  = 1.96
	Z98  = 2.326
	Z99  = 2.576
	Z999 = 3.291 // 99.9%
)
View Source
const (
	Epsilon = 1e-6
)

Variables

This section is empty.

Functions

func BinomialZTestPValue added in v0.13.0

func BinomialZTestPValue(wins, total float64) float64

BinomialZTestPValue returns the two-sided p-value for testing whether the win rate equals 0.5 (null hypothesis: both players are equally strong). wins and total are float64 to support half-wins from draws.

func FuzzyEqual added in v0.8.7

func FuzzyEqual(a, b float64) bool

func NormalCDF added in v0.13.0

func NormalCDF(x float64) float64

NormalCDF returns the cumulative distribution function of the standard normal distribution.

func PairedZTestPValue added in v0.13.0

func PairedZTestPValue(meanDiff, stdevDiff float64, n int) float64

PairedZTestPValue returns the two-sided p-value for testing whether the mean paired difference equals zero. Uses a z-test (appropriate for large n).

Types

type Statistic

type Statistic struct {
	// contains filtered or unexported fields
}

Statistic contains statistics per move

func (*Statistic) Iterations

func (s *Statistic) Iterations() int

func (*Statistic) Last

func (s *Statistic) Last() float64

func (*Statistic) Mean

func (s *Statistic) Mean() float64

func (*Statistic) Push

func (s *Statistic) Push(val float64)

func (*Statistic) Reset added in v0.9.4

func (a *Statistic) Reset()

func (*Statistic) StandardError

func (s *Statistic) StandardError() float64

StandardError returns the standard error of the statistic.

func (*Statistic) Stdev

func (s *Statistic) Stdev() float64

func (*Statistic) Variance

func (s *Statistic) Variance() float64

Jump to

Keyboard shortcuts

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