Class HistogramDensity

  • All Implemented Interfaces:
    EmpiricalDensity

    public final class HistogramDensity
    extends Object
    implements EmpiricalDensity
    Represents an empirical density function built from a histogram, which can represent arbitrary univariate distributions.
    • Constructor Detail

      • HistogramDensity

        public HistogramDensity​(List<Interval<Double>> intervals,
                                List<Double> intervalCounts)
        Constructs an empirical density function.
        Parameters:
        intervals - The intervals making up the approximate density.
        intervalCounts - The number of elements in each interval.
    • Method Detail

      • inverseCdf

        public double inverseCdf​(double probability)
        Calculates an approximate value for the inverse cumulative distribution function.
        Specified by:
        inverseCdf in interface EmpiricalDensity
        Parameters:
        probability - The probability p at which to return x when p = Cdf(x) .
        Returns:
        The approximate inverse cdf.
      • getItems

        public List<HistogramDensityItem> getItems()
        The collection of intervals and their statistics making up the histogram density.
      • cdf

        public double cdf​(double x)
        Calculates an approximate value for cdf(x).
        Specified by:
        cdf in interface EmpiricalDensity
        Parameters:
        x - The value at which to evaluate the cdf.
        Returns:
        The approximate cdf(x).