[ https://issues.apache.org/jira/browse/MATH-1401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994384#comment-15994384 ]
Bruno P. Kinoshita commented on MATH-1401: ------------------------------------------ With the latest code from master today (dff1a0953d97d46290750a46d01be1e1519ae698): {code} ConfidenceInterval ci = IntervalUtils.getClopperPearsonInterval(1, 0, 0.95); {code} Throws: {noformat} Exception in thread "main" org.apache.commons.math4.exception.MathIllegalArgumentException: lower bound (0) must be strictly less than upper bound (0) at org.apache.commons.math4.stat.interval.ConfidenceInterval.checkParameters(ConfidenceInterval.java:103) at org.apache.commons.math4.stat.interval.ConfidenceInterval.<init>(ConfidenceInterval.java:57) at org.apache.commons.math4.stat.interval.ClopperPearsonInterval.createInterval(ClopperPearsonInterval.java:56) at org.apache.commons.math4.stat.interval.IntervalUtils.getClopperPearsonInterval(IntervalUtils.java:104) {noformat} And: {code} ConfidenceInterval ci = IntervalUtils.getClopperPearsonInterval(1, 1, 0.95); {code} Throws: {noformat} Exception in thread "main" org.apache.commons.math4.exception.NotStrictlyPositiveException: degrees of freedom (0) at org.apache.commons.math4.distribution.FDistribution.<init>(FDistribution.java:85) at org.apache.commons.math4.distribution.FDistribution.<init>(FDistribution.java:63) at org.apache.commons.math4.stat.interval.ClopperPearsonInterval.createInterval(ClopperPearsonInterval.java:49) at org.apache.commons.math4.stat.interval.IntervalUtils.getClopperPearsonInterval(IntervalUtils.java:104) {noformat} > 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 > 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)