Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé
Module « scipy.special »

Fonction nctdtr - module scipy.special

Signature de la fonction nctdtr

def nctdtr(*args, **kwargs) 

Description

help(scipy.special.nctdtr)

nctdtr(x1, x2, x3, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature])

nctdtr(df, nc, t, out=None)

Cumulative distribution function of the non-central `t` distribution.

Parameters
----------
df : array_like
    Degrees of freedom of the distribution. Should be in range (0, inf).
nc : array_like
    Noncentrality parameter.
t : array_like
    Quantiles, i.e., the upper limit of integration.
out : ndarray, optional
    Optional output array for the function results

Returns
-------
cdf : scalar or ndarray
    The calculated CDF. If all inputs are scalar, the return will be a
    float. Otherwise, it will be an array.

See Also
--------
nctdtrit : Inverse CDF (iCDF) of the non-central t distribution.
nctdtridf : Calculate degrees of freedom, given CDF and iCDF values.
nctdtrinc : Calculate non-centrality parameter, given CDF iCDF values.

Notes
-----
This function calculates the CDF of the non-central t distribution using
the Boost Math C++ library [1]_.

Note that the argument order of `nctdtr` is different from that of the
similar ``cdf`` method of `scipy.stats.nct`: `t` is the last
parameter of `nctdtr` but the first parameter of ``scipy.stats.nct.cdf``.

References
----------
.. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

Examples
--------
>>> import numpy as np
>>> from scipy import special
>>> from scipy import stats
>>> import matplotlib.pyplot as plt

Plot the CDF of the non-central t distribution, for nc=0. Compare with the
t-distribution from scipy.stats:

>>> x = np.linspace(-5, 5, num=500)
>>> df = 3
>>> nct_stats = stats.t.cdf(x, df)
>>> nct_special = special.nctdtr(df, 0, x)

>>> fig = plt.figure()
>>> ax = fig.add_subplot(111)
>>> ax.plot(x, nct_stats, 'b-', lw=3)
>>> ax.plot(x, nct_special, 'r-')
>>> plt.show()


Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé