public static double mad(double[] value) {
    Median median = new Median();
    double mid = median.evaluate(value);
    double[] d = new double[value.length];
    for (int i = 0; i < value.length; i++) {
      d[i] = Math.abs(value[i] - mid);
    }
    return 1.4826 * median.evaluate(d);
  }
calculate median absolute deviation of input series. 1.4826 is multiplied in order to achieve
asymptotic normality. Note: 1.4826 = 1/qnorm(3/4)

@param value input series
@return median absolute deviation MAD
library-udf/src/main/java/org/apache/iotdb/library/util/Util.java