编辑:@ev-br 在这个答案的评论中对我的答案提供了重要的更正。事实上 interp1D 样条线不是基于 FITPACK 的。检查@ev-br 提供的链接的评论。
用于曲线拟合的 Scipy 函数基于 FITPACK。尝试查看有关您正在使用的功能的文档,您将能够看到“参考”章节,其中会出现类似以下内容:
Notes
-----
See splev for evaluation of the spline and its derivatives. Uses the
FORTRAN routine curfit from FITPACK.
If provided, knots `t` must satisfy the Schoenberg-Whitney conditions,
i.e., there must be a subset of data points ``x[j]`` such that
``t[j] < x[j] < t[j+k+1]``, for ``j=0, 1,...,n-k-2``.
References
----------
Based on algorithms described in [1]_, [2]_, [3]_, and [4]_:
.. [1] P. Dierckx, "An algorithm for smoothing, differentiation and
integration of experimental data using spline functions",
J.Comp.Appl.Maths 1 (1975) 165-184.
.. [2] P. Dierckx, "A fast algorithm for smoothing data on a rectangular
grid while using spline functions", SIAM J.Numer.Anal. 19 (1982)
1286-1304.
.. [3] P. Dierckx, "An improved algorithm for curve fitting with spline
functions", report tw54, Dept. Computer Science,K.U. Leuven, 1981.
.. [4] P. Dierckx, "Curve and surface fitting with splines", Monographs on
Numerical Analysis, Oxford University Press, 1993.
这些参考资料特别是取自以下来源:fitpack.py关于函数“splrep”。如果您需要对您的算法和 interp1D 的样条线进行非常彻底的比较,只需转到文档:
scipy.interpolate.interp1d
你会看到一个名为的链接[source]就在函数名称定义之后(例如:scipy.interpolate.interp1D [来源])。请记住,这些函数有很多例程处理程序,因此在浏览源代码时要有耐心。