Skip to content

go-statistics documentation

Probability distributions, descriptive statistics and statistical tests in pure Go (CGO=0), on go-ndarray.

go-statistics is probability and statistics in pure Go. Its library, stats, has 32 univariate distributions (24 continuous, 8 discrete) and 3 multivariate ones, each with the methods of SciPy’s frozen distributions; descriptive statistics with NumPy’s quantiles; the statistical tests; the Gaussian kernel density estimate and the bootstrap.

Every distribution function is measured in ULPs against mpmath, with SciPy measured on the same points, and the per-region budgets are enforced by go test on eight architectures. Where the library is less accurate or slower than SciPy, its pages say so.

The pages

The pages under stats are the library’s own documentation — its README.md and docs/ — imported from go-statistics/stats when this site is built, with the text unchanged:

PageWhat it holds
Overviewexamples with the SciPy call each one is, what is in the package, accuracy, draws and speed in brief
Designone package, distributions written once in standard form, the accuracy techniques, draws, fits, arrays, the three layers of verification
Accuracyhow the error is measured against mpmath, the headline per family, where SciPy is more accurate, the negative controls
Accuracy tableevery function and every region, beside SciPy
Drawsper distribution, the draws compared with SciPy’s for the same seed and how many differ
Performance and its tableagainst SciPy’s vectorised calls, and where it is slower and why

Install

go get github.com/go-statistics/stats

The module needs Go 1.27.2 or later and is pure Go (CGO_ENABLED=0).

Built on

go-ndarray (arrays, linear algebra, and random, NumPy’s Generator bit for bit), go-numerics/special and go-numerics/optimize. Results plot with go-plot, and a go-notebook cell can use all of it.

Created on by tannevaled

Modified on by tannevaled