Skip to main content
`Ctrl`+`K`

# scipy.special.pdtrik

scipy.special.pdtrik(p, m, out=None) = <ufunc 'pdtrik'>

  Inverse of `pdtr` with respect to k.

  Parameters:
    p array_like

      Probability

    m array_like

      Shape parameter (nonnegative, real)

    out ndarray, optional

      Optional output array for the function results

  Returns:
    scalar or ndarray

      The number of occurrences k such that `pdtr(k, m) = p`

  See also

  `pdtr`

    Poisson cumulative distribution function

  `pdtrc`

    Poisson survival function

  `pdtri`

    inverse of `pdtr` with respect to m

  Notes

  This function relies on the `gamma_q_inva` function from the Boost Math C++ library [1].

  References

  [1]

  The Boost Developers. “Boost C++ Libraries”. https://www.boost.org/.

  Examples

      >>> import scipy.special as sc

  Compute the CDF for several values of k:

      >>> k = [1, 2, 3]
      >>> p = sc.pdtr(k, 2)
      >>> p
      array([0.40600585, 0.67667642, 0.85712346])

  Compute the inverse. We recover the values of k, as expected:

      >>> sc.pdtrik(p, 2)
      array([1., 2., 3.])