Logo

NCFINV

Updated 2024-03-11 15:05:20.387000

Syntax

SELECT [westclintech].[wct].[NCFINV] (
  <@CDF, float,>
 ,<@DF1, float,>
 ,<@DF2, float,>
 ,<@Lambda, float,>)

Description

Use the scalar function NCFCDF to calculate the inverse of the lower cumulative distribution function of the non-central F distribution.

The formula for the lower cumulative density function is:

F(x\mid d_1,d_2,\lambda)=\sum\limits_{j=0}^\infty\left(\frac{\left(\frac{1}{2}\lambda\right)^j}{j!}e^{-\lambda/2} \right)I\left(\frac{d_1x}{d_2 + d_1x}\bigg|\frac{d_1}{2}+j,\frac{d_2}{2}\right)

Arguments

@DF1

degrees of freedom. @DF1 is an expression of type float or of a type that implicitly converts to float.

@Lambda

is the non-centrality parameter. @Lambda is an expression of type float or of a type that implicitly converts to float.

@DF2

degrees of freedom. @DF2 is an expression of type float or of a type that implicitly converts to float.

@CDF

is cumulative distribution function. @CDF is an expression of type float or of a type that implicitly converts to float.

Return Type

float

Remarks

@CDF must be greater than zero and less than one (0 < @CDF < 1).

@DF1 must be greater than zero (@DF1 > 0).

@DF2 must be greater than zero (@DF2 > 0).

@Lambda must be greater than or equal to zero (@Lambda > 0).

Examples

Calculate the lower cumulative distribution function:

SELECT wct.NCFCDF(0.5, 3, 2, 1);

This produces the following result.

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

Calculate the inverse:

SELECT wct.NCFINV(0.210838872156613, 3, 2, 1);

This produces the following result.

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