scipy.special.nctdtr

scipy.special.nctdtr(df, nc, t) = <ufunc 'nctdtr'>

非中心的累积分布函数 t 分配。

参数
dfarray_like

分布的自由度。应在范围内(0,inf)。

ncarray_like

非中心性参数。应在范围内(-1e6,1e6)。

tarray_like

分位数,即积分的上限。

退货
cdf浮动或ndarray

计算出的CDF。如果所有输入都是标量,则返回的将是浮点数。否则,它将是一个数组。

参见

nctdtrit

非中心t分布的逆CDF(ICDF)。

nctdtridf

根据给定的CDF和ICDF值计算自由度。

nctdtrinc

计算非中心性参数,给定CDF iCDF值。

示例

>>> from scipy import special
>>> from scipy import stats
>>> import matplotlib.pyplot as plt

绘制Nc=0的非中心t分布的CDF。与scipy.stats中的t分布进行比较:

>>> 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()
../../_images/scipy-special-nctdtr-1.png