@williamthorsen/toolbelt.statistics
v0.6.0
Published
Statistics utilities
Readme
@williamthorsen/toolbelt.statistics
Statistics utilities for TypeScript and JavaScript.
Release notes — v0.6.0 (2026-08-08)
Features
Correct standard-deviation semantics in statistics normal-distribution functions (#93)
The
standardDeviationparameter now means the standard deviation throughout the package's normal-distribution functions, where it previously behaved as the variance. Callers who pass the default of 1 see unchanged output; any other value now yields different numbers. A standard deviation of 0 now places all mass at the mean, where it previously spread mass evenly across every interval; an even spread is now what a very large standard deviation approaches.getNormalIntervalProbabilitiesaccepts a new optionalhalfWidththat sizes the window it slices into intervals, defaulting to 3.findDistributionByIntervalProbabilitynow takes its search controls as a second argument and reports whether the search converged, measurestoleranceas a fraction of the target rather than as an absolute difference, and rejects an unreachable target with an error naming the bound it fell outside and the probability reachable there. Both functions now reject any numeric input that is not a finite number, instead of silently returning NaN results.Use underscore separator at 4 digits or more
Changes the
unicorn/numeric-separators-stylerule config so that separators are consistently used in base 10 numbers, instead of exempting numbers of 5 digits or less.
Installation
Requires Node.js 24 or later.
