Alex Herbert created STATISTICS-58:
--------------------------------------

             Summary: Investigate the discrete distribution inverse probability 
default implementation
                 Key: STATISTICS-58
                 URL: https://issues.apache.org/jira/browse/STATISTICS-58
             Project: Commons Statistics
          Issue Type: Task
          Components: distribution
    Affects Versions: 1.0
            Reporter: Alex Herbert


The default inverse probability implementation for the discrete distributions 
uses a simple bisection search within an initial bracket. Bracketing is based 
on the mean and variance of the distribution and the input p-value.

The worst case scenario is a bracket between Integer min and max value (range 
2^32 -1). A bisection search would require 32 iterations to find the value x 
for input probability p.
{noformat}
// Range [a, b]
max = log2(b - a){noformat}
The following distributions are currently in the library:
||Distribution||a||b||Notes||
|Binomial(n, p)|0|n| |
|Geometric(p)|0|infinity|Inverted using a formula|
|Hypergeometric(N, K, n)|max(0, n+K-N) |min(n, k)| |
|Pascal(n, p)|0|infinity|Negative binomial distribution|
|Poisson(mu)|0|infinity| |
|Uniform(a, b)|a|b|Inverted using a formula|
|Zipf(N, s)|1|N| |

For several of the distributions the range is limited by the parameters. 
Notable exceptions are the Pascal and Poisson distribution. An investigation 
should be made to determine the number of iterations required for inversion and 
whether this can be improved.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to