pamMaths
Class STD

java.lang.Object
  extended by pamMaths.STD

public class STD
extends java.lang.Object

Calculate the mean and standard deviation of an double array.

Author:
Doug Gillespie

Field Summary
private  double[] data
           
private  double mean
           
private  double std
           
 
Constructor Summary
STD()
           
 
Method Summary
private  void calculate(double[] data)
           
 double[] getData()
          Get the data previously set with calls to STD and Mean funcs
 double getMean()
          Get the mean value calculated in a previous call to getSTD(double[] data) or getMean(double[] data)
 double getMean(double[] data)
          Calculate the mean and standard deviation using new data
 double getSkew()
          Get the skew as per page 612 or numerical recipes.
 double getSTD()
          Get the standard deviation calculated in a previous call to getSTD(double[] data) or getMean(double[] data)
 double getSTD(double[] data)
          Calculate the mean and standard deviation using new data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private double[] data

mean

private double mean

std

private double std
Constructor Detail

STD

public STD()
Method Detail

getSTD

public double getSTD(double[] data)
Calculate the mean and standard deviation using new data

Parameters:
data - data array
Returns:
standard deviation

getSTD

public double getSTD()
Get the standard deviation calculated in a previous call to getSTD(double[] data) or getMean(double[] data)

Returns:
standard deviation

getMean

public double getMean(double[] data)
Calculate the mean and standard deviation using new data

Parameters:
data - data array
Returns:
mean value

getMean

public double getMean()
Get the mean value calculated in a previous call to getSTD(double[] data) or getMean(double[] data)

Returns:
mean

calculate

private void calculate(double[] data)

getData

public double[] getData()
Get the data previously set with calls to STD and Mean funcs

Returns:
data array

getSkew

public double getSkew()
Get the skew as per page 612 or numerical recipes.

Returns:
the skew of the data