Skip to main content
`Ctrl`+`K`

# scipy.special.nctdtridf

scipy.special.nctdtridf(p, nc, t, out=None) = <ufunc 'nctdtridf'>

  Calculate degrees of freedom for non-central t distribution.

  See `nctdtr` for more details.

  Parameters:
    parray_like

      CDF values, in range (0, 1].

    ncarray_like

      Noncentrality parameter. Should be in range (-1e6, 1e6).

    tarray_like

      Quantiles, i.e., the upper limit of integration.

    outndarray, optional

      Optional output array for the function results

  Returns:
    dfscalar or ndarray

      The degrees of freedom. If all inputs are scalar, the return will be a float. Otherwise, it will be an array.

  See also

  `nctdtr`

    CDF of the non-central t distribution.

  `nctdtrit`

    Inverse CDF (iCDF) of the non-central t distribution.

  `nctdtrinc`

    Calculate non-centrality parameter, given CDF iCDF values.

  Examples

      >>> from scipy.special import nctdtr, nctdtridf

  Compute the CDF for several values of df:

      >>> df = [1, 2, 3]
      >>> p = nctdtr(df, 0.25, 1)
      >>> p
      array([0.67491974, 0.716464  , 0.73349456])

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

      >>> nctdtridf(p, 0.25, 1)
      array([1., 2., 3.])