public class DataSet extends Object
Constructor | Description |
---|---|
DataSet() |
Creates an empty data set with a default initial capacity.
|
DataSet(double[] dataSet) |
Creates a data set and populates it with the specified values.
|
DataSet(int capacity) |
Creates an empty data set with the specified initial capacity.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addValue(double value) |
Adds a single value to the data set and updates any
statistics that are calculated cumulatively.
|
double |
getAggregate() |
|
double |
getArithmeticMean() |
The arithemthic mean of an n-element set is the sum of
all the elements divided by n.
|
double |
getGeometricMean() |
The geometric mean of an n-element set is the nth-root of
the product of all the elements.
|
double |
getHarmonicMean() |
The harmonic mean of an n-element set is n divided by the sum
of the reciprocals of the values (where the reciprocal of a value
x is 1/x).
|
double |
getMaximum() |
|
double |
getMeanDeviation() |
Calculates the mean absolute deviation of the data set.
|
double |
getMedian() |
Determines the median value of the data set.
|
double |
getMinimum() |
|
double |
getProduct() |
|
double |
getSampleStandardDeviation() |
The sample standard deviation is the square root of the
sample variance.
|
double |
getSampleVariance() |
Calculates the variance (a measure of statistical dispersion)
of the data set.
|
int |
getSize() |
Returns the number of values in this data set.
|
double |
getStandardDeviation() |
The standard deviation is the square root of the variance.
|
double |
getVariance() |
Calculates the variance (a measure of statistical dispersion)
of the data set.
|
public DataSet()
public DataSet(int capacity)
capacity
- The initial capacity for the data set (this number
of values will be able to be added without needing to resize the
internal data storage).public DataSet(double[] dataSet)
dataSet
- The values to add to this data set.public void addValue(double value)
value
- The value to add.public final int getSize()
public final double getMinimum()
EmptyDataSetException
- If the data set is empty.public final double getMaximum()
EmptyDataSetException
- If the data set is empty.public final double getMedian()
public final double getAggregate()
EmptyDataSetException
- If the data set is empty.public final double getProduct()
EmptyDataSetException
- If the data set is empty.public final double getArithmeticMean()
EmptyDataSetException
- If the data set is empty.getGeometricMean()
public final double getGeometricMean()
EmptyDataSetException
- If the data set is empty.getArithmeticMean()
,
getHarmonicMean()
public final double getHarmonicMean()
EmptyDataSetException
- If the data set is empty.getArithmeticMean()
,
getGeometricMean()
public final double getMeanDeviation()
EmptyDataSetException
- If the data set is empty.getArithmeticMean()
,
getVariance()
,
getStandardDeviation()
public final double getVariance()
EmptyDataSetException
- If the data set is empty.getSampleVariance()
,
getStandardDeviation()
,
getMeanDeviation()
public final double getStandardDeviation()
EmptyDataSetException
- If the data set is empty.getSampleStandardDeviation()
,
getVariance()
,
getMeanDeviation()
public final double getSampleVariance()
EmptyDataSetException
- If the data set is empty.getVariance()
,
getSampleStandardDeviation()
,
getMeanDeviation()
public final double getSampleStandardDeviation()
EmptyDataSetException
- If the data set is empty.getStandardDeviation()
,
getSampleVariance()
,
getMeanDeviation()