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

tdigest

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tdigest

javascript implementation of Dunning's T-Digest for streaming quantile approximation

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is tdigest?

The tdigest npm package is a JavaScript implementation of Ted Dunning's t-digest algorithm, which is used for accurate online accumulation of rank-based statistics such as quantiles and cumulative distribution functions (CDFs). It is particularly useful for large-scale data processing where memory efficiency and speed are critical.

What are tdigest's main functionalities?

Creating a t-digest

This feature allows you to create a new t-digest instance, which can then be used to accumulate data and compute statistics.

const TDigest = require('tdigest').TDigest;
const t = new TDigest();

Adding data to the t-digest

This feature allows you to add data points to the t-digest. The t-digest will then use these data points to compute rank-based statistics.

t.push(1.0);
t.push(2.0);
t.push(3.0);

Computing quantiles

This feature allows you to compute quantiles from the data accumulated in the t-digest. For example, you can compute the median (50th percentile) or the 90th percentile.

const q50 = t.percentile(0.5);
const q90 = t.percentile(0.9);

Computing cumulative distribution function (CDF)

This feature allows you to compute the cumulative distribution function (CDF) for a given value. The CDF represents the probability that a random variable takes on a value less than or equal to the given value.

const cdf = t.cdf(2.0);

Other packages similar to tdigest

Keywords

FAQs

Package last updated on 27 May 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