public final class Statistics extends Object
No data is cached in the class, all statistics are computed during streaming:
Constructor and Description |
---|
Statistics()
Create an instance for keeping track of running statistics.
|
Modifier and Type | Method and Description |
---|---|
Object |
getMaxValue()
Return maximum observed value.
|
double |
getMean()
Return mean (average) value of the (actual) observations.
|
double |
getMedian()
Return the 50% percentile (median) of the (actual) observations.
|
Object |
getMinValue()
Return minimum observed value.
|
int |
getNActualValues()
Return number of actual observations,
i.e.
|
int |
getNNoValues()
Return number of no-values (NaN or Infinity) observed.
|
int |
getNValues()
Return total number of observations.
|
double |
getPercentile25()
Return the 25% percentile of the (actual) observations.
|
double |
getPercentile75()
Return the 75% percentile of the (actual) observations.
|
double |
getStandardDeviation()
Return the standard deviation of the (actual) observations.
|
double |
getSum()
Return the sum of the (actual) observations.
|
double |
getVariance()
Return the variance of the (actual) observations.
|
void |
push(double value)
Include a new observation in the statistics.
|
void |
reset()
Reset the statistics.
|
String |
toString() |
public Statistics()
Add observation values by calling the push(double)
method.
public void push(double value)
value
- Observation to include. Double.NaN or Double.Infinity
will count as no-values.public void reset()
public int getNValues()
push(double)
method has been called.public int getNActualValues()
public int getNNoValues()
public Object getMinValue()
public Object getMaxValue()
public double getMean()
public double getVariance()
public double getStandardDeviation()
public double getPercentile25()
public double getMedian()
public double getPercentile75()
public double getSum()
Copyright © 2024 Petroware AS - https://petroware.no