Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple statistics - Java packages for calculating mean, standard deviation, etc [closed]

Could you please suggest any simple Java statistics packages?

I don't necessarily need any of the advanced stuff. I was quite surprised that there does not appear to be a function to calculate the Mean in the java.lang.Math package...

What are you guys using for this?


EDIT

Regarding:

How hard is it to write a simple class that calculates means and standard deviations?

Well, not hard. I only asked this question after having hand-coded these. But it only added to my Java frustration not to have these simplest functions available at hand when I needed them. I don't remember the formula for calculating stdev by heart :)

like image 585
Peter Perháč Avatar asked Nov 14 '09 22:11

Peter Perháč


People also ask

Is there a standard deviation function in Java?

To calculate the standard deviation, calculateSD() function is created. The array containing 10 elements is passed to the function and this function calculates the standard deviation and returns it to the main() function.

How do you calculate deviations in Java?

Its symbol is sigma( σ ). It is the square root of variance. Standard deviation is computed using the formula square root of ∑(Xi - ų)2 / N where Xi is the element of the array, ų is mean of the elements of the array, N is the number of elements, ∑ is the sum of the each element.


1 Answers

Apache Commons Math, specifically DescriptiveStatistics and SummaryStatistics.

like image 159
John Paulett Avatar answered Sep 18 '22 17:09

John Paulett