我有一个实验数据,我试图在scipy中使用UnivariateSpline函数拟合曲线.数据看起来像:
x y
13 2.404070
12 1.588134
11 1.760112
10 1.771360
09 1.860087
08 1.955789
07 1.910408
06 1.655911
05 1.778952
04 2.624719
03 1.698099
02 3.022607
01 3.303135
Run Code Online (Sandbox Code Playgroud)
这是我在做的事情:
import matplotlib.pyplot as plt
from scipy import interpolate
yinterp = interpolate.UnivariateSpline(x, y, s = 5e8)(x)
plt.plot(x, y, 'bo', label = 'Original')
plt.plot(x, yinterp, 'r', label = 'Interpolated')
plt.show()
Run Code Online (Sandbox Code Playgroud)
这就是它的样子:

我想知道是否有人想过scipy可能有的其他曲线拟合选项?我比较狡猾.
谢谢!