Logo

GAMMAINV

Updated 2023-11-02 22:01:00.117000

Syntax

SELECT [westclintech].[wct].[GAMMAINV] (
  <@Probability, float,>
 ,<@Alpha, float,>
 ,<@BETA, float,>)

Description

Use the scalar function GAMMAINV to calculate the inverse of the cumulative gamma distribution.

Arguments

@Probability

is the probability associated with the gamma distribution. @Probability is an expression of type float or of a type that can be implicitly converted to float.

@BETA

is the beta parameter to the distribution. @BETA is an expression of type float or of a type that can be implicitly converted to float.

@Alpha

is the alpha parameter to the distribution. @Alpha is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

If @Alpha = 0 or @BETA = 0, GAMMAINV returns an error.

If @Probability < 0 or @Probability > 1, GAMMAINV returns an error.

GAMMINV uses root-finding algorithms and iteration to satisfy the condition that GAMMADIST(GAMMAINV(@Probability, @Alpha, @Beta), @Alpha, @Beta, 'True') -@Probability = 0 to eight decimal places.

Examples

select wct.GAMMAINV(0.0680940037098249, 9, 2);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"10.00001131"}]}
select round(wct.GAMMADIST(wct.GAMMAINV(0.0680940037098249, 9, 2), 9, 2, 'True') 

          - 0.0680940037098249, 8);

This produces the following result.

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

See Also

GAMMADIST - gamma distribution

GAMMAP - lower regularized gamma function

GAMMAQ - upper regularized gamma function

INVGAMMAP - Calculate the inverse of the incomplete gamma functionP(a,x).

BETADIST - beta distribution

CHIDIST - chi-square distribution

GAMMA - complete gamma function

GAMMAINC - incomplete gamma function

GAMMALN - natural logarithm of the complete gamma function