Package com.flaptor.hist4j


package com.flaptor.hist4j
A histogram that adapts its buckets to the distribution of the data.

The histogram keeps a nearly constant resolution across the data range. It uses more buckets where the values are dense, and fewer where they are sparse. A logic uses it to count values, and to find the value at a given percentile, such as a median price.

Entry point: PublicGroovyAPI.newAdaptiveHistogram().


 def histogram = api.newAdaptiveHistogram()
 [12.5, 14.0, 13.2, 98.0].each { histogram.addValue(it) }
 def median = histogram.getValueForPercentile(50)
 

Reference

  • AdaptiveHistogram counts the values it holds, and finds the value at a given percentile.