All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
7.8.7 (2024-10-16)
7.8.6 (2024-10-16)
7.8.5 (2024-08-27)
7.8.4 (2024-08-15)
7.8.3 (2023-02-13)
7.8.2 (2023-01-15)
7.8.1 (2023-01-15)
7.8.0 (2022-10-26)
- Re-add Jenks algorithm (90990cc)
7.7.6 (2022-08-12)
7.7.5 (2022-03-06)
7.7.4 (2022-03-01)
7.7.3 (2022-01-13)
7.7.2 (2022-01-13)
7.7.1 (2022-01-13)
7.7.0 (2021-03-31)
7.6.0 (2021-03-02)
7.5.0 (2021-02-24)
- Add logit and cumulativeStdLogisticProbability methods (7279632)
7.4.1 (2021-02-12)
7.4.0 (2020-12-14)
- Add coefficient of variation (ead74c6)
7.3.2 (2020-10-31)
7.3.1 (2020-10-25)
7.3.0 (2020-09-08)
- Add randomSource argument to permutationTest (#505) (f289fd1)
- Relative error and approximate equality (#506) (88e8794)
7.2.0 (2020-08-23)
7.1.0 (2020-05-06)
- meanSimple method that uses sumSimple for higher performance (8e82333)
7.0.9 (2020-04-20)
7.0.8 (2020-02-03)
7.0.7 (2019-11-18)
7.0.6 (2019-11-15)
7.0.5 (2019-07-10)
7.0.4 (2019-07-10)
7.0.3 (2019-07-10)
- Add --skipLibCheck to make tsc ignore node modules. (089f47a)
7.0.2 (2019-02-26)
7.0.1 (2019-02-07)
7.0.0 (2018-12-30)
- IE11 support is dropped.
6.1.1 (2018-09-24)
- permutationTest: Add TypeScript definition for permutationTest (e7fa9db), closes #298
- array quantile on certain kinds of input (#334) (e9d007e)
6.1.0 (2018-06-23)
- gammaln (9d03631)
6.0.1 (2018-05-11)
6.0.0 (2018-04-30)
- Gamma Function (39c8ecd)
- package.json: simple-statistics is no longer supported as a component module or a bower module. All other forms of support - script tag, unpkg, npm - continue.
5.4.0 (2018-04-21)
- Permutation test (1be011e)
5.3.1 (2018-03-23)
- Someone simple-statistics dependend on itself... (12acd40)
5.3.0 (2018-03-23)
5.2.1 (2017-12-20)
5.2.0 (2017-11-29)
5.1.0 (2017-10-23)
- Add TypeScript definition (688538b)
5.0.1 (2017-10-15)
5.0.0 (2017-09-26)
- simple-statistics now uses ES6 modules internally, and exposes a entry point for other modules to use it as an ES6 module.
This means:
- If you use Rollup or another library that supports the
jsnext:main
ormodule
fields of package.json, you'll likely automatically start using this feature. When you use simple-statistics as an ES6 module,import {min} from "simple-statistics"
and other imports of only a few of its methods will automatically do 'tree-shaking' and only pull in the parts you use (if your bundling tool supports tree-shaking) - Sub-requiring parts of simple-statistics, like
require('simple-statistics/min')
is deprecated and will not work. Its components are now written with ES6 syntax.
4.1.1 (2017-08-05)
- expose BayesianClassifier & PerceptronModel instead of bayesian and perceptron (1d03671)
4.1.0 (2017-04-27)
- sampleKurtosis (1d9eec2)
4.0.0 (2017-04-25)
- binomialDistribution: avoid expensive factorial calculations (#205) (525f9c0)
- core: Improve performance of min, max, sumNthPowerDeviations, variance, sampleVariance (#195) (9d2569a)
- distributions: return array instead of object (#209) (6c5df5f)
- poissonDistribution: avoid expensive factorial calculation (#206) (b34aceb)
- poissonDistribution: use Math.exp instead of Math.pow (#208) (6491dfa)
- sampleSkewness: Improve sampleSkewness performance (#197) (03d37eb)
- sum: Switch from Kahan to Kahan-Babuska algorithm (1b42d7f)
- Removes .mixin(). Instead use simple-statistics in a functional style.
- distributions: The return value of bernoulliDistribution, binomialDistribution, and poissonDistribution is no longer an Object with number keys, it is now an Array of numbers.
3.0.0 (2017-04-06)
Breaking change: before this release, simple-statistics would return NaN
when provided with invalid input. After 3.0.0, simple-statistics will throw
exceptions when provided with invalid input. If you previously used isNaN
to
test for these error cases, switch to using try
and catch
, or make sure
that valid input is given to simple-statistics.
- mean: combineMeans, a method for combining calculated means (d9e3ebc)
- mean: subtractFromMean, a method to remove a value from the mean (afe76e9)
- variance: combineVariances, a method for combining pre-calculated variances of two dataset (68133f7)
2.5.0 (2017-02-24)
- mean: addToMean, a method to update an mean with a new element (b6637b4)
2.4.0 (2017-02-22)
- build: Ignore conventional-changelog-core for Flow (4874868)
- mode: Implement modeFast, an indexed mode implementation (#183) (59b7191)
2.3.0 (2017-02-17)
- core: sampleWithReplacement (#174) (a8d05d1)
- Improved Ckmeans algorithm from the updated R project that dramatically increases performance.
- Adds
permutationHeap
method for computing all permutations of an array. - Adds
combinations
for combinations without replacement - Adds
combinationsReplacement
for combinations with replacement
- Adds
bisect
method that implements the bisection method for root-finding. Thanks Jamie Neubert Pedersen for the contribution!
New features:
product
: returns the product of a series of numbersmedianSorted
: exposes the internal method ofmedian
that only operates on sorted arrays and works in constant timemodeSorted
: exposes the internal method ofmode
and works in linear time.
Specifications:
- Adds Flow annotations to all methods, allowing up-front typechecking if you use Flow in your application.
Changes:
- Invalid input now uniformly produces the value
NaN
instead of previously a mix ofnull
andundefined
. - The method
sortedUniqueCount
is now calleduniqueCountSorted
to match the other sorted methods,medianSorted
andmodeSorted
Fixes:
equalIntervalBreaks
was not exported byindex.js
, and now is.
Fixes:
- Fixes to ckmeans algorithm (thanks to @llimllib) (#125)
Housekeeping:
- Add keywords to package. Fixes #120
- Standardize indentation, add example for epsilon
- Browser testing with Sauce Labs
Bundle size optimizations:
- Add external sourcemaps for minified and unminified standalone bundles
- Use bundle-collapser for smaller bundles
- Indicate numericSort as an internal method.
- Removed the .m() and .b() shortcuts from the linear regression
class. Use
.mb().b
and.mb().m
instead. - linearRegression is now a function, and linearRegressionLine is a separate function.
UPGRADING
Before:
var l = ss.linear_regression().data([[0, 0], [1, 1]]);
l.line()(0); // 0
After:
var line = ss.linearRegressionLine(ss.linearRegression([[0, 0], [1, 1]]));
line(0); // 0
The implementation of Jenks natural breaks was removed: an implementation of Ckmeans, an improvement on its technique, is added. Ckmeans should work better for nearly all Jenks usecases.
Before:
ss.jenks([1, 2, 4, 5, 7, 9, 10, 20], 3) //= [1, 7, 20, 20]
After:
ss.ckmeans([1, 2, 4, 5, 7, 9, 10, 20], 3))
[ [ 1,
2,
4,
5,
7,
9 ],
[ 10 ],
[ 20 ] ]
Instead of class breaks, ckmeans returns clustered data. Class breaks can be derived by taking the first value from each cluster:
var breaks = ss.ckmeans([1, 2, 4, 5, 7, 9, 10, 20], 3)).map(function(cluster) {
return cluster[0];
});
BayesModel
is now a classPerceptronModel
is now a class, and theweights
andbias
members are accessable as properties rather than methods.- All multi-word method names are now camelCase rather than underscore_cased:
this means that a method like
ss.r_squared
is now accessible asss.rSquared
- Ckmeans replaces Jenks
sortedUniqueCount
provides an extremely fast method for counting unique values of sorted arrays.sumNthPowerDeviations
is now exposed, providing a simple way to calculate the fundamental aspect of measures like variance and skewness.
- JSDoc documentation throughout
- Each function is now its own file, and simple-statistics is assembled with CommonJS-style require() statements. simple-statistics can still be used in a browser with browserify.
- The standard normal table is now calculated using the cumulative distribution function, rather than hardcoded.
- Improved test coverage
- Switched linting from JSHint to eslint and fixed style issues this uncovered.
- Fixes
.jenks
corner cases.
- Adds
.sample
for simple random sampling - Adds
.shuffle
and.shuffleInPlace
for random permutations - Adds
.chunk
for splitting arrays into chunked subsets
- fixes a bug in
mode
that favored the last new number
mixin
can now take an array in order to mixin functions into a single array instance rather than the global Array prototype.
- Adds
simple_statistics.harmonicMean
thanks to jseppi
- Adds
simple_statistics.quantileSorted
thanks to rluta simple_statistics.quantile
now accepts a sorted list of quantiles as a second argument- Improved test coverage
- Adds
simple_statistics.cumulativeStdNormalProbability
by doronlinder - Adds
simple_statistics.zScore
by doronlinder - Adds
simple_statistics.standardNormalTable
- Adds
simple_statistics.median_absolute_deviation()
by siculars - Adds
simple_statistics.iqr()
by siculars - Adds
simple_statistics.skewness()
by Doron Linder - Lower-level accessors for linear regression allow users to do the line equation themselves
- Adds
simple_statistics.jenks()
- Adds
simple_statistics.jenksMatrices()
- Improves test coverage and validation
- Adds
simple_statistics.quantile()
- Adds
simple_statistics.mixin()
- Adds
simple_statistics.geometricMean()
- Adds
simple_statistics.sampleVariance()
- Adds
simple_statistics.sampleCovariance()
- Adds
simple_statistics.tTest()
- Adds
simple_statistics.min()
- Adds
simple_statistics.max()