public class Statistics
extends java.lang.Object
Constructor and Description |
---|
Statistics(DataIterator iter)
Creates a new set of statistics.
|
Statistics(DataIterator iter,
boolean saveData)
Creates a new set of statistics.
|
Modifier and Type | Method and Description |
---|---|
double |
getAdev()
Gets the average deviation from the mean.
|
int |
getCount(double val)
Gets the histogram count for a data value.
|
double |
getData(int index)
Gets the specified data value.
|
double |
getMax()
Gets the maximum data value.
|
double |
getMean()
Gets the mean data value.
|
double |
getMedian()
Gets the median value of the data.
|
double |
getMin()
Gets the minimum data value.
|
double |
getNormalizedCount(double val)
Gets the normalized histogram count for a data value.
|
double |
getStdev()
Gets the standard deviation from the mean.
|
static Statistics |
getTestData(long seed)
Gets a test statistics object with normal distribution.
|
int |
getValid()
Gets the total number of valid data values sampled.
|
int |
getValues()
Gets the total number of data values sampled, including invalid
data.
|
static void |
main(java.lang.String[] argv)
Tests this class with a very simple data set.
|
java.lang.String |
toString()
Converts this statistics object to a string.
|
public Statistics(DataIterator iter)
iter
- an iterator over all data values required for the
statistics calculations.public Statistics(DataIterator iter, boolean saveData)
iter
- an iterator over all data values required for the
statistics calculations.saveData
- the save data flag, true if the data values used
in the statistics are to be saved. If the values are saved, they
will be available from the getData(int)
method.public static Statistics getTestData(long seed)
public int getValues()
public int getValid()
public double getMin()
public double getMax()
public double getMean()
public double getStdev()
public double getAdev()
public double getMedian()
public double getData(int index)
saveData
flag was specified to be true in the
constructor.index
- the data value index.Double.NAN
if no data was
saved.public int getCount(double val)
val
- the data value for the desired bin.public double getNormalizedCount(double val)
val
- the data value for the desired bin.public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)