While the function may look complicated, it is really nothing more than a series of nested when()
functions to select the appropriate estimating method for value the input x argument. erf() calls itself for
x<0; there is only one level of recursion.
These references have more discussion of the error function:
Handbook of Mathematical Functions, Abramowitz and Stegun, Dover, 1965.
Special Functions and Their Applications, Lebedev, Dover, 1972.
[6.35] Cumulative normal distribution and inverse
The cumulative normal (or Gaussian) distribution is defined as
[1]
Pr X
[
x
=
p(x)
=
1
✤
2
✜
¶
−
∞
x
e
(t
−
m)2
2
✤
2
dt
where m is the mean and
is the variance, so is the standard deviation. In other words, this integral
✤
2
✤
is the area under the probability function to the left of x. This is also sometimes called the 'lower tail' of
the distribution. When the mean is 0 and the variance is 1, this is called the standard cumulative
normal distribution.
You can find the cumulative normal distribution by integrating equation [1] with the nint() function. The
function below, cndint(), does this.
cndint(x,m,s)
Func
©(x,mean,std dev) find CND with integration
©29oct00/[email protected]
1
/(s*
√
(2*Œ))*nint(
ℯ
^(
⁻
.5*((t-m)/s)^2),t,
⁻∞
,x)
Endfunc
For x = 0, mean = 0 and standard deviation = 1, cndint() returns the probability p = 0.49999999952549
in about 7.5 seconds on a HW2 92+ with AMS 2.05. The answer should be p = 0.5. For x = 6, mean =
0 and standard deviation = 1, cndint() returns p = 0.99999999853883 in about 10.5 seconds. This
answer is in error by about -5E-10. We can write functions that are much faster and somewhat more
accurate.
It turns out that the cumulative normal distribution (called CND from now on) can be found efficiently
with the error function erf(x). First, this identity relates the standard CND to the general CND:
[2]
Pr X
[
x
=
P(
x
−
m
✤
)
where P(x) is the standard CND. This converts a distribution with mean m and standard deviation to
✤
the standard CND. Next, this identity relates P(x) to erf(x):
[3]
erf
(
x
) =
2
$
P(x 2 )
−
1
which can be solved for
6 - 66
Содержание TI-92+
Страница 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Страница 53: ...LCD connector detail PCB switch side 1 42...
Страница 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Страница 55: ...Key cap detail 1 44...
Страница 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Страница 59: ...Keypad rubber sheet key cap side Inside front cover showing keycaps in place Detail of a key cap 1 48...
Страница 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...