pypomp.random.gammainv

pypomp.random.gammainv(u: Array, alpha: Array, dtype: dtype | None = None, newton_steps: int = 3) Array[source]

Compute the approximate inverse Gamma CDF using JAX primitives.

Vectorised implementation following the asymptotic inversion method from Temme (1992) [1]. The approximation is most accurate for large alpha (at least four significant digits for alpha >= 2).

Parameters:
  • u (jax.Array) – Uniform probabilities in [0, 1]. Scalar or array.

  • alpha (jax.Array) – Gamma shape parameter(s). Must be positive. Broadcast- compatible with u.

  • dtype (np.dtype or None, optional) – Floating-point dtype for computation. Inferred from inputs if None.

  • newton_steps (int, optional) – Number of Newton-Raphson refinement iterations. Defaults to 3.

Returns:

Array of Gamma quantiles with the broadcast shape of u and alpha.

Return type:

jax.Array

Notes

For speed and accuracy metrics, see the Quant Tests.

See also

fast_gamma

High-level sampler that wraps this function.

References