public class Statistics extends Object
Modifier and Type | Method and Description |
---|---|
static double |
entropy(double[] a)
Returns the entropy of the array.
|
static double |
entropy(int[] a)
Returns the entropy of the array.
|
static double |
log2_1p(double d)
Returns the base-2 logarithm of
d + 1 . |
static double |
log2(double d)
Returns the base-2 logarithm of
d . |
static double |
mean(Collection<? extends Number> values)
Returns the mean value of the collection of numbers
|
static double |
mean(double[] values)
Returns the mean value of the array of doubles
|
static double |
mean(int[] values)
Returns the mean value of the array of ints
|
static <T extends Number & Comparable> |
median(Collection<T> values)
Returns the median value of the collection of numbers
|
static double |
median(double[] values)
Returns the median value of the array of doubles
|
static double |
median(int[] values)
Returns the median value of the array of ints
|
static BitSet |
randomDistribution(int valuesToSet,
int range)
Randomly sets
valuesToSet values to true for a sequence
from [0:range ). |
static double |
stddev(Collection<? extends Number> values)
Returns the standard deviation of the collection of numbers
|
static double |
stddev(double[] values)
Returns the standard deviation of the values in the double array
|
static double |
stddev(int[] values)
Returns the standard deviation of the values in the int array
|
static double |
sum(Collection<? extends Number> values)
Returns the sum of the collection of numbers
|
static double |
sum(double[] values)
Returns the sum of the values in the double array
|
static int |
sum(int[] values)
Returns the sum of the values in the int array
|
public static double entropy(int[] a)
public static double entropy(double[] a)
public static double log2(double d)
d
.public static double log2_1p(double d)
d + 1
.Math.log1p(double)
public static double mean(Collection<? extends Number> values)
public static double mean(int[] values)
public static double mean(double[] values)
public static <T extends Number & Comparable> T median(Collection<T> values)
public static double median(int[] values)
public static double median(double[] values)
public static BitSet randomDistribution(int valuesToSet, int range)
valuesToSet
values to true
for a sequence
from [0:range
).valuesToSet
- the number of values that are to be set to true
in the distributionrange
- the total number of values in the sequence.public static double stddev(Collection<? extends Number> values)
public static double stddev(int[] values)
public static double stddev(double[] values)
public static double sum(Collection<? extends Number> values)
public static int sum(int[] values)
public static double sum(double[] values)
Copyright © 2012. All Rights Reserved.