Updated: 9 August 2010
Use GAMMAINV to calculate the inverse of the cumulative gamma distribution.
Syntax
SELECT [wctStatistics].[wct].[GAMMAINV] (
<@Probability, float,>
,<@Alpha, float,>
,<@BETA, float,>)
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.
@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.
@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.
Return Types
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
----------------------
10.00001131
(1 row(s) affected)
select round(wct.GAMMADIST(wct.GAMMAINV(0.0680940037098249,9,2),9,2,'True')-0.0680940037098249, 8)
This produces the following result
----------------------
0
(1 row(s) affected)
See Also