Class Statistics


  • public class Statistics
    extends java.lang.Object
    Statistic Utility
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double average​(double[] arr)
      Calculate the average of an array of values.
      static double median​(double[] arr)
      Calculate the median of an array of values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • median

        public static double median​(double[] arr)
        Calculate the median of an array of values.
        Parameters:
        arr - Array of values
        Returns:
        {double} Returns NaN if the array is empty
      • average

        public static double average​(double[] arr)
        Calculate the average of an array of values.
        Parameters:
        arr - Array of values
        Returns:
        {double}