Originally Posted by
Bsims
f(z)= (1/sqrt(2*pi)) * e^(-z^2/2)
This equation corresponds to the standard normal probability density function (the "pdf"), while NORMSDIST() corresponds to the standard normal cumulative distribution function (the "cdf").
The former represents the value of the function at any given point, while the latter represents the probability that a random variable with a standard normal distribution will have the specified value or less (i.e., it's the area under the curve of the pdf evaluated from -∞ through the point in question).
In other words:
The pdf is analogous to the probability mass function (or "pmf") of a discrete random variable. So while the pmf of the binomial distribution would tell you the probability of getting exactly 5 heads out of 10 flips of a coin (~24.61%), the cdf would tell you the probability of getting at most 5 heads out of 10 flips of a coin (~62.30%).
Similarly, the cdf of the standard normal would tell you the probability of being at most 1.3333 standard deviations above the mean.
Unfortunately, no closed form solution exists for the above integral. Following, however, is a "pretty good" approximation implemented in VBA:
Code:
Public Function NormProb(x As Double) As Double
' Note: Approximation not sufficiently accurate
' for targeting of nuclear warheads.
' Please use with caution.
Dim t As Double
Const b1 As Double = 0.31938153
Const b2 As Double = -0.356563782
Const b3 As Double = 1.781477937
Const b4 As Double = -1.821255978
Const b5 As Double = 1.330274429
Const p As Double = 0.2316419
Const c As Double = 0.39894228
If x >= 0 Then
t = 1# / (1# + p * x)
NormProb = (1# - c * Exp(-x * x / 2#) * t * _
(t * (t * (t * (t * b5 + b4) + b3) + b2) + b1))
Else
t = 1# / (1# - p * x)
NormProb = (c * Exp(-x * x / 2#) * t * _
(t * (t * (t * (t * b5 + b4) + b3) + b2) + b1))
End If
End Function
NORMPROB(1.3333) returns a value of 0.90878325 in Excel, while NORMSDIST returns a value of 0.90878331, off by about 0.0000068%.