https://issues.apache.org/bugzilla/show_bug.cgi?id=49538

Yegor Kozlov <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Yegor Kozlov <[email protected]> 2010-07-26 08:24:56 EDT ---
Thanks for the patch, applied in r979255

We had a debate whether to depend on commons-math or not and we think in the
case of POISSON  we can do without third party libraries, the implementation of
Poisson distribution is really a few lines of code: 

        private double probability(int k, double lambda) {
            return Math.pow(lambda, k) * Math.exp(-lambda) / factorial(k);
        }

        private double cumulativeProbability(int x, double lambda) {
            double result = 0;
            for(int k = 0; k <= x; k++){
                result += probability(k, lambda);
            }
            return result;
        }


Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to