Methods Summary |
---|
public void | addDatum(double x)This method adds a new datum into the average.
n++;
sum += x;
sumOfSquares += x * x;
|
public double | getAverage()This method returns the average of all numbers passed to addDatum() return sum / n;
|
public double | getNum()This method returns the number of numbers passed to addDatum() return n;
|
public double | getStandardDeviation()This method returns the standard deviation of the data
return Math.sqrt(((sumOfSquares - sum*sum/n)/n));
|
public double | getSum()This method returns the sum of all numbers passed to addDatum() return sum;
|
public double | getSumOfSquares()This method returns the sum of the squares of all numbers. return sumOfSquares;
|
public void | reset()This method resets the Averager object to begin from scratch n = 0; sum = 0.0; sumOfSquares = 0.0;
|