commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [math] avoid allocating distribution bounds if there are no successes
Date Wed, 01 Jun 2016 22:25:44 GMT
Given that the 'master' branch is normally where development takes
place, this problem is going to keep recurring.

Maybe MATH should consider using 'master' as the normal development
branch and 'release' or somesuch for the release candidate.


On 29 May 2016 at 22:42, Gilles <gilles@harfang.homelinux.org> wrote:
> Hi.
>
> Thanks for willing to participate, but the "master" branch should be
> modified only by merging the "develop" into it (before preparing a
> release).
> Cf. rationale in "doc/development/development.howto.txt" (in the
> "develop" branch).
>
> Regards,
> Gilles
>
>
>
> On Sun, 29 May 2016 21:28:11 +0000 (UTC), dbrosius@apache.org wrote:
>>
>> Repository: commons-math
>> Updated Branches:
>>   refs/heads/master 91b2f4294 -> 02dd98a04
>>
>>
>> avoid allocating distribution bounds if there are no successes
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
>> Commit:
>> http://git-wip-us.apache.org/repos/asf/commons-math/commit/02dd98a0
>> Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/02dd98a0
>> Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/02dd98a0
>>
>> Branch: refs/heads/master
>> Commit: 02dd98a04570a1beba88566281efcabc8ff6f73d
>> Parents: 91b2f42
>> Author: Dave Brosius <dbrosius@mebigfatguy.com>
>> Authored: Sun May 29 17:27:37 2016 -0400
>> Committer: Dave Brosius <dbrosius@mebigfatguy.com>
>> Committed: Sun May 29 17:27:37 2016 -0400
>>
>>
>> ----------------------------------------------------------------------
>>  .../math4/stat/interval/ClopperPearsonInterval.java | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> ----------------------------------------------------------------------
>>
>>
>>
>>
>> http://git-wip-us.apache.org/repos/asf/commons-math/blob/02dd98a0/src/main/java/org/apache/commons/math4/stat/interval/ClopperPearsonInterval.java
>>
>> ----------------------------------------------------------------------
>> diff --git
>>
>>
>> a/src/main/java/org/apache/commons/math4/stat/interval/ClopperPearsonInterval.java
>>
>>
>> b/src/main/java/org/apache/commons/math4/stat/interval/ClopperPearsonInterval.java
>> index bf5d6ad..ed0904c 100644
>> ---
>>
>>
>> a/src/main/java/org/apache/commons/math4/stat/interval/ClopperPearsonInterval.java
>> +++
>>
>>
>> b/src/main/java/org/apache/commons/math4/stat/interval/ClopperPearsonInterval.java
>> @@ -35,19 +35,19 @@ public class ClopperPearsonInterval implements
>> BinomialConfidenceInterval {
>>          IntervalUtils.checkParameters(numberOfTrials,
>> numberOfSuccesses, confidenceLevel);
>>          double lowerBound = 0;
>>          double upperBound = 0;
>> -        final double alpha = (1.0 - confidenceLevel) / 2.0;
>> -
>> -        final FDistribution distributionLowerBound = new
>> FDistribution(2 * (numberOfTrials - numberOfSuccesses + 1),
>> -
>>  2 * numberOfSuccesses);
>> +
>>          if (numberOfSuccesses > 0) {
>> +            final double alpha = (1.0 - confidenceLevel) / 2.0;
>> +
>> +            final FDistribution distributionLowerBound = new
>> FDistribution(2 * (numberOfTrials - numberOfSuccesses + 1),
>> +
>>      2 * numberOfSuccesses);
>>              final double fValueLowerBound =
>> distributionLowerBound.inverseCumulativeProbability(1 - alpha);
>>              lowerBound = numberOfSuccesses /
>>                           (numberOfSuccesses + (numberOfTrials -
>> numberOfSuccesses + 1) * fValueLowerBound);
>> -        }
>>
>> -        final FDistribution distributionUpperBound = new
>> FDistribution(2 * (numberOfSuccesses + 1),
>> -
>>  2 * (numberOfTrials - numberOfSuccesses));
>> -        if (numberOfSuccesses > 0) {
>> +
>> +            final FDistribution distributionUpperBound = new
>> FDistribution(2 * (numberOfSuccesses + 1),
>> +
>>      2 * (numberOfTrials - numberOfSuccesses));
>>              final double fValueUpperBound =
>> distributionUpperBound.inverseCumulativeProbability(1 - alpha);
>>              upperBound = (numberOfSuccesses + 1) * fValueUpperBound /
>>                           (numberOfTrials - numberOfSuccesses +
>> (numberOfSuccesses + 1) * fValueUpperBound);
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message