https://github.com/simple-statistics/simple-statistics
simple statistics for node & browser javascript
https://github.com/simple-statistics/simple-statistics
javascript math regression statistics
Last synced: about 1 month ago
JSON representation
simple statistics for node & browser javascript
- Host: GitHub
- URL: https://github.com/simple-statistics/simple-statistics
- Owner: simple-statistics
- License: isc
- Created: 2012-02-08T18:29:54.000Z (almost 15 years ago)
- Default Branch: main
- Last Pushed: 2026-10-14T14:10:10.000Z (about 1 month ago)
- Last Synced: 2026-10-15T19:05:17.181Z (about 1 month ago)
- Topics: javascript, math, regression, statistics
- Language: JavaScript
- Homepage: https://simple-statistics.github.io/
- Size: 3.63 MB
- Stars: 3,527
- Watchers: 50
- Forks: 240
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
- fucking-awesome-machine-learning - simple-statistics - A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in Node.js. (JavaScript)
- awesome-machine-learning - simple-statistics - A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in Node.js. (JavaScript)
- awesome-machine-learning - simple-statistics - A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in Node.js. (Javascript)
- awesome-starred - simple-statistics/simple-statistics - simple statistics for node & browser javascript (javascript)
- awesome-machine-learning - simple-statistics - A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in Node.js. (JavaScript / [Tools](#tools-1))
- awesome-machine-learning - simple-statistics - A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in Node.js. (Javascript / Speech Recognition)
- awesome-machine-learning - simple-statistics - A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in Node.js. (JavaScript)
- awesome-javascript - simple-statistics/simple-statistics - simple statistics for node & browser javascript (Science and Math / Mathematics)
- awesome-machine-learning - simple-statistics - A JavaScript implementation of descriptive, regression, and inference statistics. Implemented in literate JavaScript with no dependencies, designed to work in all modern browsers (including IE) as well as in Node.js. (JavaScript / [Tools](#tools-1))
- awesome-javascript-data-science - Simple Statistics - A JavaScript implementation of descriptive, regression, and inference statistics. (Math and Statistics)
- awesome-javascript-libraries - simple-statistics/simple-statistics - simple statistics for node & browser javascript (Uncategorized / Uncategorized)
README
# Simple Statistics
A JavaScript implementation of descriptive, regression, and inference statistics.
Implemented in literate JavaScript with no dependencies, designed to work
in all modern browsers (including IE) as well as in [node.js](https://nodejs.org/).
* :green_book: [API Documentation](https://simple-statistics.github.io/)
* :chart_with_upwards_trend: [Benchmarks](./benchmarks/)
* :kissing: [A list of other statistics libraries](./SEEALSO.md)
## Installation
* **I'm using Node.js, Webpack, Browserify, Rollup, or another module bundler,
and install packages from npm.**
* First, install the `simple-statistics` module, using `npm install simple-statistics`,
then include the code with require or import:
* **I use the `require` function to use modules in my project. (most likely)**
* When you use `require`, you have the freedom to assign the module to any
variable name you want, but you need to specify the module's name exactly:
in this case, 'simple-statistics'. The `require` method returns an object
with all of the module's methods attached to it.
var ss = require('simple-statistics')
* **I use `import` to use modules in my project. I'm probably using Babel, `@std/esm`, Webpack, or Rollup.**
* Import all functions under the ss object: import * as ss from 'simple-statistics'
Include a specific named export: import {min} from 'simple-statistics'
Simple statistics has _only_ named exports for ES6.
* **I'm using Deno.**
* We recommend using Deno's first-class [NPM compatibility](https://docs.deno.com/runtime/fundamentals/node/) to use simple-statistics from NPM: you'll need to import it as `npm:simple-statistics`.
* **I'm not using a module bundler. I'm writing a web page, and want to include
simple-statistics using a script tag.**
* **I want to support all browsers**
* When you use simple-statistics from a script tag, you don't get to choose
the variable name it is assigned to: simple-statistics will always become
available globally as the variable `ss`. You can reassign this variable to
another name if you want to, but doing so is optional.
```HTML
```
* **I want to use ES6 modules in a browser and I'm [willing to only support new browsers](https://caniuse.com/#feat=es6-module) to do it**
* This module works great with the [`?module`](https://unpkg.com/#/query-parameters) query parameter of unpkg. If you
specify `type='module'` in your script tag, you'll be able to import simple-statistics
directly - through `index.js` and with true [ES6 import syntax and behavior](http://exploringjs.com/es6/ch_modules.html).
```js
import {min} from "https://unpkg.com/simple-statistics@7.12.1/index.js?module"
console.log(min([1, 2, 3]))
```
This feature is still experimental in unpkg and very bleeding-edge.