Logo

FDIST

Updated 2024-03-07 21:49:36.427000

Syntax

SELECT [westclintech].[wct].[FDIST] (
  <@X, float,>
 ,<@Degrees_freedom1, float,>
 ,<@Degrees_freedom2, float,>)

Description

Use the scalar function FDIST to calculate the F probability distribution. A frequent use of the F-distribution is to test whether two observed samples have the same variance. FDIST calculates the cumulative distribution function. The F-distribution cdf is given in terms of the regularized incomplete beta function:

f(x;d_1,d_2)=I_{\frac{d_1 x}{d_1 x + d_2}} \left(\tfrac{d_1}{2}, \tfrac{d_2}{2} \right)

Arguments

@X

is the value to be evaluated by the function. @X is an expression of type float or of a type that can be implicitly converted to float.

@Degrees_freedom1

is the numerator degrees of freedom. @Degrees_freedom1 is an expression of type float or of a type that can be implicitly converted to float.

@Degrees_freedom2

is the denominator degrees of freedom. @Degrees_freedom2 is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

If @X < 0, FDIST returns an error.

@Degrees_freedom1 and @Degrees_freedom2  are truncated to zero decimal places.

If @Degrees_freedom1 < 1 or @Degrees_freedom1 > 10^10, FDIST returns an error.

If @Degrees_freedom2 < 1 or @Degrees_freedom2 > 10^10, FDIST returns an error.

FDIST =

BETADIST(@Degrees_freedom2 / (@Degrees_freedom2 + @Degrees_freedom1 * @X), @Degrees_freedom2 / 2, @Degrees_freedom1 / 2)

Examples

select wct.FDIST(3.217174547, 6, 10);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.0500000000172287"}]}
select wct.BETADIST(0.341261436183216, 5, 3, NULL, NULL);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.0500000000172289"}]}