@Override
  public void validate(UDFParameterValidator validator) throws Exception {
    validator
        .validateInputSeriesNumber(1)
        .validateInputSeriesDataType(0, Type.INT32, Type.INT64, Type.FLOAT, Type.DOUBLE)
        .validate(
            x -> (int) x >= 0,
            "Parameter $lag$ should be an positive integer, or '0' for default value.",
            validator.getParameters().getIntOrDefault("lag", 0));
  }
This function calculates acf, and then calculates p-value of corresponding Q_LB statistics.
library-udf/src/main/java/org/apache/iotdb/library/dprofile/UDTFQLB.java