- java.lang.Object
-
- io.smallrye.mutiny.math.Statistic<T>
-
- Type Parameters:
T- the type of the element (Number and Comparable)
public class Statistic<T> extends java.lang.ObjectA 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,
nullfor empty streams. - Max: the maximum element emitted by the upstream,
nullfor 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/.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)doublegetAverage()longgetCount()doublegetKurtosis()TgetMax()TgetMin()doublegetSkewness()doublegetStandardDeviation()doublegetVariance()inthashCode()java.lang.StringtoString()
-
-
-
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,
nullif no items have been emitted
-
getMax
public T getMax()
- Returns:
- the maximum item,
nullif no items have been emitted
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-