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

jstat

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstat

Statistical Library for JavaScript

  • 1.9.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
219K
increased by6.47%
Maintainers
1
Weekly downloads
 
Created

What is jstat?

The jStat npm package is a JavaScript statistical library that provides a wide range of statistical functions and utilities. It is designed to perform various statistical operations such as probability distributions, descriptive statistics, hypothesis testing, and linear regression.

What are jstat's main functionalities?

Descriptive Statistics

This feature allows you to calculate basic descriptive statistics such as mean, median, and variance for a given dataset.

const jStat = require('jstat');
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const mean = jStat.mean(data);
const median = jStat.median(data);
const variance = jStat.variance(data);
console.log(`Mean: ${mean}, Median: ${median}, Variance: ${variance}`);

Probability Distributions

This feature provides functions to work with various probability distributions, including normal, binomial, and Poisson distributions. You can calculate the probability density function (PDF) and cumulative distribution function (CDF) for these distributions.

const jStat = require('jstat');
const normalDist = jStat.normal(0, 1);
const pdf = normalDist.pdf(0);
const cdf = normalDist.cdf(0);
console.log(`PDF at 0: ${pdf}, CDF at 0: ${cdf}`);

Hypothesis Testing

This feature allows you to perform various hypothesis tests, such as t-tests, to determine if there are significant differences between datasets.

const jStat = require('jstat');
const sample1 = [1, 2, 3, 4, 5];
const sample2 = [2, 3, 4, 5, 6];
const tTest = jStat.ttest(sample1, sample2, 2);
console.log(`T-test result: ${tTest}`);

Linear Regression

This feature provides tools for performing linear regression analysis, allowing you to model the relationship between dependent and independent variables.

const jStat = require('jstat');
const x = [1, 2, 3, 4, 5];
const y = [2, 3, 5, 7, 11];
const slope = jStat.models.ols(y, x).beta[1];
const intercept = jStat.models.ols(y, x).beta[0];
console.log(`Slope: ${slope}, Intercept: ${intercept}`);

Other packages similar to jstat

FAQs

Package last updated on 21 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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