scipy.special.ndtri_exp#
- scipy.special.ndtri_exp(y, out=None) = <ufunc 'ndtri_exp'>#
log_ndtr 相對於 x 的反函數。對於極小的 y 值和接近 0 的 y 值,比 ndtri 與 numpy.exp 組合使用具有更高的精度。
- 參數:
- yarray_like of float
函數參數
- outndarray, optional
函數結果的選用輸出陣列
- 回傳:
- 純量或 ndarray
標準常態分佈對數 CDF 的反函數,在 y 處評估。
範例
>>> import numpy as np >>> import scipy.special as sc
ndtri_exp
agrees with the naive implementation when the latter does not suffer from underflow.>>> sc.ndtri_exp(-1) -0.33747496376420244 >>> sc.ndtri(np.exp(-1)) -0.33747496376420244
對於 y 的極端值,樸素方法會失敗
>>> sc.ndtri(np.exp(-800)) -inf >>> sc.ndtri(np.exp(-1e-20)) inf
然而,
ndtri_exp
仍然能夠以高精度計算結果。>>> sc.ndtri_exp(-800) -39.88469483825668 >>> sc.ndtri_exp(-1e-20) 9.262340089798409