7

I'm looking for an efficient Java library (or even a function) to perform the infamous Exact Binomial Test. Something similar to the R function "binom.test" described here.

Can you help me? Thanks a lot! :-)

Federico Giorgi
  • 10,495
  • 9
  • 42
  • 56
  • Is this included in Apache Math [BinomialDistribution](http://commons.apache.org/math/apidocs/index.html)? – GrahamA Jun 06 '12 at 15:15
  • Good point, the answer is yes and no: the Binomial Distribution will give me a p-value, but not the stats associated to the ratio I want to test for significance – Federico Giorgi Jun 07 '12 at 11:22

2 Answers2

2

In addition to the BinomialDistribution Apache commons.math3 3.3 (unreleased at the moment of writing) has a BinomialTest that will get you the p-value as well as BinomialConfidenceInterval. It's not much compared to the stats R package you named, but it's more than just the distribution mentioned above.

Posting this as I landed on your question looking for a way to get just the p val for a known binomial distribution and the link above is the answer.

ilinca
  • 1,343
  • 15
  • 17
1

Maybe you should check http://sourceforge.net/projects/parallelcolt/ This package and apache Math are the most common for statistical computation

Andrey
  • 810
  • 1
  • 9
  • 20
  • ParallelColt is super for linear algebra, so it hurts me to say that it's notthe right answer. As in the Apache Math BinomialDistribution classe, it contains only the Binomial distribution, not a way to convert the values to the binomial stats. Or maybe I'm missing something? – Federico Giorgi Aug 27 '12 at 12:46
  • yep, there is no Binomial test. But recently i've found some benchmark for math libraries (most of them for matrix operations, but maybe there are other functions), and there are several alternatives, maybe you should check other libraries: Efficient Java Matrix Library (EJML); Jama; jblas; JScience (Older benchmarks only); Matrix Toolkit Java (MTJ); OjAlgo; Universal Java Matrix Package (UJMP); Elegant Linear Algebra for java (la4j); http://code.google.com/p/java-matrix-benchmark/ – Andrey Aug 29 '12 at 10:53