1

I am working on a financial system that uses BigDecimal to store values. I need to calculate covariance of two groups of data, but it seems that Java lacks libraries for statistical analysis. The library I'm using is Apache Common Math, which calculate covariance for double value instead of BigDecimal.

http://commons.apache.org/proper/commons-math/javadocs/api-3.5/org/apache/commons/math3/stat/correlation/Covariance.html

Just to check is there any alternatives for this library that accepts BigDecimal?

Thanks!

Jerry Xue
  • 331
  • 2
  • 8
  • This question is off-topic. However, I did see a couple of potentially helpful hits when I Googled "java bigdecimal statistics" – Stephen C Jan 08 '16 at 06:49
  • You might just convert BigDecimals to doubles when computing statistics. It's probably not practically important to compute exact values for statistics. – Robert Dodier Jan 08 '16 at 06:57
  • Just use double. 15 digits of precision is plenty enough. – Joni Jan 08 '16 at 07:58

0 Answers0