Skip to content

Wrong result #1

Description

@Allineer

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.

Activity

  1. antonmyronyuk commented on Jul 20, 2022

    @antonmyronyuk

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions