nag_gamma_dist (g01efc) returns the lower or upper tail probability of the gamma distribution, with parameters and .
The lower tail probability for the gamma distribution with parameters
and
,
, is defined by:
The mean of the distribution is
and its variance is
. The transformation
is applied to yield the following incomplete gamma function in normalized form,
This is then evaluated using
nag_incomplete_gamma (s14bac).
The result should have a relative accuracy of
machine precision. There are rare occasions when the relative accuracy attained is somewhat less than
machine precision but the error should not exceed more than
or
decimal places. Note also that there is a limit of
decimal places on the achievable accuracy, because constants in
nag_incomplete_gamma (s14bac) are given to this precision.
nag_gamma_dist (g01efc) is not threaded in any implementation.
The time taken by nag_gamma_dist (g01efc) varies slightly with the input arguments
g,
a and
b.
This example reads in values from a number of gamma distributions and computes the associated lower tail probabilities.