public class StreamingStatistics extends Object implements StatisticalSummary, AggregatableStatistic<StreamingStatistics>, Serializable
addValue
method. The data values are not stored in
memory, so this class can be used to compute statistics for very large data
streams.
Note: This class is not thread-safe.
Constructor and Description |
---|
StreamingStatistics()
Construct a new SummaryStatistics instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(double value)
Add a value to the data
|
void |
aggregate(StreamingStatistics other)
Aggregates the results from the provided instance into this instance.
|
void |
clear()
Resets all statistics and storage.
|
StreamingStatistics |
copy()
Returns a copy of this SummaryStatistics instance with the same internal state.
|
boolean |
equals(Object object)
Returns true iff
object is a SummaryStatistics
instance and all statistics have the same values as this. |
double |
getGeometricMean()
Returns the geometric mean of the values that have been added.
|
double |
getMax()
Returns the maximum of the available values
|
double |
getMean()
Returns the
arithmetic mean of the available values
|
double |
getMin()
Returns the minimum of the available values
|
long |
getN()
Returns the number of available values
|
double |
getPopulationVariance()
Returns the
population variance of the values that have been added.
|
double |
getQuadraticMean()
Returns the quadratic mean, a.k.a.
|
double |
getSecondMoment()
Returns a statistic related to the Second Central Moment.
|
double |
getStandardDeviation()
Returns the standard deviation of the values that have been added.
|
double |
getSum()
Returns the sum of the values that have been added to Univariate.
|
StatisticalSummary |
getSummary()
Return a
StatisticalSummaryValues instance reporting current
statistics. |
double |
getSumOfLogs()
Returns the sum of the logs of the values that have been added.
|
double |
getSumOfSquares()
Returns the sum of the squares of the values that have been added.
|
double |
getVariance()
Returns the variance of the available values.
|
int |
hashCode()
Returns hash code based on values of statistics.
|
String |
toString()
Generates a text report displaying summary statistics from values that
have been added.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
aggregate, aggregate
aggregate, aggregate
public StreamingStatistics()
public StreamingStatistics copy()
public StatisticalSummary getSummary()
StatisticalSummaryValues
instance reporting current
statistics.public void addValue(double value)
value
- the value to addpublic void clear()
public long getN()
getN
in interface StatisticalSummary
public double getMax()
getMax
in interface StatisticalSummary
public double getMin()
getMin
in interface StatisticalSummary
public double getSum()
getSum
in interface StatisticalSummary
public double getSumOfSquares()
Double.NaN is returned if no values have been added.
public double getMean()
getMean
in interface StatisticalSummary
public double getVariance()
getVariance
in interface StatisticalSummary
public double getPopulationVariance()
Double.NaN is returned if no values have been added.
public double getGeometricMean()
Double.NaN is returned if no values have been added.
public double getSumOfLogs()
Double.NaN is returned if no values have been added.
public double getSecondMoment()
Returns Double.NaN
if no data values have been added and
returns 0
if there is just one value in the data set.
public double getQuadraticMean()
Double.NaN
if no values
have been added.public double getStandardDeviation()
Double.NaN is returned if no values have been added.
getStandardDeviation
in interface StatisticalSummary
public void aggregate(StreamingStatistics other)
This method can be used to combine statistics computed over partitions or subsamples - i.e., the value of this instance after this operation should be the same as if a single statistic would have been applied over the combined dataset.
aggregate
in interface AggregatableStatistic<StreamingStatistics>
other
- the instance to aggregate into this instancepublic String toString()
public boolean equals(Object object)
object
is a SummaryStatistics
instance and all statistics have the same values as this.Copyright © 2016 Hipparchus.org. All rights reserved.