numpy.i0#
- numpy.i0(x)[源代码]#
第一类修正贝塞尔函数,阶数为 0.
通常表示为 \(I_0\) .
- 参数:
- xfloat 的类数组
贝塞尔函数的参数.
- 返回:
- outndarray, shape = x.shape, dtype = float
在 x 的每个元素处计算的修正贝塞尔函数.
注释
建议使用 scipy 实现,而不是此函数:它是一个用 C 编写的适当的 ufunc,并且速度快一个数量级以上.
我们使用 Clenshaw [1] 发布并由 Abramowitz 和 Stegun [2] 引用的算法,该算法将函数域划分为两个区间 [0,8] 和 (8,inf),并且在每个区间中都采用切比雪夫多项式展开.使用 IEEE 算术在域 [0,30] 上的相对误差记录为 [3] ,峰值为 5.8e-16,均方根为 1.4e-16 (n = 30000).
参考文献
[1]C. W. Clenshaw, “Chebyshev series for mathematical functions”, in National Physical Laboratory Mathematical Tables, vol. 5, London: Her Majesty’s Stationery Office, 1962.
[2]M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions, 10th printing, New York: Dover, 1964, pp. 379. https://personal.math.ubc.ca/~cbm/aands/page_379.htm
示例
>>> import numpy as np >>> np.i0(0.) array(1.0) >>> np.i0([0, 1, 2, 3]) array([1. , 1.26606588, 2.2795853 , 4.88079259])