Class Statistic<T>

  • Type Parameters:
    T - the type of the element (Number and Comparable)

    public class Statistic<T>
    extends java.lang.Object
    A state object for collecting statistics such as count, average, min, max, variance, standard deviation, skewness, and kurtosis.
    • Count: the number of element emitted by the upstream, 0 for empty streams.
    • Average: the average of the element emitted by the upstream, 0.0 for empty streams.
    • Min: the minimum element emitted by the upstream, null for empty streams.
    • Max: the maximum element emitted by the upstream, null for empty streams.
    • Variance: squared deviation of a items from the upstreams. It measures how far a set of items is spread out from their average value.
    • Standard Deviation: measure of the dispersion of the set of items. A low standard deviation indicates that the values tend to be close to the current average, while a high standard deviation indicates that the items are spread out over a wider range.
    • Skewness: measure of the asymmetry of the distribution of the emitted items about its average. The skewness value can be positive, zero, negative, or NaN.
    • Kurtosis: statistical measure that defines how heavily the tails of a item distribution differ from the tails of a normal distribution.

    Computation is based on https://www.johndcook.com/blog/skewness_kurtosis/.

    • Constructor Detail

      • Statistic

        public Statistic​(long n,
                         double m1,
                         double m2,
                         double m3,
                         double m4,
                         T min,
                         T max)
    • Method Detail

      • getAverage

        public double getAverage()
        Returns:
        the average (mean) of the emitted items.
      • getVariance

        public double getVariance()
        Returns:
        the variance of the emitted items
      • getStandardDeviation

        public double getStandardDeviation()
        Returns:
        the standard deviation
      • getSkewness

        public double getSkewness()
        Returns:
        the skewness, can be NaN
      • getKurtosis

        public double getKurtosis()
        Returns:
        the kurtosis, can be Nan
      • getCount

        public long getCount()
        Returns:
        the number of items
      • getMin

        public T getMin()
        Returns:
        the minimum item, null if no items have been emitted
      • getMax

        public T getMax()
        Returns:
        the maximum item, null if no items have been emitted
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object