SciPy 插值:方法的精度?

SciPy interpolation: precision of methods?

SciPy interpolation 有 3 种支持的方法:

Supported are “linear” and “nearest”, and “splinef2d”. “splinef2d” is only supported for 2-dimensional data.

Wikiversity中解释为多项式插值,我觉得应该比线性更精确...

这里有 2 个问题:

  1. splinef2d 是什么?它是维基大学之一 link?
  2. 三种可用方法中,哪种插值更精确?最近的,双线性的还是 splinef2d?

这需要在 scipy 中进行更多挖掘。 splinef2d 方法本质上是将数据拟合到表面。您需要进一步探索的方法是 scipy.interpolate.bisplrep. This wraps around FITPACK's surffit 子例程。据我所知,变量的类型为 real。使用默认编译器设置,这意味着它的 real(kind=8) 因此您正在查看 double precision.This 预计会传染,因此 python 也处理相同的精度。

您现在可以为 QHull 重复练习,以了解有关 LinearND 插值的详细信息。根据我从他们的 git 回购中看到的内容,它似乎具有 double 的精度。

在 python 方面,声明了变量 float 并且文档说:

On a typical machine running Python, there are 53 bits of precision available for a Python float

关于包装函数的精度,默认情况下python的float是双精度的。看到这个 answer.