Structural Safety, 9 (1991) 315-318
315
Elsevier
SHORT COMMUNICATION
A SIMPLE APPROXIMATION TO THE GAUSSIAN DISTRIBUTION Mario Ordaz Instituto de Ingenier~a, UNAM, Ciudad Universitaria, Coyoac~n 04510, DF, Mexico
We present a very simple approximation to the standard Gaussian distribution. While it is not as accurate as others that can be found in the literature [1-3], its form is especially suitable to solve some integrals, involving Gaussian cumulative density functions, that do not have analytical solutions. Let
*(x)=
x
~1
f l o~e
-
u2/2
du
An approximation to ~ ( x ) for nonpositive x is given by
• (x)----0.6931exp{- (914 8)2}
(1)
and since ~ ( - x ) = 1 - ~ ( x ) , eqn. (1) can also be used for x > 0. The absolute errors associated with this estimation are presented in Fig. 1 for the range - 4 ~< x ~< 4, whereas Fig. 2 depicts the relative errors in the same range. The former are acceptable for the whole interval of x and the
A B S O L U T E E R R O R I N ,~(x)
RELATIVE ERROR IN #(x) 10
.004 .002
5
cX 000
0
-.002
-5
5
-.004 I
I
I
~
I
1
-3
-2
-I
0
I
2
-10 t
-3
.T
Fig. 1. Absolute error in computing ~ ( x ) approximation given in eqn. (1).
I
-2
I
-1
I
I
t
I
0
1
2
3
4
X
with the
Fig. 2. Relative error in computing ~ ( x ) approximation given in eqn. (1).
0167-4730/91/$03.50 © 1991 - Elsevier Science Publishers B.V.
with the
316 ABSOLUTE
ERROR
IN
z
.020 .015 .010 r<
.005 .000
,-4 - . 0 0 5 c~ - . 0 1 0 "~ - . 0 1 5 i
I
I
-3
-2
-1
-.020 --z
0
I
J
I
1
2
3
4
=
Fig. 3. Absolute error in computing x, given qb(x), using eqn. (2).
latter are small for x >1 - 3. The right-hand side member of eqn. (1) is easy to invert to obtain x, given ~ ( x ) : x=~-[8-14(In(0.6931/O(x))],
for O ( x ) ~ < 0 . 5
(2)
.006 Cb
A
.004
,L~ = - - 3
3 a:
r<
I~ = - 1
.002
/2,=_3
2
.000 "~ - . 0 0 2 t~=1
~4
1
~
o
-.004 -.006
i
i 10
.0
i
i 2.0
~
I 3.0
~4
I
-2
4.0
.o
.006 ~4
"~iz=3
#=-1
a~
I
~
I
1.0
I
I
2.0
I
J
3.0
4.0
4
.004
B
.002
~
3
if=-1 / , J
~
~
it=-3 I
/
~ a~ a~
2
~
o
t~ = - 3 =1
B
.000
-.oo2
I~ = 3
-.006
I .0
I 10
I
~ 2.0
i
I 3.0
(1
Fig. 4. Absolute error in / 1 ( - oo, oo; /~, o) (see eqn. (3) for its definition) for several values of/~ and o in two cases: (A) when eqn. (1) is used recursively; and (B) when the approximation given in Ref. [2] is used in the second stage of calculation.
o4 4.0
-2
I .0
L 1.0
I
L 2.0
I
I 3.0
k
I 4.0
(T
Fig. 5. Relative error in 11(- oo, oo; /.t, o) (see eqn. (3) for its definition) for several values of ff and o in two cases: (A) when eqn. (1) is used recursively; and (B) when the approximation given in Ref. [2] is used in the second stage of calculation.
317
The errors on the estimation of x are presented in Fig. 3. Equation (2) can be used to simulate Gaussian deviations with the inverse method. Although the proposed approximation is satisfactory for many applications, a powerful use consists of replacing ~ ( . ) in integrals of the form
,r(a, b; t,,
=
du
(3)
where ~ ( . ) denotes the Gaussian density function with mean ~ and standard deviation o. These integrals, in general, do not possess closed solutions, and replacing d~(u) with approximations based on ratios of polynomials would not lead to a closed form. However, use of eqn. (1) instead of ~ ( . ) in eqn. (3) produces an approximate analytical solution. Integrals of this kind appear, for instance, when computing reliability under uncertain loading, or when calculating expected losses due to earthquake damage [4]. To calibrate the approximation, we compute I 1 ( - o o , oo; #, o ) - - w h i c h can be analytically solved--replacing eqn. (1) in the integrand of eqn. (3). The closed solution requires the evaluation of ~ ( x ) , so there are two possibilities: the use eqn. (1) recursively or to use a more accurate approximation in this second stage. We present in Fig. 4 the absolute errors, for several values of/~ and o, induced by the approximation in both cases: (A) with the recursive use of eqn.
.006 e<
.004 .002 .000 -. 002 -.004
-. 006
,LI,= - - 3
6
~4
c~
'
I
I
1.0
.0
I
I
I
2.0
r¢ c4 r4
4
~
2
~
0
I
3.0
I
-2
4.0
t
I
1.0
.0
f
l
2.0
r
3.0
40
(7
.006
8
e¢
.004
6
~4
.002
a~ ~
#=-3
B
4
.000
l,t=3
2
-. 002
~=1
-.004 I
-.006
I
i]3- = -- 1
I
I
I --2
.0
1.0
2.0
3.0
4.0
(7
Fig. 6. Absolute error in 12(- oo, ¢~; F, o) (see eqn. (3) for its definition) for several values of/~ and o in two cases: (A) when ¢qn. (1) is used recursively; and (B) when the approximation given in Ref. [2] is used in the second stage of calculation.
I
.0
p
1.0
I
i
2.0
i
I
3.0
i
4.0
(7
Fig. 7. Relative error in 12(- o0, oo; ~, a) (see eqn. (3) for its definition) for several values of ~ and o in two cases: (A) when eqn. (1) is used recursively; and (B) when the approximation given in Ref. [2] is used in the second stage of calculation.
318 (1); and (B) with the use of the expressions given in Ref. [2] to compute ~ ( x ) in the resulting function. The corresponding relative errors are depicted in Fig. 5. We also computed ~ 2 ( - ~ , ~ ; ~, a ) - - w h i c h has not an analytical s o l u t i o n - - w i t h eqn. (1), for different values of ~ and o. Results, in terms of absolute and relative errors, are presented in Figs. 6 and 7, where the exact solutions were computed with Simpson's rule and a very small step. The errors appear to be small enough for applications where speed is as valuable as precision.
ACKNOWLEDGEMENTS I am grateful to E. Rosenblueth for his encouragement and critical review of the manuscript. I also appreciate the constructive suggestions made by the reviewers.
REFERENCES 1 J.-T. Lin, Alternatives to Hamaker's approximation to the cumulative normal distribution and its inverse, The Statistician, 37 (1988) 413-414. 2 M. Zelen and N.C. Severo, Probability functions, in: M. Abramowitz and I. Stegun (Eds.), Handbook of Mathematical Functions, Dover, New York, NY, 1965. 3 E. Rosenblueth, On computing normal refiabilities, Structural Safety, 2 (3) (1985) 165-167. 4 E. Rosenblueth, What should we do with structural reliabilities?, ICASP 5, Vancouver, Canada, May 1987, pp. 25-29.