Skip to main content
`Ctrl`+`K`

# scipy.special.chdtriv

scipy.special.chdtriv(p, x, out=None) = <ufunc 'chdtriv'>

  Inverse to `chdtr` with respect to v.

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

  Parameters:
    p array_like

      Probability that the Chi square random variable is less than or equal to x.

    x array_like

      Nonnegative input.

    out ndarray, optional

      Optional output array for the function results.

  Returns:
    scalar or ndarray

      Degrees of freedom.

  See also

  `chdtr`, `chdtrc`, `chdtri`

  Notes

  This function wraps routines from the Boost Math C++ library [1].

  References

  [1]

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

  [2]

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

  Examples

      >>> import scipy.special as sc

  It inverts `chdtr`.

      >>> p, x = 0.5, 1
      >>> sc.chdtr(sc.chdtriv(p, x), x)
      0.5000000000000003
      >>> v = 1
      >>> sc.chdtriv(sc.chdtr(v, x), x)
      1.0