Implementation of Algorithm AS241, The Percentage Points of the Normal Distribution, in Visual Basic .NET

By Coffee2theorems (talk) – http://en.wikipedia.org/wiki/File:Probit_plot.png, Public Domain, Link

This is a follow-up to my previous post where I detailed my adventures trying to implement in Visual Basic .NET the Inverse Normal Cumulative Distribution Formula (a.k.a. NORMSINV).

As I mentioned in that post, I had been looking for a way to implement the NORMSINV function into a .NET application. I explained how I adapted Peter Acklam’s algorithm for which I adapted some C++ code that I found on the Internet into my .NET application. Later I found that others had done adaptations for various other languages including C#.

Sadly, though Acklam’s algorithm worked well, I could not get the function to match precision closely enough to my legacy program that I was replacing.

Peter Aklam never published his algorithm in any peer-reviewed journals so, other than some historical web pages, it was not possible to follow up to see if any changes or progress took place. However, those historical pages pointed me to the previous work of others.

Conducting that literature research, I found the seminal paper “Algorithm AS 241: The Percentage Points of the Normal Distribution” by Michael J. Wichura (1988), Applied Statistics, vol. 37, pp. 477-484. This paper included an implementation of a function “to compute the percentage point zp of the standard normal distribution corresponding to a prescribed value p for the lower tail area” in FORTRAN. Wichura’s algorithm itself extends previous work by Beasley, J. D. and Springer, S. G. (1977), “The percentage points of the normal distribution”, Applied Statistics, vol. 26, pp. 118-121, which introduced the function PPND (Percentage Points of the Normal Distribution) as part of algorithm AS 111, also published in FORTRAN.

After a quick crash-course in FORTRAN syntax, I was able to easily (but tediously) translate Wichura’s algorithm to Visual Basic .NET. Wichura published two versions of the algorithm in his paper. I only adapted the double-precision function called PPND16 that you can freely download from my github repository.

Since Wichura’s code is published work and all I did was essentially translate it, I am not making any claims to this code other than as a humble contributor. Please feel free to copy or modify it and I hope you find it beneficial.

Leave a Reply