本文簡要介紹 python 語言中 scipy.special.log_ndtr
的用法。
用法:
scipy.special.log_ndtr(x, out=None) = <ufunc 'log_ndtr'>#
高斯累積分布函數的對數。
返回標準高斯概率密度函數下麵積的對數,從負無窮積分到x:
log(1/sqrt(2*pi) * integral(exp(-t**2 / 2), t=-inf..x))
- x: 數組,實數或複數
參數
- out: ndarray,可選
函數結果的可選輸出數組
- 標量或 ndarray
在 x 處評估的正常 CDF 的對數值
參數 ::
返回 ::
例子:
>>> import numpy as np >>> from scipy.special import log_ndtr, ndtr
log_ndtr(x)
相對於簡單實現np.log(ndtr(x))
的優勢在x
的中到大正值時最為明顯:>>> x = np.array([6, 7, 9, 12, 15, 25]) >>> log_ndtr(x) array([-9.86587646e-010, -1.27981254e-012, -1.12858841e-019, -1.77648211e-033, -3.67096620e-051, -3.05669671e-138])
中等
x
值的簡單計算結果隻有 5 或 6 個正確的有效數字。對於x
的值大於大約 8.3,樸素表達式返回 0:>>> np.log(ndtr(x)) array([-9.86587701e-10, -1.27986510e-12, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00])
相關用法
- Python SciPy special.log_expit用法及代碼示例
- Python SciPy special.log_softmax用法及代碼示例
- Python SciPy special.logsumexp用法及代碼示例
- Python SciPy special.log1p用法及代碼示例
- Python SciPy special.logit用法及代碼示例
- Python SciPy special.laguerre用法及代碼示例
- Python SciPy special.legendre用法及代碼示例
- Python SciPy special.lambertw用法及代碼示例
- Python SciPy special.exp1用法及代碼示例
- Python SciPy special.expn用法及代碼示例
- Python SciPy special.ncfdtri用法及代碼示例
- Python SciPy special.gamma用法及代碼示例
- Python SciPy special.y1用法及代碼示例
- Python SciPy special.y0用法及代碼示例
- Python SciPy special.ellip_harm_2用法及代碼示例
- Python SciPy special.i1e用法及代碼示例
- Python SciPy special.smirnovi用法及代碼示例
- Python SciPy special.ker用法及代碼示例
- Python SciPy special.ynp_zeros用法及代碼示例
- Python SciPy special.k0e用法及代碼示例
- Python SciPy special.j1用法及代碼示例
- Python SciPy special.expit用法及代碼示例
- Python SciPy special.polygamma用法及代碼示例
- Python SciPy special.nbdtrik用法及代碼示例
- Python SciPy special.nbdtrin用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.special.log_ndtr。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。