[
https://issues.apache.org/jira/browse/STATISTICS-34?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alex Herbert resolved STATISTICS-34.
------------------------------------
Resolution: Fixed
Implemented in commit:
5f44ae372410b1994933875bd1ea79b73464b0df
> Geometric distribution to switch PMF computation for increased accuracy
> -----------------------------------------------------------------------
>
> Key: STATISTICS-34
> URL: https://issues.apache.org/jira/browse/STATISTICS-34
> Project: Apache Commons Statistics
> Issue Type: Improvement
> Components: distribution
> Affects Versions: 1.0
> Reporter: Alex Herbert
> Priority: Trivial
> Fix For: 1.0
>
>
> The Geometric distribution is defined by the probability of success (p).
> The PMF is:
> {noformat}
> pmf(x) = pow(1 - p, x) * p
> {noformat}
> This can be implemented directly or using exponential functions:
> {code:java}
> double p1 = Math.pow(1.0 - p, x) * p;
> double p2 = Math.exp(Math.log1p(-p) * x) * p;
> {code}
> The current code uses exponential functions. Implementations in Matlab, R and
> SciPy all use the power function. Both have advantages depending on the value
> of p.
> When p is >= 0.5 the value (1-p) is exact. As p becomes increasingly small
> then (1-p) loses precision due to the limited precision of a double value
> close to 1.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)