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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValue(double d) doubledoubleComputes the coefficient of variation.getData()double[]doublegetMax()doublegetMin()intgetN()doublegetSum()doublegetValue(int index) doublemedian()doublemidrange()doubleDetermines relationship between the mean and the median.static int[]performBinning(double[] values, double min, double max, int number_of_bins) doubledoublesampleStandardUnit(double value) static doublesampleStandardUnit(double value, double mean, double sd) Computes the sample standard unit (z-score).doublevoidsetDescription(String desc) doubledoubletoString()
-
Constructor Details
-
BasicDescriptiveStatistics
public BasicDescriptiveStatistics() -
BasicDescriptiveStatistics
-
-
Method Details
-
addValue
public void addValue(double d) - Specified by:
addValuein interfaceDescriptiveStatistics
-
arithmeticMean
public double arithmeticMean()- Specified by:
arithmeticMeanin interfaceDescriptiveStatistics
-
asSummary
- Specified by:
asSummaryin interfaceDescriptiveStatistics
-
coefficientOfVariation
public double coefficientOfVariation()Description copied from interface:DescriptiveStatisticsComputes the coefficient of variation. Used to express standard deviation independent of units of measure.- Specified by:
coefficientOfVariationin interfaceDescriptiveStatistics- Returns:
-
getData
- Specified by:
getDatain interfaceDescriptiveStatistics
-
getDataAsDoubleArray
public double[] getDataAsDoubleArray()- Specified by:
getDataAsDoubleArrayin interfaceDescriptiveStatistics
-
getDescription
- Specified by:
getDescriptionin interfaceDescriptiveStatistics
-
getMax
public double getMax()- Specified by:
getMaxin interfaceDescriptiveStatistics
-
getMin
public double getMin()- Specified by:
getMinin interfaceDescriptiveStatistics
-
getN
public int getN()- Specified by:
getNin interfaceDescriptiveStatistics
-
getSum
public double getSum()- Specified by:
getSumin interfaceDescriptiveStatistics
-
getSummaryAsString
- Specified by:
getSummaryAsStringin interfaceDescriptiveStatistics
-
getValue
public double getValue(int index) - Specified by:
getValuein interfaceDescriptiveStatistics
-
median
public double median()- Specified by:
medianin interfaceDescriptiveStatistics
-
midrange
public double midrange()- Specified by:
midrangein interfaceDescriptiveStatistics
-
pearsonianSkewness
public double pearsonianSkewness()Description copied from interface:DescriptiveStatisticsDetermines relationship between the mean and the median. This reflects how the data differs from the normal bell shaped distribution.- Specified by:
pearsonianSkewnessin interfaceDescriptiveStatistics- Returns:
-
sampleStandardDeviation
public double sampleStandardDeviation()- Specified by:
sampleStandardDeviationin interfaceDescriptiveStatistics
-
sampleStandardUnit
public double sampleStandardUnit(double value) - Specified by:
sampleStandardUnitin interfaceDescriptiveStatistics
-
sampleVariance
public double sampleVariance()- Specified by:
sampleVariancein interfaceDescriptiveStatistics
-
setDescription
- Specified by:
setDescriptionin interfaceDescriptiveStatistics
-
standardErrorOfMean
public double standardErrorOfMean()- Specified by:
standardErrorOfMeanin interfaceDescriptiveStatistics
-
sumDeviations
public double sumDeviations()- Specified by:
sumDeviationsin interfaceDescriptiveStatistics
-
toString
- Specified by:
toStringin interfaceDescriptiveStatistics- Overrides:
toStringin 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
-