Skip to content

Instantly share code, notes, and snippets.

@cduruk
Created November 15, 2009 19:54
Show Gist options
  • Save cduruk/235431 to your computer and use it in GitHub Desktop.
Save cduruk/235431 to your computer and use it in GitHub Desktop.
Probability Distribution Function
public static double getPDF(double mu, double sigma, double value){
double exponent = -1 * ((value - mu)*(value - mu)) / (2*sigma*sigma);
double num = Math.exp(exponent);
double denum = sigma*Math.sqrt(2*Math.PI);
return num/denum;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment