Skip to content

InverseGammaRegularized ​

The inverse of the regularized incomplete gamma Q(a,z)Q(a, z) in zz: solves s=Q(a,z)s = Q(a, z). Solved numerically by a safeguarded Newton's method against compute-engine's own GammaRegularized, using the Gamma density (in log space) as the derivative.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageInverseGammaRegularized!
InverseGammaRegularized(a, s)solves s=Q(a,z)s = Q(a, z) for zz.
Typed signatures
TypePackageApplies
(number, number) -> numberanalyticalways

Domain: Special functions

Details
  • Q(a,0)=1Q(a, 0) = 1 and Q(a,∞)=0Q(a, \infty) = 0 hold for any aa, even a symbolic one, so InverseGammaRegularized(a, 1) = 0 and InverseGammaRegularized(a, 0) = \infty are exact regardless.
  • Q(1,z)=e−zQ(1, z) = e^{-z} inverts exactly to −ln⁡s-\ln s, symbolic ss included.
  • Otherwise: a safeguarded Newton's method (falls back to bisection whenever a step would leave the bracket) against the forward function GammaRegularized(a, z), whose own accuracy was checked directly against wolframscript to 20 digits.
  • N(x, d) past a double's digits polishes the double answer with Newton's method on the bignum series for P(a,z)P(a, z), for real a>0a > 0 and 0<s<10 < s < 1.

Examples

2 more kept as data, checked against the oracles
Basic #

Q(1,z)=e−zQ(1, z) = e^{-z}, so the inverse at 1/21/2 is ln⁡2\ln 2

live ↗
InInverseGammaRegularized(1,0.5)\mathrm{InverseGammaRegularized}(1, 0.5)Out0.693 147 180 559 945 30.693\,147\,180\,559\,945\,3

The median of the Gamma(2, 1) distribution

live ↗
InInverseGammaRegularized(2,0.5)\mathrm{InverseGammaRegularized}(2, 0.5)Out1.678 346 990 016 660 81.678\,346\,990\,016\,660\,8

Known value · Wolfram 15.0.0 InverseGammaRegularized

live ↗
InInverseGammaRegularized(2.5,0.3)\mathrm{InverseGammaRegularized}(2.5, 0.3)Out3.032 214 992 077 4533.032\,214\,992\,077\,453

Known value · Wolfram 15.0.0 InverseGammaRegularized

live ↗
InFullSimplify(Normal⁡(Series⁡(InverseGammaRegularized(2,x),x,−1,1)))\mathrm{FullSimplify}(\operatorname{Normal}(\operatorname{Series}(\mathrm{InverseGammaRegularized}(2, x), x, -1, 1)))Out(x+1)InverseGammaRegularized(0,1)(2,−1)+InverseGammaRegularized(2,−1)(x+1)\mathrm{InverseGammaRegularized}^{(0, 1)}(2, -1)+\mathrm{InverseGammaRegularized}(2, -1)
Scope #

Matrix function expressed through logarithms of the eigenvalues

