我试图用ipython--pylab将数据集拟合到超极化方程中: y=ax/(b+x)
from scipy import optimize as opti
import numpy as np
from pandas import DataFrame
x = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8])
y = np.array([0.375, 0.466, 0.509, 0.520, 0.525, 0.536, 0.541])
y_stdev = np.array([0.025, 0.016, 0.009, 0.009, 0.025, 0.019])
def func(x, a, b):
return a*x / (b + x)
popt, pcov = opti.curve_fit(func, x, y)
print(popt)
print("a = ", popt.ix[0])
print("b = ", popt.ix[1])
a和b的值应在popt参数内。我想问的是,将数据集拟合到func(x,a,b)时,会推断出a和b的值,那么,我们如何估计a和b的标准差? 谢谢您。在
就在docs:
相关问题 更多 >
编程相关推荐