pypomp.random.poissoninv¶
- pypomp.random.poissoninv(u: Array, lam: Array, dtype: dtype | None = None, max_newton_loops: int = 5, max_inverse_cdf_loops: int = 20) Array[source]¶
Compute the approximate inverse Poisson CDF using JAX primitives.
Vectorised implementation of the inverse CDF for the Poisson distribution from Giles (2016) [1].
- Parameters:
u (jax.Array) – Uniform probabilities in
[0, 1]. Scalar or array.lam (jax.Array) – Poisson rate parameter(s). Must be positive. Broadcast- compatible with
u.dtype (np.dtype or None, optional) – Floating-point dtype for intermediate computations and the return value. Inferred from inputs if
None.max_newton_loops (int, optional) – Maximum Newton-Raphson iterations. Defaults to
5.max_inverse_cdf_loops (int, optional) – Maximum exact inverse CDF iterations. Defaults to
20.
- Returns:
Array of Poisson quantiles with the broadcast shape of
uandlam.- Return type:
Notes
For speed and accuracy metrics, see the Quant Tests.
See also
fast_poissonHigh-level sampler that wraps this function.
References