Package org.forester.util
Class BasicDescriptiveStatistics
java.lang.Object
org.forester.util.BasicDescriptiveStatistics
- All Implemented Interfaces:
DescriptiveStatistics
-
Field Summary
Fields inherited from interface org.forester.util.DescriptiveStatistics
PLUS_MINUS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addValue
(double d) double
double
Computes the coefficient of variation.getData()
double[]
double
getMax()
double
getMin()
int
getN()
double
getSum()
double
getValue
(int index) double
median()
double
midrange()
double
Determines relationship between the mean and the median.static int[]
performBinning
(double[] values, double min, double max, int number_of_bins) double
double
sampleStandardUnit
(double value) static double
sampleStandardUnit
(double value, double mean, double sd) Computes the sample standard unit (z-score).double
void
setDescription
(String desc) double
double
toString()
-
Constructor Details
-
BasicDescriptiveStatistics
public BasicDescriptiveStatistics() -
BasicDescriptiveStatistics
-
-
Method Details
-
addValue
public void addValue(double d) - Specified by:
addValue
in interfaceDescriptiveStatistics
-
arithmeticMean
public double arithmeticMean()- Specified by:
arithmeticMean
in interfaceDescriptiveStatistics
-
asSummary
- Specified by:
asSummary
in interfaceDescriptiveStatistics
-
coefficientOfVariation
public double coefficientOfVariation()Description copied from interface:DescriptiveStatistics
Computes the coefficient of variation. Used to express standard deviation independent of units of measure.- Specified by:
coefficientOfVariation
in interfaceDescriptiveStatistics
- Returns:
-
getData
- Specified by:
getData
in interfaceDescriptiveStatistics
-
getDataAsDoubleArray
public double[] getDataAsDoubleArray()- Specified by:
getDataAsDoubleArray
in interfaceDescriptiveStatistics
-
getDescription
- Specified by:
getDescription
in interfaceDescriptiveStatistics
-
getMax
public double getMax()- Specified by:
getMax
in interfaceDescriptiveStatistics
-
getMin
public double getMin()- Specified by:
getMin
in interfaceDescriptiveStatistics
-
getN
public int getN()- Specified by:
getN
in interfaceDescriptiveStatistics
-
getSum
public double getSum()- Specified by:
getSum
in interfaceDescriptiveStatistics
-
getSummaryAsString
- Specified by:
getSummaryAsString
in interfaceDescriptiveStatistics
-
getValue
public double getValue(int index) - Specified by:
getValue
in interfaceDescriptiveStatistics
-
median
public double median()- Specified by:
median
in interfaceDescriptiveStatistics
-
midrange
public double midrange()- Specified by:
midrange
in interfaceDescriptiveStatistics
-
pearsonianSkewness
public double pearsonianSkewness()Description copied from interface:DescriptiveStatistics
Determines relationship between the mean and the median. This reflects how the data differs from the normal bell shaped distribution.- Specified by:
pearsonianSkewness
in interfaceDescriptiveStatistics
- Returns:
-
sampleStandardDeviation
public double sampleStandardDeviation()- Specified by:
sampleStandardDeviation
in interfaceDescriptiveStatistics
-
sampleStandardUnit
public double sampleStandardUnit(double value) - Specified by:
sampleStandardUnit
in interfaceDescriptiveStatistics
-
sampleVariance
public double sampleVariance()- Specified by:
sampleVariance
in interfaceDescriptiveStatistics
-
setDescription
- Specified by:
setDescription
in interfaceDescriptiveStatistics
-
standardErrorOfMean
public double standardErrorOfMean()- Specified by:
standardErrorOfMean
in interfaceDescriptiveStatistics
-
sumDeviations
public double sumDeviations()- Specified by:
sumDeviations
in interfaceDescriptiveStatistics
-
toString
- Specified by:
toString
in interfaceDescriptiveStatistics
- Overrides:
toString
in classObject
-
performBinning
public static int[] performBinning(double[] values, double min, double max, int number_of_bins) -
sampleStandardUnit
public static double sampleStandardUnit(double value, double mean, double sd) Computes the sample standard unit (z-score). Used to compute 'value' in terms of standard units. Note that 'value', 'mean' and 'sd' must be all from the same sample data.- Parameters:
value
- a double in the sample for whichmean
- the mean of the sample.sd
- The standard deviation of the sample.- Returns:
- 'value' in terms of standard units
-