【问题标题】:Get median from number series using Apache Commons Math使用 Apache Commons Math 从数字系列中获取中位数
【发布时间】:2014-05-18 07:23:28
【问题描述】:

使用 Apache Commons Math,我如何从一系列数字中获取中位数?

Commons Math User GuideDescriptiveStatistics 支持中位数,但 JavaDocs for DescriptiveStatistics 没有提及它。它确实提到了几何平均值,这和中位数一样吗?

我确实看到了getPercentile(double)getPercentile(50) 和中位数一样吗?

【问题讨论】:

  • 中位数是排序后中间的数字:大于一半的元素,小于另一半。第 50 个百分位大于 50% 的元素,小于其他 50%。是的,它们是一样的。

标签: java math apache-commons median


【解决方案1】:

DescriptiveStatistics.getPercentile

根据定义,第 50 个百分位数是中位数。

【讨论】:

    【解决方案2】:

    Apache Commons Math 就像一场飓风,所以必须检查他要提到的版本。我现在使用的是 v3.6.1,它包括 Median(固定分位数 = 50 的百分位数覆盖)和 Percentile 类。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-06
      • 1970-01-01
      • 1970-01-01
      • 2018-05-26
      • 2015-01-21
      • 2011-07-28
      • 2012-04-23
      相关资源
      最近更新 更多