## Class Statistics

• ```public class Statistics
extends Object```
This class provides some basic statistics methods.
Author:
Tom Kazimiers
• ### Constructor Summary

Constructors
Constructor and Description
`Statistics()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static double` `erf(double z)`
Calculates an estimate of the upper tail cumulative normal distribution (which is simply the complementary error function with linear scalings of x and y axis).
`static double` `phi(double z)`
Calculates phi, which is the area of the Gaussian standard distribution from minus infinity to the query value in units of standard derivation.
`static double` ```phi(double z, double mean, double sd)```
Calculates phi, but with a Gaussian distribution defined by its mean and its standard derivation.
`static double` `stdDeviation(List<Double> values)`
Calculates the standard deviation of a list of values.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### Statistics

`public Statistics()`
• ### Method Detail

• #### erf

`public static double erf(double z)`
Calculates an estimate of the upper tail cumulative normal distribution (which is simply the complementary error function with linear scalings of x and y axis). Fractional error in math formula less than 1.2 * 10 ^ -7. although subject to catastrophic cancellation when z in very close to 0 Code from (thanks to Bob Dougherty): w Original algorithm from Section 6.2 of Numerical Recipes
• #### phi

`public static double phi(double z)`
Calculates phi, which is the area of the Gaussian standard distribution from minus infinity to the query value in units of standard derivation. The formula is: 1 + erf( z / sqrt(2) ) Phi(z) = ---------------------- 2
Parameters:
`z` - The point of interest
Returns:
phi
• #### phi

```public static double phi(double z,
double mean,
double sd)```
Calculates phi, but with a Gaussian distribution defined by its mean and its standard derivation. This is a quantile. 1 + erf( (z - mean) / (sqrt(2) * stdDev) ) Phi(z,mean,stdDev) = ------------------------------------------ 2 *
Parameters:
`z` - The point of interest
`mean` - The mean of the distribution
`sd` - The standard derivation of the distribution
Returns:
phi
• #### stdDeviation

`public static double stdDeviation(List<Double> values)`
Calculates the standard deviation of a list of values.
Parameters:
`values` - The list of values.
Returns:
The standard deviation.