[
https://issues.apache.org/jira/browse/MATH-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aleksei Dievskii updated MATH-1136:
-----------------------------------
Description:
The following calculation returns false results:
{{new BinomialDistribution(0, 0.01).logProbability(0)}}
It evaluates to Double.NaN when it should be 0 (cf., for example, "dbinom(0, 0,
0.01, log=T)" in R).
I attach a patch dealing with the problem. The patch also adds a test for this
bug.
was:
The following calculation returns false results:
{{new BinomialDistribution(0, 0.01).logProbability(0)}}
It evaluates to Double.NaN when it should be 0 (cf., for example, "dbinom(0, 0,
0.01, log=T)" in R).
I attach a patch dealing with the problem.
> BinomialDistribution deals with degenerate cases incorrectly
> ------------------------------------------------------------
>
> Key: MATH-1136
> URL: https://issues.apache.org/jira/browse/MATH-1136
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 3.3
> Reporter: Aleksei Dievskii
> Priority: Minor
> Labels: bug, patch
> Attachments: BINOMIAL_DEGENERATE.patch
>
>
> The following calculation returns false results:
> {{new BinomialDistribution(0, 0.01).logProbability(0)}}
> It evaluates to Double.NaN when it should be 0 (cf., for example, "dbinom(0,
> 0, 0.01, log=T)" in R).
> I attach a patch dealing with the problem. The patch also adds a test for
> this bug.
--
This message was sent by Atlassian JIRA
(v6.2#6252)