[ https://issues.apache.org/jira/browse/MATH1034?page=com.atlassian.jira.plugin.system.issuetabpanels:commenttabpanel&focusedCommentId=13782239#comment13782239
]
Phil Steitz edited comment on MATH1034 at 9/30/13 9:13 PM:

Initial commit in r1527777 with the following changes:
* Eliminated references to R equivalents in AlternativeHypothesis. This is useful but commits
us to keeping up with R changes, so best to drop.
* Minor edits to javadoc
* Replaced license header with standard header (same content, just format)
* Added $Id$ and @version tags
* Made distribution final in implementation code
* Fixed check style complaints (mostly {} around if blocks)
* Externalized exception strings
* Used NullArgumentException for null alternativeHypothesis
* Used MathInternalError for bad enum value (should be impossible)
* Added verification of null AlternativeHypothesis behavior in unit test
Still left to do:
* Improve precision sensitivity of unit tests. Use R options(digits=12) if necessary to display
more digits of accuracy. Mention the version of R used to generate the reference values in
test comments.
* Add more unit tests.
* Consider the following changes / improvements:
0) To be consistent with the other inference tests, specify "significance level" rather than
"confidence level" in test parameters (so e.g .95 becomes .05)
1) I suspect the efficiency of the code for the twosided pvalue computation can be improved.
Instead of effectively searching for the numberOfSuccesses as the code does now, start by
comparing the number of successes to the mean = numberOfTrials * p. If the number of successes
is greater than the mean, return twice the tail probability above this value; if it is less,
return twice the tail probability below it.
was (Author: psteitz):
Initial commit in r1527777 with the following changes:
* Eliminated references to R equivalents in AlternativeHypothesis. This is useful but commits
us to keeping up with R changes, so best to drop.
* Minor edits to javadoc
* Replaced license header with standard header (same content, just format)
* Added $Id$ and @version tags
* Made distribution final in implementation code
* Fixed check style complaints (mostly {} around if blocks)
* Externalized exception strings
* Used NullArgumentException for null alternativeHypothesis
* Used MathInternalError for bad enum value (should be impossible)
* Added verification of null AlternativeHypothesis behavior in unit test
Still left to do:
* Improve precision sensitivity of unit tests. Use R options(digits=12) if necessary to display
more digits of accuracy. Mention the version of R used to generate the reference values in
test comments.
* Add more unit tests.
* Consider the following changes / improvements:
0) To be consistent with the other inference tests, specify "significance level" rather than
"confidence level" in test parameters (so e.g .95 becomes .05)
1) I suspect the efficiency of the code for the teesided pvalue computation can be improved.
Instead of effectively searching for the numberOfSuccesses as the code does now, start by
comparing the number of successes to the mean = numberOfTrials * p. If the number of successes
is greater than the mean, return twice the tail probability above this value; if it is less,
return twice the tail probability below it.
> Add binomial test
> 
>
> Key: MATH1034
> URL: https://issues.apache.org/jira/browse/MATH1034
> Project: Commons Math
> Issue Type: Wish
> Affects Versions: 3.2
> Reporter: Thorsten SchÃ¤fer
> Priority: Minor
> Attachments: binomialTest.patch, binomialTest.patch
>
>
> A binomial test would be a nice addition to commonsmath. I might supply a patch in the
near future. I guess the interface should be similar to the other tests, i.e., a method to
get the pvalue and a method returning a boolean indicating reject/nonreject.
> Is there a policy about using Enumerations in commonsmath? For instance, in R you can
test twosided, less or greater. This could be done using an enumeration in Java, but I'm
not sure if this is discouraged for backward compatibility reasons...

This message was sent by Atlassian JIRA
(v6.1#6144)