live ↗
InFullSimplify(MatrixFunction(()↦InverseGammaRegularized(1,_1⁡),[[1/2,1/5],[1/3,1/2]]))\mathrm{FullSimplify}(\mathrm{MatrixFunction}(()↦\mathrm{InverseGammaRegularized}(1, \operatorname{\_1}), \bigl\lbrack\bigl\lbrack1/2, 1/5\bigr\rbrack, \bigl\lbrack1/3, 1/2\bigr\rbrack\bigr\rbrack))Out[[−12(ln⁡((1−(2×151/2)/15)/2))−12(ln⁡((1+(2×151/2)/15)/2)),110(15ln⁡((1−(2×151/2)/15)/2))−110(15ln⁡((1+(2×151/2)/15)/2))],[16(15ln⁡((1−(2×151/2)/15)/2))−16(15ln⁡((1+(2×151/2)/15)/2)),−12(ln⁡((1−(2×151/2)/15)/2))−12(ln⁡((1+(2×151/2)/15)/2))]]\bigl\lbrack\bigl\lbrack-\frac{1}{2}(\ln((1-(2×15^{1/2})/15)/2))-\frac{1}{2}(\ln((1+(2×15^{1/2})/15)/2)), \frac{1}{10}(\sqrt{15}\ln((1-(2×15^{1/2})/15)/2))-\frac{1}{10}(\sqrt{15}\ln((1+(2×15^{1/2})/15)/2))\bigr\rbrack, \bigl\lbrack\frac{1}{6}(\sqrt{15}\ln((1-(2×15^{1/2})/15)/2))-\frac{1}{6}(\sqrt{15}\ln((1+(2×15^{1/2})/15)/2)), -\frac{1}{2}(\ln((1-(2×15^{1/2})/15)/2))-\frac{1}{2}(\ln((1+(2×15^{1/2})/15)/2))\bigr\rbrack\bigr\rbrack
live ↗
InN(InverseGammaRegularized(2,33100),50)N(\mathrm{InverseGammaRegularized}(2, \frac{33}{100}), 50)Out2.303 708 141 330 049 053 229 408 137 466 818 316 144 848 837 258 72.303\,708\,141\,330\,049\,053\,229\,408\,137\,466\,818\,316\,144\,848\,837\,258\,7
live ↗
InSeries⁡(InverseGammaRegularized(a,s),s,s0,1)\operatorname{Series}(\mathrm{InverseGammaRegularized}(a, s), s, \mathrm{s0}, 1)OutInverseGammaRegularized(a,s0)+(s−s0)∂∂s0InverseGammaRegularized(a,s0)+O((s−s0)2)\mathrm{InverseGammaRegularized}(a, \mathrm{s0})+(s-\mathrm{s0})\frac{∂}{∂\mathrm{s0}} \mathrm{InverseGammaRegularized}(a, \mathrm{s0})+O\left((s-\mathrm{s0})^2\right)
Properties #

Q(a,0)=1Q(a, 0) = 1

live ↗
InInverseGammaRegularized(a,1)\mathrm{InverseGammaRegularized}(a, 1)Out00

Q(a,∞)=0Q(a, \infty) = 0

live ↗
InInverseGammaRegularized(a,0)\mathrm{InverseGammaRegularized}(a, 0)Out∞∞

Order 1 inverts e−ze^{-z}

live ↗
InInverseGammaRegularized(1,s)\mathrm{InverseGammaRegularized}(1, s)Out−ln⁡(s)-\ln(s)

At a=1a=1, Q(1,z)=e−zQ(1,z)=e^{-z}, so the value 0 gives z=∞z=\infty

live ↗
InInverseGammaRegularized(1,0)\mathrm{InverseGammaRegularized}(1, 0)Out∞∞

Known value · Wolfram MathematicalFunctionData, InverseGammaRegularized

The same pole at a=2a=2

live ↗
InInverseGammaRegularized(2,0)\mathrm{InverseGammaRegularized}(2, 0)Out∞∞

Known value · Wolfram MathematicalFunctionData, InverseGammaRegularized

Probability 1 gives z=0z=0 at a=1a=1

live ↗
InInverseGammaRegularized(1,1)\mathrm{InverseGammaRegularized}(1, 1)Out00

Known value · Wolfram MathematicalFunctionData, InverseGammaRegularized

Probability 1 gives z=0z=0 at a=2a=2

live ↗
InInverseGammaRegularized(2,1)\mathrm{InverseGammaRegularized}(2, 1)Out00

Known value · Wolfram MathematicalFunctionData, InverseGammaRegularized

About
Examples16
Checked againstWolfram Language 13 agree2 differ1 unevaluated
CrosswalkWolfram Language

Implementation

primitive · kernela kernel — an algorithm over mutable state that would not be readable as a tree

nativeenginetypescriptpackages/symbols/analysis/analytic/src/inverse-regularized.ts

Safeguarded Newton/bisection against native GammaRegularized.

See also: GammaRegularized, Gamma, InverseBetaRegularized