class MADFunction extends AggregateFunction<JsonNode, Double> {

    @Override
    public Double compute() {
        if (values.isEmpty()) {
            return Double.NaN;
        }
        return mad();
    }

}