normalDistribution
normalDistribution(
x,mean,standardDeviation,cumulative?):number
Defined in: src/normal_distribution.js:27
Returns either the probability density or the cumulative probability of a normal distribution with the given mean and standard deviation, evaluated at x. It is the equivalent of the NORM.DIST function found in spreadsheet software.
The cumulative form is computed with errorFunction, so it is more precise
than converting x to a z-score and looking it up in the four-decimal
standardNormalTable used by cumulativeStdNormalProbability.
Parameters
Section titled “Parameters”number
the value for which you want the distribution
number
the mean of the distribution
standardDeviation
Section titled “standardDeviation”number
the standard deviation of the distribution
cumulative?
Section titled “cumulative?”boolean = false
if true, return the cumulative distribution function; if false, return the probability density function
Returns
Section titled “Returns”number
the probability density at x, or the probability of a value at most x
Throws
Section titled “Throws”if standardDeviation is not greater than zero
Example
Section titled “Example”normalDistribution(42, 40, 1.5, true).toFixed(4); // => '0.9088'normalDistribution(42, 40, 1.5, false).toFixed(4); // => '0.1093'