                       F i l e    I n f o r m a t i o n

* DESCRIPTION
Readme file for GAUSS.PAS.

* ASSOCIATED FILES
GAUSS.PAS
GAUSS.DAT
GAUSS.TPM
GAUSS.TXT
README.WP5

* KEYWORDS
TURBO PASCAL V4.0 MATH CURVE ALGORITHM GAUSSIAN

==========================================================================
}
July 26, 1988



Greetings,


You will find enclosed a small program I wrote during the last few weeks. It
contains two simple but quite useful tools for statistical programs : a
function to evaluate the area under the gaussian ( or normal ) curve and a
procedure to reverse the first, that is, given an area under the gaussian
curve it will return the corresponding Z.

The first of these tools has been inspired by a program written by Bob Fruit
called NORMAL.PAS that I had the chance to review last May. I use exactly the
same interpolation algorithm ( a clamped cubic spline ). I modified his
program by using the Numerical Toolbox to generate a table of known values of
the gaussian curve. This table is included in the file GAUSS.DAT and is
accurate to at least 6, maybe much more, significant figures. I also derived
an exact solution for the second derivative of the curve ( needed for the
interpolation ) and I use this instead of tabulated values. The rest is only
fine-tuning.

The second is to my knowledge entirely new. It use iteration to approach a
solution. ( The exact algorithm is a simplified Secant Algorithm, as described
in the Numerical Toolbox ). It is quite fast, especially around Z = 0, and
reasonably accurate.  I had to use different convergence algorithms for Z
positive and Z negative because of round-off errors.

The program is named GAUSS.PAS and include a small demonstration loop. It has
been written with Turbo Pascal 4.0 using a math coprocessor. Neither is
actually necessary but using TP 3.0 would require a little rewriting of the
TYPE definitions and using without a math coprocessor would simply require
recompilation.

I hope you will find both tools interesting,


Best,


Marc Lalibert
PO Box 308
Verdun, Qubec, Canada H4G 3E9
Phone: 514 765 9664 ( home )   514 366 4850 ( work )
