go-statistics documentation
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:
| Page | What it holds |
|---|---|
| Overview | examples with the SciPy call each one is, what is in the package, accuracy, draws and speed in brief |
| Design | one package, distributions written once in standard form, the accuracy techniques, draws, fits, arrays, the three layers of verification |
| Accuracy | how the error is measured against mpmath, the headline per family, where SciPy is more accurate, the negative controls |
| Accuracy table | every function and every region, beside SciPy |
| Draws | per distribution, the draws compared with SciPy’s for the same seed and how many differ |
| Performance and its table | against SciPy’s vectorised calls, and where it is slower and why |
Install
go get github.com/go-statistics/statsThe 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