[ https://issues.apache.org/jira/browse/MATH-1034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13782239#comment-13782239 ]
Phil Steitz commented on MATH-1034: ----------------------------------- 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 tee-sided p-value 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: MATH-1034 > URL: https://issues.apache.org/jira/browse/MATH-1034 > 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 commons-math. 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 p-value and a method returning a > boolean indicating reject/non-reject. > Is there a policy about using Enumerations in commons-math? For instance, in > R you can test two-sided, 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)