Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]


5.20 gammainc

: gammainc (x, a)
: gammainc (x, a, tail)

Compute the normalized incomplete gamma function.

This is defined as

                                x
                       1       /
gammainc (x, a) = ---------    | exp (-t) t^(a-1) dt
                  gamma (a)    /
                            t=0

with the limiting value of 1 as x approaches infinity. The standard notation is P(a,x), e.g., Abramowitz and Stegun (6.5.1).

If a is scalar, then gammainc (x, a) is returned for each element of x and vice versa.

If neither x nor a is scalar, the sizes of x and a must agree, and gammainc is applied element-by-element. The elements of a must be nonnegative.

By default or if tail is "lower" the incomplete gamma function integrated from 0 to x is computed. If tail is "upper" then the complementary function integrated from x to infinity is calculated.

If tail is "scaledlower", then the lower incomplete gamma function is multiplied by gamma(a+1)*exp(x)/(x^a). If tail is "scaledupper", then the upper incomplete gamma function is divided by the same quantity.

References:

M. Abramowitz and I. Stegun, Handbook of mathematical functions Dover publications, INC., 1972.

W. Gautschi, A computational procedure for incomplete gamma functions ACM Trans. Math Software, pp. 466–481, Vol 5, No. 4, 2012.

W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery Numerical Recipes in Fortran 77, ch. 6.2, Vol 1, 1992.

See also: gamma, gammainc, gammaln.