Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-statistics

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-statistics - npm Package Versions

1
68

1.0.0

Diff

Changelog

Source

1.0.0

Breaking Changes

  • 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

Linear Regression

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
Jenks -> ckmeans

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 class
  • PerceptronModel is now a class, and the weights and bias 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 as ss.rSquared

New Features

  • 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.

Non-Breaking Changes

  • 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.
tmcw
published 0.9.2 •

Changelog

Source

0.9.2

  • Improved test coverage
  • Switched linting from JSHint to eslint and fixed style issues this uncovered.
tmcw
published 0.9.1 •

Changelog

Source

0.9.1

  • Fixes .jenks corner cases.
tmcw
published 0.9.0 •

Changelog

Source

0.9.0

  • Adds .sample for simple random sampling
  • Adds .shuffle and .shuffleInPlace for random permutations
  • Adds .chunk for splitting arrays into chunked subsets
tmcw
published 0.8.1 •

Changelog

Source

0.8.1

  • fixes a bug in mode that favored the last new number
tmcw
published 0.8.0 •

Changelog

Source

0.8.0

  • mixin can now take an array in order to mixin functions into a single array instance rather than the global Array prototype.
tmcw
published 0.7.0 •

Changelog

Source

0.7.0

  • Adds simple_statistics.harmonicMean thanks to jseppi
tmcw
published 0.6.0 •

Changelog

Source

0.6.0

  • Adds simple_statistics.quantileSorted thanks to rluta
  • simple_statistics.quantile now accepts a sorted list of quantiles as a second argument
  • Improved test coverage
tmcw
published 0.5.0 •

Changelog

Source

0.5.0

  • Adds simple_statistics.cumulativeStdNormalProbability by doronlinder
  • Adds simple_statistics.zScore by doronlinder
  • Adds simple_statistics.standardNormalTable
tmcw
published 0.4.0 •

Changelog

Source

0.4.0

  • 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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc