public class UnivariateStatisticsUtil
extends java.lang.Object
Constructor and Description |
---|
UnivariateStatisticsUtil() |
Modifier and Type | Method and Description |
---|---|
static double |
computeCentralMoment(java.lang.Iterable<? extends java.lang.Number> data,
double mean,
int moment)
Computes the desired biased estimate central moment of the given dataset.
|
static double |
computeCorrelation(java.util.Collection<? extends java.lang.Number> data1,
java.util.Collection<? extends java.lang.Number> data2)
Computes the correlation coefficient in a single pass.
|
static double |
computeEntropy(java.lang.Iterable<? extends java.lang.Number> data)
Computes the information-theoretic entropy of the PMF in bits (base 2).
|
static double |
computeKurtosis(java.util.Collection<? extends java.lang.Number> data)
Computes the biased excess kurtosis of the given dataset.
|
static double |
computeMaximum(java.lang.Iterable<? extends java.lang.Number> data)
Finds the maximum value of a data set.
|
static double |
computeMean(java.lang.Iterable<? extends java.lang.Number> data)
Computes the arithmetic mean (average, expectation, first central moment)
of a dataset
|
static Pair<java.lang.Double,java.lang.Double> |
computeMeanAndVariance(java.lang.Iterable<? extends java.lang.Number> data)
Computes the mean and unbiased variance of a Collection of data using
the one-pass approach.
|
static double |
computeMedian(java.util.Collection<? extends java.lang.Number> data)
Computes the median of the given data.
|
static Pair<java.lang.Double,java.lang.Double> |
computeMinAndMax(java.lang.Iterable<? extends java.lang.Number> data)
Computes the minimum and maximum of a set of data in a single pass.
|
static double |
computeMinimum(java.lang.Iterable<? extends java.lang.Number> data)
Finds the minimum value of a data set.
|
static double |
computePercentile(java.util.Collection<? extends java.lang.Number> data,
double percentile)
Computes the percentile value of the given data.
|
static double[] |
computePercentiles(java.util.Collection<? extends java.lang.Number> data,
double... percentiles)
Computes the given percentiles of the given data.
|
static double |
computeRootMeanSquaredError(java.util.Collection<? extends java.lang.Number> data)
Computes the Root mean-squared (RMS) error between the data and its mean.
|
static double |
computeRootMeanSquaredError(java.util.Collection<? extends java.lang.Number> data,
double mean)
Computes the Root mean-squared (RMS) error between the data and its mean
|
static double |
computeSkewness(java.util.Collection<? extends java.lang.Number> data)
Computes the unbiased skewness of the dataset.
|
static double |
computeStandardDeviation(java.util.Collection<? extends java.lang.Number> data)
Computes the standard deviation of a dataset, which is the square root
of the unbiased variance.
|
static double |
computeStandardDeviation(java.util.Collection<? extends java.lang.Number> data,
double mean)
Computes the standard deviation of a dataset, which is the square root
of the unbiased variance.
|
static double |
computeSum(java.lang.Iterable<? extends java.lang.Number> data)
Computes the arithmetic sum of the dataset
|
static double |
computeSumSquaredDifference(java.lang.Iterable<? extends java.lang.Number> data,
double target)
Computes the sum-squared difference between the data and a target
|
static double |
computeVariance(java.util.Collection<? extends java.lang.Number> data)
Computes the unbiased variance (second central moment,
squared standard deviation) of a dataset.
|
static double |
computeVariance(java.util.Collection<? extends java.lang.Number> data,
double mean)
Computes the unbiased variance (second central moment,
squared standard deviation) of a dataset
|
static double |
computeWeightedCentralMoment(java.lang.Iterable<? extends WeightedValue<? extends java.lang.Number>> data,
double mean,
int moment)
Computes the desired biased estimate central moment of the given dataset.
|
static double |
computeWeightedKurtosis(java.util.Collection<? extends WeightedValue<? extends java.lang.Number>> data)
Computes the biased excess kurtosis of the given dataset.
|
static double |
computeWeightedMean(java.lang.Iterable<? extends WeightedValue<? extends java.lang.Number>> data)
Computes the arithmetic mean (average, expectation, first central moment)
of a dataset.
|
static Pair<java.lang.Double,java.lang.Double> |
computeWeightedMeanAndVariance(java.lang.Iterable<? extends WeightedValue<? extends java.lang.Number>> data)
Computes the mean and unbiased variance of a Collection of data using
the one-pass approach.
|
static double |
getPercentileFromSorted(java.util.List<? extends java.lang.Number> sortedData,
double percentile)
Computes the percentile value of the given pre-sorted data in increasing
order.
|
@PublicationReference(title="Algorithms for calculating variance", type=WebPage, year=2010, author="Wikipedia", url="http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance") public static double computeMean(java.lang.Iterable<? extends java.lang.Number> data)
data
- Collection of Doubles to consider@PublicationReference(title="Algorithms for calculating variance", type=WebPage, year=2010, author="Wikipedia", url="http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance") public static double computeWeightedMean(java.lang.Iterable<? extends WeightedValue<? extends java.lang.Number>> data)
data
- Collection of Doubles to consider.public static double computeVariance(java.util.Collection<? extends java.lang.Number> data)
data
- Data to considerpublic static double computeVariance(java.util.Collection<? extends java.lang.Number> data, double mean)
data
- Data to considermean
- Pre-computed mean (or central value) of the datasetpublic static double computeStandardDeviation(java.util.Collection<? extends java.lang.Number> data)
data
- The data to consider.public static double computeStandardDeviation(java.util.Collection<? extends java.lang.Number> data, double mean)
data
- The data to consider.mean
- The pre-computed mean of the given data.public static double computeRootMeanSquaredError(java.util.Collection<? extends java.lang.Number> data)
data
- Dataset to considerpublic static double computeRootMeanSquaredError(java.util.Collection<? extends java.lang.Number> data, double mean)
data
- Dataset to considermean
- Mean value about which to compute the sum-squared errorpublic static double computeSum(java.lang.Iterable<? extends java.lang.Number> data)
data
- Dataset to considerpublic static double computeSumSquaredDifference(java.lang.Iterable<? extends java.lang.Number> data, double target)
data
- Dataset to considertarget
- Target about which to compute the difference@PublicationReference(author="Wikipedia", title="Pearson product-moment correlation coefficient", type=WebPage, year=2011, url="http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient") public static double computeCorrelation(java.util.Collection<? extends java.lang.Number> data1, java.util.Collection<? extends java.lang.Number> data2)
data1
- First dataset to consider, must have same size as data2data2
- Second dataset to considerpublic static double computeMedian(java.util.Collection<? extends java.lang.Number> data)
data
- Data from which to compute the median.public static double computePercentile(java.util.Collection<? extends java.lang.Number> data, double percentile)
data
- Data from which to compute the percentile.percentile
- Percentile to choose, must be on the closed interval 0.0 to 1.0.public static double getPercentileFromSorted(java.util.List<? extends java.lang.Number> sortedData, double percentile)
sortedData
- The data sorted in increasing order from which to get the
percentile. Must have at least one element.percentile
- The percentile to choose. Must be between 0 and 1, inclusive.public static double[] computePercentiles(java.util.Collection<? extends java.lang.Number> data, double... percentiles)
data
- The data sorted from which to compute the percentiles.
Must have at least one element.percentiles
- The percentiles to compute. All must be between 0 and 1, inclusive.public static double computeMinimum(java.lang.Iterable<? extends java.lang.Number> data)
data
- Data set to considerpublic static double computeMaximum(java.lang.Iterable<? extends java.lang.Number> data)
data
- Data set to considerpublic static Pair<java.lang.Double,java.lang.Double> computeMinAndMax(java.lang.Iterable<? extends java.lang.Number> data)
data
- Data to consider@PublicationReference(author="Wikipedia", title="Skewness", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Skewness") public static double computeSkewness(java.util.Collection<? extends java.lang.Number> data)
data
- Data from which to compute the unbiased skewness.public static double computeCentralMoment(java.lang.Iterable<? extends java.lang.Number> data, double mean, int moment)
data
- Data to compute the moment of.mean
- Mean of the data (to prevent redundant computation).moment
- Desired moment of the data, must be greater than or equal to 1.public static double computeWeightedCentralMoment(java.lang.Iterable<? extends WeightedValue<? extends java.lang.Number>> data, double mean, int moment)
data
- Data to compute the moment of.mean
- Mean of the data (to prevent redundant computation).moment
- Desired moment of the data, must be greater than or equal to 1.@PublicationReference(author="Wikipedia", title="Kurtosis", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Kurtosis") public static double computeKurtosis(java.util.Collection<? extends java.lang.Number> data)
data
- Dataset to compute its kurtosis.@PublicationReference(author="Wikipedia", title="Kurtosis", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Kurtosis") public static double computeWeightedKurtosis(java.util.Collection<? extends WeightedValue<? extends java.lang.Number>> data)
data
- Dataset to compute its kurtosis.@PublicationReference(author="Wikipedia", title="Entropy (information theory)", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Entropy_(Information_theory)") public static double computeEntropy(java.lang.Iterable<? extends java.lang.Number> data)
data
- Data to compute the entropy.@PublicationReference(title="Algorithms for calculating variance", type=WebPage, year=2010, author="Wikipedia", url="http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance") public static Pair<java.lang.Double,java.lang.Double> computeMeanAndVariance(java.lang.Iterable<? extends java.lang.Number> data)
data
- Data to consider@PublicationReference(title="Algorithms for calculating variance", type=WebPage, year=2010, author="Wikipedia", url="http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance") public static Pair<java.lang.Double,java.lang.Double> computeWeightedMeanAndVariance(java.lang.Iterable<? extends WeightedValue<? extends java.lang.Number>> data)
data
- Data to consider.