T-Digest algorithm in rust

Build Status codecov

This implementation is following Facebook folly's implementation

Installation

Add this to your Cargo.toml:

toml [dependencies] tdigest = "0.1"

then you are good to go. If you are using Rust 2015 you have to extern crate tdigest to your crate root as well.

Example

```rust use tdigest::TDigest;

let t = TDigest::newwithsize(100); let values: Vec = (1..=1000000).map(f64::from).collect(); let t = t.mergesorted(values); let ans = t.estimatequantile(0.99); let expected: f64 = 990_000.0; let percentage: f64 = (expected - ans).abs() / expected;

assert!(percentage < 0.01); ```