-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
big difference in ArrayDigest vs AVLTreeDigest quantile result #89
Comments
Very good observation. What you are seeing is a serious bug that is related to the handling of duplicate values in the AVLTreeDigest. The ArrayDigest is now deprecated, but the good news is that the new MergingDigest behaves correctly. Here is the new test, similar to what you have, but a bit more extreme: public void testSingletonInACrowd() {
final double compression = 100;
TDigest dist = factory(compression).create();
for (int i = 0; i < 10000; i++) {
dist.add(10);
}
dist.add(20);
dist.compress();
assertEquals(10.0, dist.quantile(0), 0);
assertEquals(10.0, dist.quantile(0.5), 0);
assertEquals(10.0, dist.quantile(0.8), 0);
assertEquals(10.0, dist.quantile(0.9), 0);
assertEquals(10.0, dist.quantile(0.99), 0);
assertEquals(10.0, dist.quantile(0.999), 0);
assertEquals(20.0, dist.quantile(1), 0);
} I think I know a way to make the AVLDigest do the right thing. As I see it, this is a blocking bug for the 3.0 release. The work-around is to use the MergingDigest. |
Thanks! This is very helpful. |
I am going to push this to after the 3.2 release so that 3.2 can go out. |
The new interpolation methods look like they may fix this issue. |
This is half fixed, but I won't finish checking that the fix is complete until after this 3.3 release. |
Hi,
I'm running a very simple simulation and surprisingly found some big difference in quantile result from
ArrayDigest
andAVLTreeDigest
.AVLTreeDigest
is giving less accurate results.Simulation setup:
ArrayDigest
orAVLTreeDigest
with compression = 15Result (from one simulation run, but each run is very close to each other):
ArrayDigest:
AVLTreeDigest:
Is this expected?
Code can be found here
The text was updated successfully, but these errors were encountered: