Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get median from number series using Apache Commons Math

Using Apache Commons Math, how do I get the median from a series of numbers?

The Commons Math User Guide says DescriptiveStatistics supports median, yet the JavaDocs for DescriptiveStatistics makes no mention of it. It does mention geometric mean, is this the same thing as median?

I do see getPercentile(double). Is getPercentile(50) the same as median?

like image 607
Steve Kuo Avatar asked Apr 06 '14 01:04

Steve Kuo


1 Answers

DescriptiveStatistics.getPercentile

The 50th percentile is, by definition, the median.

like image 54
Louis Wasserman Avatar answered Oct 13 '22 00:10

Louis Wasserman