Package pamMaths
Class STD
java.lang.Object
pamMaths.STD
Calculate the mean and standard deviation of
an double array.
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
getData()
Get the data previously set with calls to STD and Mean funcsdouble
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 datadouble
Get the median of the dataset MO 2015/05/17double
getMedian
(double[] data) Get the median of the dataset passed to this method.double
getSkew()
Get the skew as per page 612 or numerical recipes.double
getSkew
(double mean, double sig) 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 datadouble
Get the variance of the dataset already loaded in this class MO 2015/05/17double
getVariance
(double[] data) Get the variance of the dataset passed to this method.
-
Constructor Details
-
STD
public STD()
-
-
Method Details
-
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
-
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
-
getSkew
public double getSkew(double mean, double sig) -
getMedian
public double getMedian()Get the median of the dataset MO 2015/05/17- Returns:
- the median value
-
getMedian
public double getMedian(double[] data) Get the median of the dataset passed to this method. Note that the dataset passed will replace any dataset that is currently loaded into this object, and mean and stddev will be recalculated. The median flag will also be reset, requiring a recalculation the next time it's requested. MO 2015/05/17- Parameters:
data
- the data array to test- Returns:
- the median value
-
getVariance
public double getVariance()Get the variance of the dataset already loaded in this class MO 2015/05/17- Returns:
- the variance of the data
-
getVariance
public double getVariance(double[] data) Get the variance of the dataset passed to this method. Note that the dataset passed will replace any dataset that is currently loaded into this object, and mean and stddev will be recalculated. The median flag will also be reset, requiring a recalculation the next time it's requested. MO 2015/05/17- Parameters:
data
- the data array to test- Returns:
- the variance
-