-
Notifications
You must be signed in to change notification settings - Fork 11
Possible bug in quantiles? #9
Comments
Very possible. This implementation uses an old, buggy algorithm from an early version of the t-digest paper; that algorithm suffers instabilities under high compression (see tdunning/t-digest#78). The new "merging" t-digest algorithm is supposed to fix this, but I haven't gotten around to implementing it. |
@nathanielc and I have been working on a different go client based on the merging here: Is this useful to you? |
That looks excellent! How stable and tested is your implementation? I should take a look at the source, but if you have a merging implementation already, I'd happily point people towards it, if you think it's reliable enough for heavy use. Thank you for making the API very similar to that of github.com/spenczar/tdigest, it should make it simple for people to migrate. |
Right on! We'd like to get a lot more testing in first. Specifically, we want to use similar tests to the java implementation (influxdata/tdigest#5) We are adding it to our next-generation query language here: https://github.com/influxdata/ifql/pull/234 This will allow us to stress it greatly in the coming weeks. |
Sounds great - and especially happy to hear you will replicate the Java implementation's test suite. Once you feel comfortable, please check back in here. Then, I'll put a loud notice on the README that there's a better thing out there with a similar API. |
Great... btw, LOVE twirp! |
what's the latest? |
@Dieterbe we haven't swapped out the Java tests or anything yet, but we have been using https://github.com/influxdata/tdigest for a year now without issue. |
func TestQuantile100(t *testing.T) {
d := New()
d.Add(1, 98)
d.Add(100, 2)
if d.Quantile(0.99) != 100 {
t.Errorf("TDigest.quantile wrong, have=%.3f, want=%.3f", d.Quantile(0.99), 100.0)
}
} Fails: TDigest.quantile wrong, have=100.960, want=100.000 |
Hello from the future, would you recommend using influxdata version at this point? |
@eric-burel Yeah, I probably would. They're using it in production and for a pretty well-supported product. I'll archive this repo and point people that way. |
Hey there, I'm using
The results are:
However, I think the results should be:
The text was updated successfully, but these errors were encountered: