Java Utililty Methods List Median

List of utility methods to do List Median

Description

The list of methods to do List Median are organized into topic(s).

Method

doublemedianAbsVal(List vals)
Median absolute value
if (vals.isEmpty()) {
    return (Double.NaN);
int num = vals.size();
ArrayList sorted = new ArrayList();
for (int i = 0; i < num; i++) {
    Double val0bj = (Double) vals.get(i);
    if (val0bj.isNaN()) {
...
doublemedianAbsValAboveThresh(List vals, double thresh)
Return median of numbers above threshold
int num = vals.size();
ArrayList above = new ArrayList();
for (int i = 0; i < num; i++) {
    Double valObj = (Double) vals.get(i);
    if (valObj.isNaN()) {
        return (Double.NaN);
    double val = Math.abs(valObj.doubleValue());
...
doublemedianDouble(List vals)
median Double
List<Double> copy = new ArrayList<Double>(vals);
Collections.sort(copy);
if (copy.size() % 2 == 0) {
    Double acc = copy.get(copy.size() / 2);
    acc += copy.get((copy.size() / 2) - 1);
    return acc / 2.0;
} else {
    return copy.get(copy.size() / 2);
...
doublemediane(List liste)
mediane
if (liste.isEmpty()) {
    return 0.0;
Double[] listeTriee = liste.toArray(new Double[0]);
java.util.Arrays.sort(listeTriee);
return listeTriee[liste.size() / 2].doubleValue();