@Description("ChiSquared cdf given the df parameter and value")
    @ScalarFunction
    @SqlType(StandardTypes.DOUBLE)
    public static double chiSquaredCdf(
            @SqlType(StandardTypes.DOUBLE) double df,
            @SqlType(StandardTypes.DOUBLE) double value)
    {
        checkCondition(value >= 0, INVALID_FUNCTION_ARGUMENT, "chiSquaredCdf Function: value must non-negative");
        checkCondition(df > 0, INVALID_FUNCTION_ARGUMENT, "chiSquaredCdf Function: df must be greater than 0");
        ChiSquaredDistribution distribution = new ChiSquaredDistribution(null, df, ChiSquaredDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
        return distribution.cumulativeProbability(value);
    }
@Test
    public void testChiSquaredCdf()
    {
        assertFunction("chi_squared_cdf(3, 0.0)", DOUBLE, 0.0);
        assertFunction("round(chi_squared_cdf(3, 1.0), 4)", DOUBLE, 0.1987);
        assertFunction("round(chi_squared_cdf(3, 2.5), 2)", DOUBLE, 0.52);
        assertFunction("round(chi_squared_cdf(3, 4), 2)", DOUBLE, 0.74);

        assertInvalidFunction("chi_squared_cdf(-3, 0.3)", "chiSquaredCdf Function: df must be greater than 0");
        assertInvalidFunction("chi_squared_cdf(3, -10)", "chiSquaredCdf Function: value must non-negative");
    }