npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@danielsimonjr/mathts-statistics

v0.3.46

Published

Statistics & probability for MathTS — descriptive stats, distributions, hypothesis tests, and combinatorics, every function externally oracle-pinned (SciPy/NumPy/closed-form)

Readme

@danielsimonjr/mathts-statistics

Statistics & probability for MathTS — a focused, standalone library covering descriptive statistics, probability distributions, hypothesis tests, and combinatorics.

The implementations live in @danielsimonjr/mathts-functions and are re-exported here, not duplicated — this package is a curated entry point over the statistics/probability surface. Every function is externally oracle-pinned (SciPy / NumPy / mpmath / closed form) in the functions package's test suite, so the numbers are trustworthy, not just green.

Install

npm install @danielsimonjr/mathts-statistics

What's included

  • Descriptive statisticsmean, median, mode, variance, std, quantileSeq, mad, iqr, sem, zscore, moment, skewness, kurtosis, gmean, hmean, cov, corr, corrcoef, rankdata, and the three correlation coefficients corr (Pearson), spearman, kendallTau (τ_b).
  • Parallel-first reductions — worker-pool-accelerated parallelStat* (Mean, Variance, Std, Median, Quantile, Histogram, Corr, …) plus quickSelect/medianSelect.
  • Probability distributions — 14 distribution objects with .pdf/.cdf/.quantile/.mean/.variance/.sample (normalDist, gammaDist, betaDist, binomialDist, poissonDist, exponentialDist, chiSquaredDist, fDist, tDist, logNormalDist, uniformDist, weibullDist, hypergeometricDist, negativeBinomialDist), plus free CDF/quantile functions and the entropy/jsDivergence divergences.
  • Hypothesis testsstudentTTest (one/two-sample), studentTTestPaired, anova, chiSquareTest, kolmogorovSmirnovTest (one-sample) + kolmogorovSmirnov2Test (two-sample), mannWhitneyTest, shapiroWilkTest, leveneTest, bartlettTest, proportionZTest, binomialTest, fTest, jarqueBera, kruskalWallis, wilcoxon, fisherExact, tukeyHSD, principalComponentAnalysis.
  • Probability & combinatoricscombinations, permutations, multinomial, factorial, doubleFactorial, risingFactorial, fallingFactorial, subfactorial, bernoulli, gamma, lgamma, kldivergence, and seedable RNG (random, randomInt, pickRandom, seedProbabilityRng).

Example

import {
  anova,
  kendallTau,
  hypergeometricDist,
  kolmogorovSmirnov2Test,
} from '@danielsimonjr/mathts-statistics';

anova([
  [8.1, 8.3, 7.9],
  [9.1, 9.5, 8.9],
]); // one-way ANOVA F + p
kendallTau([1, 2, 3, 4, 5], [2, 1, 4, 3, 5]); // 0.6
hypergeometricDist(50, 5, 10).pmf(1); // 0.4313371972
kolmogorovSmirnov2Test([1, 2, 3], [2, 3, 4]); // { statistic, pValue }

License

MIT