@Override
  public void beforeStart(UDFParameters udfParameters, UDTFConfigurations udtfConfigurations)
      throws Exception {
    udtfConfigurations
        .setAccessStrategy(new RowByRowAccessStrategy())
        .setOutputDataType(udfParameters.getDataType(0));
    this.multipleK = udfParameters.getDoubleOrDefault("k", 3);
    this.dataType = udfParameters.getDataType(0);
    this.windowSize = udfParameters.getIntOrDefault("window", 10000);
    this.v = new CircularQueue<>(windowSize);
    this.t = new LongCircularQueue(windowSize);
  }
This function detects outliers which lies over average +/- k * sigma.
library-udf/src/main/java/org/apache/iotdb/library/anomaly/UDTFKSigma.java