[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-dev
Subject:    DO NOT REPLY [Bug 49538] [PATCH] Implementing a excel predefined
From:       bugzilla () apache ! org
Date:       2010-07-26 12:25:00
Message-ID: 201007261225.o6QCP0wQ018359 () thor ! apache ! org
[Download RAW message or body]

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

Yegor Kozlov <yegor@dinom.ru> changed:

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

--- Comment #6 from Yegor Kozlov <yegor@dinom.ru> 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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic