gammaincinv

Inverse of the regularized incomplete gamma function.

Category: Mathematics > Elementary Math

Syntax

X = gammaincinv(Y, A)

Returns X such that gammainc(X, A) == Y.

Description

gammaincinv is the quantile function of the gamma distribution with unit scale. For Y = 0.5 it gives the median. Multiplying by a scale theta gives the quantile of a gamma distribution with that scale, and 2*gammaincinv(p, k/2) is the chi-square quantile with k degrees of freedom.

Input arguments

Y
Probabilities in the interval from 0 to 1.
A
Positive shape parameter.

Output arguments

X
Nonnegative values, with the size given by implicit expansion of Y and A.

Example

Median and round trip

x = gammaincinv(0.5, 2)
gammainc(x, 2)
Output
x = 1.6783
ans = 0.5000

See also

gammainc gamma erfinv gammaln