Class Stats


  • public class Stats
    extends Object
    Simple double statistics, computed incrementally, variance and standard deviation using Welford's online algorithm, see https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm
    Since:
    5.1.9
    • Constructor Detail

      • Stats

        public Stats()
    • Method Detail

      • add

        public void add​(double x)
        Add a value
        Parameters:
        x - value
      • count

        public int count()
        Returns:
        number of the added values
      • min

        public double min()
        Returns:
        minimum of the added values
      • max

        public double max()
        Returns:
        maximum of the added values
      • avg

        public double avg()
        Returns:
        average of the added values
      • var

        public double var()
        Returns:
        variance of the added values
      • stddev

        public double stddev()
        Returns:
        standard deviation of the added values