net.sourceforge.jiu.util
Class Statistics
java.lang.Object
net.sourceforge.jiu.util.Statistics
public class Statistics
extends java.lang.Object
A number of static methods to compute statistical properties of an
array of double values.
Implements the computation of mean, variance and standard deviation
for double
values.
static double | computeMean(double[] values) - Computes the mean value for the argument array.
|
static double | computeMean(double[] values, int offset, int number) - Computes the mean value for some elements of the argument array.
|
static double | computeStandardDeviation(double[] values) - Computes the standard deviation for the argument array of values.
|
static double | computeStandardDeviation(double[] values, double mean) - Computes the standard deviation for the argument array of values.
|
static double | computeStandardDeviation(double[] values, int offset, int number) - Computes the standard deviation for some of the argument array's values.
|
static double | computeStandardDeviation(double[] values, int offset, int number, double mean) - Computes the standard deviation for some of the argument array's values.
|
static double | computeVariance(double[] values) - Computes the variance for the argument array.
|
static double | computeVariance(double[] values, double mean) - Computes the variance for some of the argument array's values.
|
static double | computeVariance(double[] values, int offset, int number) - Computes the variance for some of the argument array's values.
|
static double | computeVariance(double[] values, int offset, int number, double mean) - Computes the variance for some of the argument array's values.
|
Statistics
private Statistics()
computeMean
public static double computeMean(double[] values)
Computes the mean value for the argument array.
Adds all values and divides them by the number of array elements.
values
- double array on which the mean is to be determined
computeMean
public static double computeMean(double[] values,
int offset,
int number)
Computes the mean value for some elements of the argument array.
Adds all values and divides them by the number of array elements.
values
- array from which elements are readoffset
- index of the first element to be usednumber
- number of elements to be used
computeStandardDeviation
public static double computeStandardDeviation(double[] values)
Computes the standard deviation for the argument array of values.
values
- array from which elements are read
- computed standard deviation
computeStandardDeviation
public static double computeStandardDeviation(double[] values,
double mean)
Computes the standard deviation for the argument array of values.
Reuses the mean value for that argument which must have been computed before.
values
- array from which elements are readmean
- the mean value for the array, possibly computed with a
call to computeMean(double[])
.
- computed standard deviation
computeStandardDeviation
public static double computeStandardDeviation(double[] values,
int offset,
int number)
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting at values[offset]
- computed standard deviation
computeStandardDeviation
public static double computeStandardDeviation(double[] values,
int offset,
int number,
double mean)
Computes the standard deviation for some of the argument array's values.
Use this version of the method if you already have a mean value,
otherwise this method must be computed again.
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting at values[offset]mean
- value of the elements
- computed standard deviation
computeVariance
public static double computeVariance(double[] values)
Computes the variance for the argument array.
values
- array from which elements are read
- variance for the array elements
computeVariance
public static double computeVariance(double[] values,
double mean)
Computes the variance for some of the argument array's values.
values
- array from which elements are readmean
- the mean for the array elements
- variance for the array elements
computeVariance
public static double computeVariance(double[] values,
int offset,
int number)
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting at values[offset]
computeVariance
public static double computeVariance(double[] values,
int offset,
int number,
double mean)
Computes the variance for some of the argument array's values.
Use this version of the method in case mean has already been
computed.
values
- array from which elements are readoffset
- first element to be usednumber
- number of elements used starting at values[offset]mean
- the mean for the array elements