FINV
Updated 2024-03-07 21:50:35.107000
Syntax
SELECT [westclintech].[wct].[FINV] (
<@Probability, float,>
,<@Degrees_freedom1, float,>
,<@Degrees_freedom2, float,>)
Description
Use the scalar function FINV to calculate the inverse of the F probability distribution. A frequent use of the F-distribution is to test whether two observed samples have the same variance. The F-distribution cumulative distribution function (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
@Probability
is a probability associated with the F-distribution cdf. @Probability 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 @Probability < 0 or @Probability > 1, FINV returns an error.
@Degrees_freedom1 and @Degrees_freedom2 are truncated to zero decimal places.
If @Degrees_freedom1 < 1 or @Degrees_freedom1 > 10^10, FINV returns an error.
If @Degrees_freedom2 < 1 or @Degrees_freedom2 > 10^10, FINV returns an error.
FINV uses root-finding algorithms and iteration to satisfy the condition that FDIST(FINV(@Probability, @Degrees_freedom1, @Degrees_freedom2), @Degrees_freedom1, @Degrees_freedom2) - @Probability = 0 to eight decimal places.
Examples
Select wct.FINV(.05, 6, 10);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"3.21717454739921"}]}
Select round(wct.FDIST(wct.FINV(.05, 6, 10), 6, 10) - .05, 8);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0"}]}