org.forester.util
Class BasicDescriptiveStatistics
java.lang.Object
org.forester.util.BasicDescriptiveStatistics
- All Implemented Interfaces:
- DescriptiveStatistics
public class BasicDescriptiveStatistics
- extends Object
- implements DescriptiveStatistics
BasicDescriptiveStatistics
public BasicDescriptiveStatistics()
addValue
public void addValue(double d)
- Specified by:
addValue in interface DescriptiveStatistics
arithmeticMean
public double arithmeticMean()
- Specified by:
arithmeticMean in interface DescriptiveStatistics
asSummary
public String asSummary()
- Specified by:
asSummary in interface DescriptiveStatistics
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 interface DescriptiveStatistics
- Returns:
getDataAsDoubleArray
public double[] getDataAsDoubleArray()
- Specified by:
getDataAsDoubleArray in interface DescriptiveStatistics
getMax
public double getMax()
- Specified by:
getMax in interface DescriptiveStatistics
getMin
public double getMin()
- Specified by:
getMin in interface DescriptiveStatistics
getN
public int getN()
- Specified by:
getN in interface DescriptiveStatistics
getSum
public double getSum()
- Specified by:
getSum in interface DescriptiveStatistics
getSummaryAsString
public String getSummaryAsString()
- Specified by:
getSummaryAsString in interface DescriptiveStatistics
getValue
public double getValue(int index)
- Specified by:
getValue in interface DescriptiveStatistics
median
public double median()
- Specified by:
median in interface DescriptiveStatistics
midrange
public double midrange()
- Specified by:
midrange in interface DescriptiveStatistics
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 interface DescriptiveStatistics
- Returns:
sampleStandardDeviation
public double sampleStandardDeviation()
- Specified by:
sampleStandardDeviation in interface DescriptiveStatistics
sampleStandardUnit
public double sampleStandardUnit(double value)
- Specified by:
sampleStandardUnit in interface DescriptiveStatistics
sampleVariance
public double sampleVariance()
- Specified by:
sampleVariance in interface DescriptiveStatistics
standardErrorOfMean
public double standardErrorOfMean()
- Specified by:
standardErrorOfMean in interface DescriptiveStatistics
sumDeviations
public double sumDeviations()
- Specified by:
sumDeviations in interface DescriptiveStatistics
toString
public String toString()
- Specified by:
toString in interface DescriptiveStatistics- Overrides:
toString in class Object
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