Last active
September 25, 2019 14:07
-
-
Save ghalimi/4476478 to your computer and use it in GitHub Desktop.
NORMDIST Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
function NORMDIST(x, mean, sd, cumulative) { | |
// Check parameters | |
if (isNaN(x) || isNaN(mean) || isNaN(sd)) return '#VALUE!'; | |
if (sd <= 0) return '#NUM!'; | |
// Return normal distribution computed by jStat [http://jstat.org] | |
return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment