{"id":23080607,"url":"https://github.com/chen0040/js-stats","last_synced_at":"2026-04-02T01:50:50.988Z","repository":{"id":57283662,"uuid":"91413161","full_name":"chen0040/js-stats","owner":"chen0040","description":"Package provides the javascript implementation of various statistics and distribution","archived":false,"fork":false,"pushed_at":"2022-08-17T23:54:24.000Z","size":33,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-03T23:47:58.458Z","etag":null,"topics":["chi-square","f-distribution","normal-distribution","statistics","t-distribution"],"latest_commit_sha":null,"homepage":"","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/chen0040.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-16T04:13:44.000Z","updated_at":"2023-08-26T19:37:51.000Z","dependencies_parsed_at":"2022-08-31T16:22:15.198Z","dependency_job_id":null,"html_url":"https://github.com/chen0040/js-stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fjs-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chen0040","download_url":"https://codeload.github.com/chen0040/js-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229964387,"owners_count":18152034,"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","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":["chi-square","f-distribution","normal-distribution","statistics","t-distribution"],"created_at":"2024-12-16T13:15:33.151Z","updated_at":"2026-04-02T01:50:50.947Z","avatar_url":"https://github.com/chen0040.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# js-stats\nPackage provides the implementation of various statistics distribution such as normal distribution, fisher, student-t, and so on\n\n[![Build Status](https://travis-ci.org/chen0040/js-stats.svg?branch=master)](https://travis-ci.org/chen0040/js-stats) [![Coverage Status](https://coveralls.io/repos/github/chen0040/js-stats/badge.svg?branch=master)](https://coveralls.io/github/chen0040/js-stats?branch=master) \n\n# Features\n\n* Normal Distribution\n  \n  - cumulativeProbability(Z)\n  - invCumulativeProbability(p)\n\n* Student's T Distribution\n\n  - cumulativeProbability(t_df)\n  - invCumulativeProbability(p)\n\n* Fisher–Snedecor Distribution\n\n  - cumulativeProbabiliyt(F)\n\n* Chi-Square Distribution\n\n  - cumulativeProbabiliy(ChiSquare)\n\n# Install\n\nRun the following npm command to install\n\n```bash\nnpm install js-stats\n```\n\n# Usage\n\nSample code is available at [playground](https://runkit.com/chen0040/js-stats-playground)\n\n### Using with nodejs\n\n```javascript\njsstats = require('js-stats');\n\n//====================NORMAL DISTRIBUTION====================//\n\nvar mu = 0.0; // mean\nvar sd = 1.0; // standard deviation\nvar normal_distribution = new jsstats.NormalDistribution(mu, sd);\n\nvar X = 10.0; // point estimate value \nvar p = normal_distribution.cumulativeProbability(X); // cumulative probability\n\nvar p = 0.7; // cumulative probability\nvar X = normal_distribution.invCumulativeProbability(p); // point estimate value\n\n//====================T DISTRIBUTION====================//\n\nvar df = 10; // degrees of freedom for t-distribution\nvar t_distribution = new jsstats.TDistribution(df);\n\nvar t_df = 10.0; // point estimate or test statistic\nvar p = t_distribution.cumulativeProbability(t_df); // cumulative probability\n\nvar p = 0.7;\nvar t_df = t_distribution.invCumulativeProbability(p); // point estimate or test statistic\n\n\n//====================F DISTRIBUTION====================//\n\nvar df1 = 10; // degrees of freedom for f-distribution\nvar df2 = 20; // degrees of freedom for f-distribution\nvar f_distribution = new jsstats.FDistribution(df1, df2);\n\nvar F = 10.0; // point estimate or test statistic\nvar p = f_distribution.cumulativeProbability(F); // cumulative probability\n\n\n//====================Chi Square DISTRIBUTION====================//\n\nvar df = 10; // degrees of freedom for cs-distribution\nvar cs_distribution = new jsstats.ChiSquareDistribution(df);\n\nvar X = 10.0; // point estimate or test statistic\nvar p = cs_distribution.cumulativeProbability(X); // cumulative probability\n\n\n\n```\n\n### Using with HTML page\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fjs-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchen0040%2Fjs-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fjs-stats/lists"}