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


5.21 gammaincinv

: gammaincinv (y, a)
: gammaincinv (y, a, tail)

Compute the inverse of the normalized incomplete gamma function.

The normalized incomplete gamma function is defined as

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

and gammaincinv (gammainc (x, a), a) = x for each nonnegative value of x. If a is scalar, then gammaincinv (y, a) is returned for each element of y and vice versa.

If neither y nor a is scalar, the sizes of y and a must agree, and gammaincinv is applied element-by-element. The elements of y must be in [0,1] and those of a must be positive.

By default or if tail is "lower" the inverse of 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 inverted.

The function is computed by standard Newton’s method, by solving


y - gammainc (x, a) = 0

Reference: A. Gil, J. Segura, and N. M. Temme, Efficient and accurate algorithms for the computation and inversion of the incomplete gamma function ratios, SIAM J. Sci. Computing, pp. A2965–A2981, Vol 34, 2012.

See also: gamma, gammainc, gammaln.