public class Stats extends Object
Modifier and Type | Method and Description |
---|---|
static cern.colt.list.DoubleArrayList |
cdf(cern.colt.list.DoubleArrayList x)
Convert an array into a cumulative density function (CDF).
|
static cern.colt.list.DoubleArrayList |
cumulate(cern.colt.list.DoubleArrayList x)
Convert an array into a cumulative array.
|
static cern.colt.list.DoubleArrayList |
cumulateRight(cern.colt.list.DoubleArrayList x)
Convert an array into a cumulative array.
|
static double |
cv(cern.colt.list.DoubleArrayList data)
Compute the coefficient of variation of an array (standard deviation / mean).
|
static Double |
fractionDistinctValuesNonNA(cern.colt.list.DoubleArrayList array,
double tolerance)
Compute the fraction of values which are distinct.
|
static boolean |
isValidFraction(double value)
Test whether a value is a valid fractional or probability value.
|
static double |
meanAboveQuantile(int index,
double[] array,
int effectiveSize)
calculate the mean of the values above (NOT greater or equal to) a particular index rank of an array.
|
static cern.colt.list.DoubleArrayList |
normalize(cern.colt.list.DoubleArrayList x)
Adjust the elements of an array so they total to 1.0.
|
static cern.colt.list.DoubleArrayList |
normalize(cern.colt.list.DoubleArrayList x,
double normfactor)
Divide the elements of an array by a given factor.
|
static Integer |
numberofDistinctValues(cern.colt.list.DoubleArrayList array,
double tolerance) |
static Integer |
numberofDistinctValuesNonNA(cern.colt.list.DoubleArrayList array,
double tolerance) |
static double |
quantile(int index,
double[] values,
int effectiveSize)
Given a double array, calculate the quantile requested.
|
static double |
range(cern.colt.list.DoubleArrayList data)
Compute the range of an array.
|
public static cern.colt.list.DoubleArrayList cdf(cern.colt.list.DoubleArrayList x)
x
- The input of counts (i.e. a histogram).public static cern.colt.list.DoubleArrayList cumulate(cern.colt.list.DoubleArrayList x)
x
- DoubleArrayListpublic static cern.colt.list.DoubleArrayList cumulateRight(cern.colt.list.DoubleArrayList x)
x
- the array of data to be cumulated.public static double cv(cern.colt.list.DoubleArrayList data)
data
- DoubleArrayListpublic static boolean isValidFraction(double value)
value
- public static double meanAboveQuantile(int index, double[] array, int effectiveSize)
index
- the rank of the value we wish to average above.array
- Array for which we want to get the quantile.effectiveSize
- The size of the array, not including NaNs.DescriptiveWithMissing.meanAboveQuantile(double, cern.colt.list.DoubleArrayList)
public static cern.colt.list.DoubleArrayList normalize(cern.colt.list.DoubleArrayList x)
x
- Input array.public static cern.colt.list.DoubleArrayList normalize(cern.colt.list.DoubleArrayList x, double normfactor)
x
- Input array.normfactor
- doublepublic static Integer numberofDistinctValues(cern.colt.list.DoubleArrayList array, double tolerance)
array
- input datatolerance
- a small constantpublic static Integer numberofDistinctValuesNonNA(cern.colt.list.DoubleArrayList array, double tolerance)
tolerance
- a small constantpublic static Double fractionDistinctValuesNonNA(cern.colt.list.DoubleArrayList array, double tolerance)
array
- input datatolerance
- a small constant to define the difference that is "distinct"public static double quantile(int index, double[] values, int effectiveSize)
index
- - the rank of the value we wish to get. Thus if we have 200 items in the array, and want the median,
we should enter 100.values
- double[] - array of data we want quantile ofeffectiveSize
- int the effective size of the arrayDescriptiveWithMissing.quantile(cern.colt.list.DoubleArrayList, double)
public static double range(cern.colt.list.DoubleArrayList data)
data
- DoubleArrayListCopyright © 2003–2022 UBC Michael Smith Laboratories. All rights reserved.