Class PercentileCalculator

  • All Implemented Interfaces:
    Function<double[],​Double>

    public class PercentileCalculator
    extends Object
    implements Function<double[],​Double>
    For a series of data $x_1, x_2, \dots, x_n$, the percentile is the value $x$ below which a certain percentage of the data fall.
    • Constructor Detail

      • PercentileCalculator

        public PercentileCalculator​(double percentile)
        Parameters:
        percentile - The percentile, must be between 0 and 1
    • Method Detail

      • setPercentile

        public void setPercentile​(double percentile)
        Parameters:
        percentile - The percentile, must be between 0 and 1
      • apply

        public Double apply​(double[] x)
        Specified by:
        apply in interface Function<double[],​Double>
        Parameters:
        x - The data, not null or empty
        Returns:
        The percentile