{"id":13426332,"url":"https://github.com/winkjs/wink-statistics","last_synced_at":"2025-07-25T16:10:32.743Z","repository":{"id":44994074,"uuid":"96005860","full_name":"winkjs/wink-statistics","owner":"winkjs","description":"Fast \u0026 numerically stable statistical analysis","archived":false,"fork":false,"pushed_at":"2023-01-06T01:32:07.000Z","size":2318,"stargazers_count":46,"open_issues_count":10,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-10T13:07:50.851Z","etag":null,"topics":["covariance","hactoberfest","probability","real-time","regression","statistical-analysis","statistics","stats","streaming"],"latest_commit_sha":null,"homepage":"http://winkjs.org/wink-statistics/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/winkjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-02T06:12:32.000Z","updated_at":"2024-02-23T19:57:52.000Z","dependencies_parsed_at":"2023-02-05T01:30:53.925Z","dependency_job_id":null,"html_url":"https://github.com/winkjs/wink-statistics","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/winkjs/wink-statistics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkjs%2Fwink-statistics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkjs%2Fwink-statistics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkjs%2Fwink-statistics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkjs%2Fwink-statistics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/winkjs","download_url":"https://codeload.github.com/winkjs/wink-statistics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/winkjs%2Fwink-statistics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267029422,"owners_count":24024202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["covariance","hactoberfest","probability","real-time","regression","statistical-analysis","statistics","stats","streaming"],"created_at":"2024-07-31T00:01:32.095Z","updated_at":"2025-07-25T16:10:32.718Z","avatar_url":"https://github.com/winkjs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# wink-statistics\n\nFast and Numerically Stable Statistical Analysis Utilities\n\n### [![Build Status](https://api.travis-ci.org/winkjs/wink-statistics.svg?branch=master)](https://travis-ci.org/winkjs/wink-statistics) [![Coverage Status](https://coveralls.io/repos/github/winkjs/wink-statistics/badge.svg?branch=master)](https://coveralls.io/github/winkjs/wink-statistics?branch=master) [![Inline docs](https://inch-ci.org/github/winkjs/wink-statistics.svg?branch=master)](https://inch-ci.org/github/winkjs/wink-statistics) [![dependencies Status](https://david-dm.org/winkjs/wink-statistics/status.svg)](https://david-dm.org/winkjs/wink-statistics) [![devDependencies Status](https://david-dm.org/winkjs/wink-statistics/dev-status.svg)](https://david-dm.org/winkjs/wink-statistics?type=dev) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/winkjs/Lobby)\n\n[\u003cimg align=\"right\" src=\"https://decisively.github.io/wink-logos/logo-title.png\" width=\"100px\" \u003e](https://winkjs.org/)\n\nPerform fast and numerically stable statistical analysis using **`wink-statistics`**. It can handle **real-time stream of data** and can incrementally compute required statistic that usually would take more than one pass over the data as in standard deviation or simple linear regression.\n\n### Functions\n1. [Boxplot](https://winkjs.org/wink-statistics/data.html#.boxplot)\n1. [Covariance](https://winkjs.org/wink-statistics/streaming.html#covariance)\n1. [Difference with definable lag](https://winkjs.org/wink-statistics/data.html#.difference)\n1. [Five Number Summary](https://winkjs.org/wink-statistics/data.html#.fiveNumSummary)\n1. [Frequency Table](https://winkjs.org/wink-statistics/streaming.html#freqTable)\n1. [Histogram](https://winkjs.org/wink-statistics/data.html#.histogram)\n1. [Median Absolute Deviation (MAD)](https://winkjs.org/wink-statistics/data.html#.mad)\n1. [Maximum](https://winkjs.org/wink-statistics/streaming.html#max)\n1. [Mean](https://winkjs.org/wink-statistics/streaming.html#mean)\n1. [Median](https://winkjs.org/wink-statistics/data.html#.median)\n1. [Minimum](https://winkjs.org/wink-statistics/streaming.html#min)\n1. [Numerically stable sum](https://winkjs.org/wink-statistics/streaming.html#sum)\n1. [Percentile](https://winkjs.org/wink-statistics/data.html#.percentile)\n1. [Probability computation \u0026 CI from successes count](https://winkjs.org/wink-statistics/probability.html#.range4CI)\n1. [Probability  estimates aggregation](https://winkjs.org/wink-statistics/probability.html#.aggregate)\n1. [Simple Linear Regression](https://winkjs.org/wink-statistics/streaming.html#simpleLinearRegression)\n1. [Standard Deviation](https://winkjs.org/wink-statistics/streaming.html#stdev)\n1. [Summary statistics](https://winkjs.org/wink-statistics/streaming.html#summary)\n\n\n## Installation\n\nUse [npm](https://www.npmjs.com/package/wink-statistics) to install:\n\n    npm install wink-statistics --save\n\n## Getting Started\n\n### Handling Streams\nHere is an example of computing `slope`, `intercept` and `r2` etc. from a stream of `(x, y)` data in real-time:\n```javascript\n// Load wink-statistics.\nvar stats = require( 'wink-statistics' );\n// Instantiate streaming simple linear regression\nvar regression = stats.streaming.simpleLinearRegression();\n// Following would be ideally placed within a stream of data:\nregression.compute( 10, 80 );\nregression.compute( 15, 75 );\nregression.compute( 16, 65 );\nregression.compute( 18, 50 );\nregression.compute( 21, 45 );\nregression.compute( 30, 30 );\nregression.compute( 36, 18 );\nregression.compute( 40, 9 );\n// Use result() method to access the outcome in real time.\nregression.result();\n// returns { slope: -2.3621,\n//   intercept: 101.4188,\n//   r: -0.9766,\n//   r2: 0.9537,\n//   se: 5.624,\n//   size: 8\n// }\n```\n\n### Handling data array\nThe functions under the `data` name space require data in an array. Here is an example of boxplot analysis:\n\n```javascript\nvar boxplot = stats.data.boxplot;\nvar data = [\n  -12, 14, 14, 14, 16, 18, 20, 20, 21, 23, 27, 27, 27, 29, 31,\n  31, 32, 32, 34, 36, 40, 40, 40, 40, 40, 42, 51, 56, 60, 88\n];\n\nboxplot( data );\n// returns {\n//   min: -12, q1: 20, median: 31, q3: 40, max: 88,\n//   iqr: 20, range: 100, size: 30,\n//   leftOutliers: { begin: 0, end: 0, count: 1, fence: 14 },\n//   rightOutliers: { begin: 29, end: 29, count: 1, fence: 60 },\n//   leftNotch: 25.230655727612252,\n//   rightNotch: 36.76934427238775\n// }\n```\n\n`wink-stats` can handle data in different formats to avoid pre-processing. For example,  you can compute median from the array of objects containing value:\n\n```javascript\nvar median = stats.data.median;\nvar data =  [\n  { value: 1 },\n  { value: 1 },\n  { value: 2 },\n  { value: 2 },\n  { value: 3 },\n  { value: 3 },\n  { value: 4 },\n  { value: 4 }\n];\n// Use key name — `value` as the `accessor`\nmedian( data, 'value' );\n// returns 2.5\n```\n\nIt even supports passing functions as `accessors` to handle even more complex data structures.\n\n## Documentation\nCheck out the [statistics API documentation](https://winkjs.org/wink-statistics/) to learn more.\n\n## Need Help?\n\nIf you spot a bug and the same has not yet been reported, raise a new [issue](https://github.com/winkjs/wink-statistics/issues) or consider fixing it and sending a pull request.\n\n## About wink\n[Wink](https://winkjs.org/) is a family of open source packages for **Statistical Analysis**, **Natural Language Processing** and **Machine Learning** in NodeJS. The code is **thoroughly documented** for easy human comprehension and has a **test coverage of ~100%** for reliability to build production grade solutions.\n\n## Copyright \u0026 License\n\n**wink-statistics** is copyright 2017-20 [GRAYPE Systems Private Limited](https://graype.in/).\n\nIt is licensed under the terms of the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinkjs%2Fwink-statistics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinkjs%2Fwink-statistics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinkjs%2Fwink-statistics/lists"}