public class StatisticsStream extends OnlineComputation
Constructor and Description |
---|
StatisticsStream()
Construct a new stream with no observations.
|
StatisticsStream(StatisticsStream other)
Construct a copy of the given stream.
|
Modifier and Type | Method and Description |
---|---|
StatisticsStream |
add(StatisticsStream other)
Combine the two statistics.
|
StatisticsStream |
copy()
Construct a copy of the current online computation.
|
int |
getCount()
Retrieve the number of observations.
|
double |
getMaximum()
Retrieve the maximum observation yet observed.
|
double |
getMean()
Retrieve the average of all the observations.
|
double |
getMinimum()
Retrieve the minimum observation yet observed.
|
double |
getStandardDeviation()
Retrieve the standard deviation of all the observations.
|
double |
getVariance()
Retrieve the variance of all the observations.
|
void |
observe(double value)
Observe a value.
|
java.lang.String |
toString() |
synchronizedComputation
public StatisticsStream()
public StatisticsStream(StatisticsStream other)
other
- - copy of the stream.public StatisticsStream copy()
OnlineComputation
copy
in class OnlineComputation
public void observe(double value)
observe
in class OnlineComputation
value
- - the observed value.public double getMean()
public double getVariance()
public double getStandardDeviation()
public double getMinimum()
public double getMaximum()
public StatisticsStream add(StatisticsStream other)
other
- - the other statistics.public int getCount()
getCount
in class OnlineComputation
public java.lang.String toString()
toString
in class java.lang.Object