Enum Percentile.Type

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Percentile.Type>
    Enclosing class:
    Percentile

    public static enum Percentile.Type
    extends java.lang.Enum<Percentile.Type>
    Type of Rank to percentile to calculate.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      EXCLUSIVE
      Excludes end points.
      INCLUSIVE
      Includes end points.
      MEDIAN
      Percentile of i-th point is (i-1/3)/(n+1/3) * 100%.
      MID
      Mid range, Percentile of i-th point is (i-0.5)/n * 100% so highest and lowest points correspond to (1-0.5)/n-th and (n-.5)/n-th percentiles.
      NEAREST
      Nearest rank, smallest value such that least p% of the data is less than or equal to that value.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Percentile.Type valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Percentile.Type[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NEAREST

        public static final Percentile.Type NEAREST
        Nearest rank, smallest value such that least p% of the data is less than or equal to that value.
      • INCLUSIVE

        public static final Percentile.Type INCLUSIVE
        Includes end points. The percentile of i-th point is (i-1)/(n-1)*100% so the lowest and highest values corresponds to 0-th and 100-th percentiles. Like EXCEL's Percentile method
      • EXCLUSIVE

        public static final Percentile.Type EXCLUSIVE
        Excludes end points. Percentile of i-th point is i/(n+1)*100% so lowest and highest values correspond to 1/(n+1)-th and n/(n+1) percentiles. Like EXCEL's Percentile.EXC method
      • MID

        public static final Percentile.Type MID
        Mid range, Percentile of i-th point is (i-0.5)/n * 100% so highest and lowest points correspond to (1-0.5)/n-th and (n-.5)/n-th percentiles. Like Matlab's prctile method.
      • MEDIAN

        public static final Percentile.Type MEDIAN
        Percentile of i-th point is (i-1/3)/(n+1/3) * 100%. Unbiased estimator see https://www.itl.nist.gov/div898/handbook/prc/section2/prc262.htm
    • Method Detail

      • values

        public static Percentile.Type[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Percentile.Type c : Percentile.Type.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Percentile.Type valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null