Skip to content

Instantly share code, notes, and snippets.

@loon3
Created December 23, 2014 20:28
Show Gist options
  • Save loon3/4507556f5a3988c0f580 to your computer and use it in GitHub Desktop.
Save loon3/4507556f5a3988c0f580 to your computer and use it in GitHub Desktop.
function pdf(i, mu, sigma) {
var m = sigma * Math.sqrt(2 * Math.PI);
var e = Math.exp(-Math.pow(i - mu, 2) / (2 * Math.pow(sigma, 2)));
var point = e / m;
return point;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment