Skip to content
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

Wrong result #1

Open
Allineer opened this issue Jul 22, 2020 · 1 comment
Open

Wrong result #1

Allineer opened this issue Jul 22, 2020 · 1 comment

Comments

@Allineer
Copy link

Allineer commented Jul 22, 2020

Hello!

example:

invariants = [(0.50, 0.05), (0.90, 0.01), (0.99, 0.001)]
estimator = QuantileEstimator(*invariants)
for i in range(0, 100):
    estimator.observe(i)
for quantile, _ in invariants:
    print(quantile, "=", estimator.query(quantile))

result:

0.50 = 25
0.90 = 45
0.99 = 50

expected something like:

0.50 = 50
0.90 = 90
0.99 = 99

@matttproud, where am I wrong? Or am I not wrong?
Thanks.

@antonmyronyuk
Copy link

Hello, are you sure you are using proper version of lib? Original lib does not have QuantileEstimator class.

I've tried to run this code snippet and have received:

0.5 = 54
0.9 = 90
0.99 = 99

Results are correct
54 for 0.5 percentile is in range of allowed inaccuracy (5%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants