Skip to main content

Module inverse_incomplete

Module inverse_incomplete 

Source
Expand description

Inverses of the regularized incomplete gamma and beta functions (SciPy’s gammaincinv, gammainccinv and betaincinv): an initial approximation, then Halley’s method on the function itself, whose first two derivatives are known in closed form.

See the book entry Log-domain functions and inverse incomplete integrals.

Functions§

betaincinv
The x ∈ [0, 1] with I_x(a, b) = p (SciPy’s betaincinv). The start is the normal-based approximation of Abramowitz and Stegun 26.5.22 for a, b ≥ 1 and the small-x and small-1 − x power laws otherwise; then Halley steps with I' = x^{a−1}(1−x)^{b−1} / B(a, b).
gammainccinv
The x ≥ 0 with Q(a, x) = 1 − P(a, x) = q (SciPy’s gammainccinv). Both inverses iterate on the smaller of the two tails, P or Q, which is computed with full relative accuracy; the other target is formed exactly, since 1 − t is exact for t ∈ [½, 1].
gammaincinv
The x ≥ 0 with P(a, x) = p (SciPy’s gammaincinv). The start is the Wilson-Hilferty approximation for a > 1 and the small-x series for a ≤ 1; then Halley steps x ← x − u / (1 − ½ u ((a−1)/x − 1)) with u = (P − p)/P' and P' = x^{a−1} e^{−x} / Γ(a).