Documentation of 'com.yahoo.egads.utilities.StatsUtils' Java class
StatsUtils
com.yahoo.egads.utilities

Class StatsUtils



  • public class StatsUtils
    extends java.lang.Object
    Provides convenience methods to return the number, arithmetic mean average, variance, minimum, median and maximum value of a list of values, and other statistical values.

    Additionally, StatsUtils includes methods to get a histogram list approach to the data; each data segment includes the counts of data. For example, [1,4,5,3,1] has five segments with one data value in the first segment and five data values in the third segment.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  StatsUtils.DoubleStats
      Extension of Stats using the double primitive.
      static class  StatsUtils.Stats
      An abstract class that holds the minimum, maximum, median average, quartiles one and three, and second, third and fourth central moments.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.util.List<java.lang.Integer> getHistogram(java.util.List<java.lang.Double> data, int breaks)
      Creates a histogram of the provided data.
      static java.util.List<java.lang.Integer> getHistogramBigInt(java.util.List<java.math.BigInteger> data, int breaks)
      Same as getHistogram but operates on BigIntegers.
      static java.lang.Float getMean(java.lang.Float[] data) 
      static java.lang.Float getSD(java.lang.Float[] data, java.lang.Float mean) 
      static StatsUtils.DoubleStats quickStatsDouble(java.util.List<java.lang.Double> l) 
      static java.util.List<java.lang.Double> rank(java.util.List<java.lang.Double> data) 
      static double[] swilk(java.util.List<java.lang.Double> d)
      Runs the Shapiro-Wilk test on a list of double values.
      • Methods inherited from class java.lang.Object

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

      • getMean

        public static java.lang.Float getMean(java.lang.Float[] data)
      • getSD

        public static java.lang.Float getSD(java.lang.Float[] data,
                                            java.lang.Float mean)
      • quickStatsDouble

        public static StatsUtils.DoubleStats quickStatsDouble(java.util.List<java.lang.Double> l)
        Returns:
        the number, average, variance, min, median and max of a list of Integers
      • getHistogram

        public static java.util.List<java.lang.Integer> getHistogram(java.util.List<java.lang.Double> data,
                                                                     int breaks)
        Creates a histogram of the provided data.
        Parameters:
        data - list of observations
        breaks - number of breaks in the histogram
        Returns:
        List of integer values size of the breaks
      • getHistogramBigInt

        public static java.util.List<java.lang.Integer> getHistogramBigInt(java.util.List<java.math.BigInteger> data,
                                                                           int breaks)
        Same as getHistogram but operates on BigIntegers.
      • rank

        public static java.util.List<java.lang.Double> rank(java.util.List<java.lang.Double> data)
        Returns:
        list of sample ranks
      • swilk

        public static double[] swilk(java.util.List<java.lang.Double> d)
        Runs the Shapiro-Wilk test on a list of double values.
        Returns:
        an array of size two if everything goes well, or null if there's an error.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.