public class Mean
extends Object
-
Constructor Summary 
Constructors
-
Method Summary 
static double
Calculate the mean of all data in an array
static double
Calculate the mean of n elements in the array
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details 
-
Mean 
public Mean()
-
Method Details 
-
getMean 
public static double getMean(double[] data)
Calculate the mean of all data in an array
- Parameters:
data
-
- Returns:
- mean of data
-
getMean 
public static double getMean(double[] data,
int n)
Calculate the mean of n elements in the array
- Parameters:
data
-
n
-
- Returns:
- mean of first n points