[
https://issues.apache.org/jira/browse/MATH-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16002481#comment-16002481
]
Bruno P. Kinoshita commented on MATH-1401:
------------------------------------------
Found a better paper explaining it (A. Boomsma, "Confidence Intervals for a
Binomial Proportion" link: http://www.ppsw.rug.nl/~boomsma/confbin.pdf).
{quote}
For x = 0, the lower limit r1 = 0, because the upper limit ru satisfies the
equality (1 - ru) ^n = alpha / 2, from which it follows that ru = 1 - (alpha /
2) ^ 1/n.
For x = n, the upper limit ru = 1, because the lower limit satisfies r = alpha
/ 2, which makes r = (alpha / 2) ^ 1/n.
{quote}
Which matches exactly with the R implementation. I will update the code, and
run some codes for this Case #1. In case it works, will report back here and
focus on Case #2 (which could be automatically fixed by fixing Case#1 I
think...).
> Exception at IntervalUtils.getClopperPearsonInterval
> ----------------------------------------------------
>
> Key: MATH-1401
> URL: https://issues.apache.org/jira/browse/MATH-1401
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 3.6.1
> Reporter: Art
> Assignee: Bruno P. Kinoshita
> Fix For: 4.0
>
>
> IntervalUtils.getClopperPearsonInterval throws an exception when number of
> successes equals to zero or number of successes = number of trials.
> IntervalUtils.getClopperPearsonInterval(1, 0, 0.95) or
> IntervalUtils.getClopperPearsonInterval(1, 1, 0.95) throws
> org.apache.commons.math3.exception.NotStrictlyPositiveException despite that
> its input parameters are valid.
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)