jax.scipy.special.betaincinv

Contents

jax.scipy.special.betaincinv#

jax.scipy.special.betaincinv(a, b, y)[source]#

The inverse of the regularized incomplete beta function in x.

JAX implementation of scipy.special.betaincinv.

Returns \(x \in [0, 1]\) such that \(\mathrm{betainc}(a, b, x) = y\). Equivalently, betaincinv(a, b, y) is the quantile function of the beta distribution with shape parameters a and b.

Parameters:
  • a (ArrayLike) – arraylike, real-valued. Positive parameter a of the beta distribution.

  • b (ArrayLike) – arraylike, real-valued. Positive parameter b of the beta distribution.

  • y (ArrayLike) – arraylike, real-valued. Probability in the interval \([0, 1]\).

Returns:

array containing values of the betaincinv function. Returns 0 for y == 0 and 1 for y == 1, and nan for y outside \([0, 1]\), a <= 0, b <= 0, or a or b infinite with 0 < y < 1.

Return type:

Array

Notes

The result is accurate to about the accuracy of jax.scipy.special.betainc(), which decreases for large a and b. Results smaller than the smallest positive normal number of the output dtype are returned as 0.

Gradients are only supported with respect to y, as for jax.scipy.special.betainc(), which does not support gradients with respect to a and b.

Examples

>>> y = jnp.array([0.0, 0.25, 0.5, 0.75, 1.0])
>>> with jnp.printoptions(precision=4):
...   print(jax.scipy.special.betaincinv(2.0, 3.0, y))
[0.     0.243  0.3857 0.5437 1.    ]