Logo

CHI2NCINV

Updated 2024-03-07 20:59:26.770000

Syntax

SELECT [westclintech].[wct].[CHI2NCINV] (
  <@P, float,>
 ,<@DF, float,>
 ,<@Lambda, float,>)

Description

Use the scalar function CHI2NC to calculate the inverse of the lower cumulative distribution function of the non-central chi-square distribution.

The probability density function is:

f(x,y,\lambda)=\sum_{j=0}^{\infty}\frac{e^{-\frac{\lambda}{2}}(\frac{\lambda}{2})^j}{j!}\frac{x^{\frac{v+2j}{2}-1}e^{-\frac{x}{2}}}{2^{\frac{v+2j}{2}}\Gamma(\frac{v+2j}{2})}

The lower cumulative distribution function is:

P(x,v,\lambda)=\int_0^{\infty}f(x,v,\lambda)dt

Arguments

@P

is the cumulative distribution function. @P 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.

@DF

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

Return Type

float

Remarks

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

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

@P must be greater than or equal to zero and less than or equal to one (0 ≤ @P ≤ 1).

Examples

Calculate the cumulative distribution function:

SELECT wct.CHI2NC(1, 3, 3);

This produces the following result.

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

Calculate the inverse:

SELECT wct.CHI2NCINV(0.0582469145317944, 3, 3);

This produces the following result.

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