Wikipedia has listed a variety of numerical methods for computing cumulative probability of a normal distribution. However, with Apache Commons Math you do not need know about any of them as the library simply does the job for you:
NormalDistribution normal = new NormalDistribution(mu, sigma);
normal.cumulativeProbability(x);
For some research project, I'm interested to know what method they use. Does anyone know what method Apache Commons Math uses to approximate the normal cumulative value? Is it from the methods listed in wikipedia or they have implemented something different?
The beauty of open source software is that you can always check the source code. The implementation of cumulativeProbability is rather simple, it just returns
0.5 * (1 + Erf.erf(dev / (standardDeviation * SQRT2)));
where Erf.erf computes the error function. It's defined here.
And no, it doesn' use any of the special methods in the mentioned Wikipedia article. It's just a straight-forward implementation of the formula

You can probably see the source code or the javadoc. See there http://commons.apache.org/proper/commons-math/source-repository.html
and
http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math3/distribution/NormalDistribution.html
Also, there is alot of information in the user's guide. The section about distribution seems interesting: http://commons.apache.org/proper/commons-math/userguide/distribution.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With