## Class Gaussian

• java.lang.Object

• ```public class Gaussian
extends java.lang.Object```
Function to compute the Gaussian pdf (probability density function) and the Gaussian cdf (cumulative density function)
``` % java Gaussian 820 1019 209
0.17050966869132111

% java Gaussian 1500 1019 209
0.9893164837383883

% java Gaussian 1500 1025 231
0.9801220907365489
```
The approximation is accurate to absolute error less than 8 * 10^(-16). Reference: Evaluating the Normal Distribution by George Marsaglia: http://www.jstatsoft.org/v11/a04/paper
Author:
Andy Flury
• ### Constructor Summary

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

All Methods
Modifier and Type Method and Description
`static void` `main(java.lang.String[] args)`
main method for testing
`static double` `phi(double x)`
returns phi(x) = standard Gaussian pdf
`static double` `Phi(double z)`
returns Phi(z) = standard Gaussian cdf using Taylor approximation
`static double` ```phi(double x, double mu, double sigma)```
returns phi(x, mu, signma) = Gaussian pdf with mean mu and stddev sigma
`static double` ```Phi(double z, double mu, double sigma)```
returns Phi(z, mu, sigma) = Gaussian cdf with mean mu and stddev sigma
`static double` `PhiInverse(double y)`
Computes such that Phi(z) = y via bisection search
• ### Methods inherited from class java.lang.Object

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

• #### Gaussian

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

• #### phi

`public static double phi(double x)`
returns phi(x) = standard Gaussian pdf
Parameters:
`x` - The x value
Returns:
The phi value
• #### phi

```public static double phi(double x,
double mu,
double sigma)```
returns phi(x, mu, signma) = Gaussian pdf with mean mu and stddev sigma
Parameters:
`x` - The x value
`mu` - The mu value
`sigma` - The sigma value
Returns:
The phi value
• #### Phi

`public static double Phi(double z)`
returns Phi(z) = standard Gaussian cdf using Taylor approximation
Parameters:
`z` - The z value
Returns:
The phi value
• #### Phi

```public static double Phi(double z,
double mu,
double sigma)```
returns Phi(z, mu, sigma) = Gaussian cdf with mean mu and stddev sigma
Parameters:
`z` - The z value
`mu` - The mu value
`sigma` - The sigma value
Returns:
The phi value
• #### PhiInverse

`public static double PhiInverse(double y)`
Computes such that Phi(z) = y via bisection search
Parameters:
`y` - The y value
Returns:
The inverse phi value
• #### main

`public static void main(java.lang.String[] args)`
main method for testing
Parameters:
`args` - The program startup arguments