public final class DoubleMoments extends Object implements Serializable
DoubleMomentStatistics
,
Serialized FormModifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
long |
getCount()
Returns the count of values recorded.
|
double |
getKurtosis()
Return the kurtosis of values recorded, or
Double.NaN if less
than four values have been recorded. |
double |
getMax()
Return the maximum value recorded, or
Double.NEGATIVE_INFINITY if
no values have been recorded. |
double |
getMean()
Return the arithmetic mean of values recorded, or zero if no values have
been recorded.
|
double |
getMin()
Return the minimum value recorded, or
Double.POSITIVE_INFINITY if
no values have been recorded. |
double |
getSkewness()
Return the skewness of values recorded, or
Double.NaN if less
than two values have been recorded. |
double |
getSum()
Return the sum of values recorded, or zero if no values have been
recorded.
|
double |
getVariance()
Return the variance of values recorded, or
Double.NaN if no
values have been recorded. |
int |
hashCode() |
static DoubleMoments |
of(DoubleMomentStatistics statistics)
Return a new value object of the statistical moments, currently
represented by the
statistics object. |
static DoubleMoments |
of(long count,
double min,
double max,
double sum,
double mean,
double variance,
double skewness,
double kurtosis)
Create an immutable object which contains statistical values.
|
static <N extends Number> |
toDoubleMoments()
Return a
Collector which returns moments-statistics for the
resulting values. |
static <T> Collector<T,?,DoubleMoments> |
toDoubleMoments(ToDoubleFunction<? super T> mapper)
Return a
Collector which applies an double-producing mapping
function to each input element, and returns moments-statistics for the
resulting values. |
String |
toString() |
public long getCount()
public double getMin()
Double.POSITIVE_INFINITY
if
no values have been recorded.Integer.MAX_VALUE
if nonepublic double getMax()
Double.NEGATIVE_INFINITY
if
no values have been recorded.Integer.MIN_VALUE
if nonepublic double getSum()
public double getMean()
public double getVariance()
Double.NaN
if no
values have been recorded.NaN
if nonepublic double getSkewness()
Double.NaN
if less
than two values have been recorded.NaN
if less than two values
have been recordedpublic double getKurtosis()
Double.NaN
if less
than four values have been recorded.NaN
if less than four values
have been recordedpublic static DoubleMoments of(long count, double min, double max, double sum, double mean, double variance, double skewness, double kurtosis)
count
- the count of values recordedmin
- the minimum valuemax
- the maximum valuesum
- the sum of the recorded valuesmean
- the arithmetic mean of valuesvariance
- the variance of valuesskewness
- the skewness of valueskurtosis
- the kurtosis of valuespublic static DoubleMoments of(DoubleMomentStatistics statistics)
statistics
object.statistics
- the creating (mutable) statistics classpublic static <N extends Number> Collector<N,?,DoubleMoments> toDoubleMoments()
Collector
which returns moments-statistics for the
resulting values.
final Stream<Double> stream = ...
final DoubleMoments moments = stream.collect(toDoubleMoments()));
N
- the type of the input elementsCollector
implementing the moments-statistics reductionpublic static <T> Collector<T,?,DoubleMoments> toDoubleMoments(ToDoubleFunction<? super T> mapper)
Collector
which applies an double-producing mapping
function to each input element, and returns moments-statistics for the
resulting values.
final Stream<SomeObject> stream = ...
final DoubleMoments moments = stream
.collect(toDoubleMoments(v -> v.doubleValue()));
T
- the type of the input elementsmapper
- a mapping function to apply to each elementCollector
implementing the moments-statistics reductionNullPointerException
- if the given mapper
is
null
© 2007-2019 Franz Wilhelmstötter (2019-02-19 21:44)