Skip to main content
`Ctrl`+`K`

# scipy.special.chdtri

scipy.special.chdtri(v, p, out=None) = <ufunc 'chdtri'>

  Inverse to `chdtrc` with respect to x.

  Returns x such that `chdtrc(v, x) == p`.

  Parameters:
    v array_like

      Degrees of freedom.

    p array_like

      Probability.

    out ndarray, optional

      Optional output array for the function results.

  Returns:
    x scalar or ndarray

      Value so that the probability a Chi square random variable with v degrees of freedom is greater than x equals p.

  See also

  `chdtrc`, `chdtr`, `chdtriv`

  Notes

  Array API Standard Support

  `chdtri` 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 | ⚠️ no JIT | ⛔
  Dask | ✅ | n/a

  > See Support for the array API standard for more information.

  References

  [1]

  Chi-Square distribution, https://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm

  Examples

      >>> import scipy.special as sc

  It inverts `chdtrc`.

      >>> v, p = 1, 0.3
      >>> sc.chdtrc(v, sc.chdtri(v, p))
      0.3
      >>> x = 1
      >>> sc.chdtri(v, sc.chdtrc(v, x))
      1.0