Code Monkey home page Code Monkey logo

hdrhist's People

Contributors

lorenzomartini avatar utaal avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

hdrhist's Issues

Summary function returns results from wrong buckets

The current implementation of the summary() function returns pairs (quantile, value) that are not correct, namely the value returned is the value corresponding to the next bucket. Here more precise example:

If we create a simple HDRHist with as input the following values, repeated each n_times times (tot number of values = 10001):

n_times  value
2400       1       // 100% >= 1  -- 0% < 1
200        2       //  76% >= 2  -- 24% < 2
7400       3       //  74% >= 3  -- 26% < 3   ---> 3 is the 25p
1          5       //0.01% >= 5

CCDF output for this hist from HDRHist is:

value      freq     n_samples
2	    1	        2400     // 100% of values is >= 1, 2400 elements in bucket [1,2[
3	    0.76         200     // 76% of values is >= 2, 200 elements in bucket [2,3[
4	    0.74        7400     // 74% of values is >= 3, 7400 elements in bucket [3,4[
5	    0.0001	   0
6	    0.0001	   1     // 0.0001% of values is >= 5, 1 elements in bucket [5,6[
7	    0.00009        0     // this value is IMO completely redundant

It's clear now that the 25p (0.25q) is the value 3, since we know that 26% of results is < 3 (meaning that also 25% is less than 3). However, in the current implementation of summary(), we will go over our ccdf iterator and pick up the first elements such that element.frequency <= 0.75, and this will make us pick the value 4 instead of the value 3.
We should instead pick up the value from the previous element in the ccdf iterator.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.