Skip to content

normalDistribution

normalDistribution(x, mean, standardDeviation, cumulative?): number

Defined in: src/normal_distribution.js:27

Normal distribution

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.

number

the value for which you want the distribution

number

the mean of the distribution

number

the standard deviation of the distribution

boolean = false

if true, return the cumulative distribution function; if false, return the probability density function

number

the probability density at x, or the probability of a value at most x

if standardDeviation is not greater than zero

normalDistribution(42, 40, 1.5, true).toFixed(4); // => '0.9088'
normalDistribution(42, 40, 1.5, false).toFixed(4); // => '0.1093'