Skip to main content
`Ctrl`+`K`

# scipy.special.bdtri

scipy.special.bdtri(k, n, y, out=None) = <ufunc 'bdtri'>

  Inverse function to `bdtr` with respect to p.

  Finds the event probability p such that the sum of the terms 0 through k of the binomial probability density is equal to the given cumulative probability y.

  Parameters:
    k array_like

      Number of successes (float), rounded down to the nearest integer.

    n array_like

      Number of events (float)

    y array_like

      Cumulative probability (probability of k or fewer successes in n events).

    out ndarray, optional

      Optional output array for the function values

  Returns:
    p scalar or ndarray

      The event probability such that bdtr(lfloor k rfloor, n, p) = y.

  See also

  `bdtr`
  `betaincinv`

  Notes

  The computation is carried out using the inverse beta integral function and the relation,:

      1 - p = betaincinv(n - k, k + 1, y).

  Wrapper for the Cephes [1] routine `bdtri`.

  Array API Standard Support

  `bdtri` has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable `SCIPY_ARRAY_API=1` and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.

  Library | CPU | GPU
  --- | --- | ---
  NumPy | ✅ | n/a
  CuPy | n/a | ✅
  PyTorch | ✅ | ⛔
  JAX | ✅ | ⛔
  Dask | ✅ | n/a

  See Support for the array API standard for more information.

  References

  [1]

  Cephes Mathematical Functions Library, https://netlib.org/cephes/