GAMMAQ
Updated 2024-03-08 16:05:14.760000
Syntax
SELECT [westclintech].[wct].[GAMMAQ] (
<@A, float,>
,<@X, float,>)
Description
Use the scalar function GAMMAQ to calculate the regularized gamma function Q(a, x). The equation for this function is:
Q(a,x)=\frac{\Gamma(a,x)}{\Gamma(a)}
Where Γ(a, x) as an incomplete gamma function and Γ(a) is the gamma function and where
\gamma(a,x)+\Gamma(a)=1
Arguments
@A
a value to be passed to the function. @A is an expression of type float or of a type that can be implicitly converted to float.
@X
a value to be passed to the function. @X is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
If @A < 0 or @X < 0, GAMMAQ returns an error.
GAMMAP(@A, @X) + GAMMAQ(@A, @X) = 1.
Examples
Select wct.GAMMAQ(5, 2);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.947346982712349"}]}
Select wct.GAMMAINC(5, 2) / wct.gamma(5);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"0.947346982712349"}]}
Select wct.GAMMAP(5, 2) + wct.GAMMAQ(5, 2);
This produces the following result.
{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1"}]}
See Also
GAMMAP - lower regularized gamma function
INVGAMMAP - Calculate the inverse of the incomplete gamma functionP(a,x).
GAMMADIST - gamma distribution
GAMMAINV - inverse gamma function
CHIDIST - chi-square distribution
GAMMA - complete gamma function