📜  python scipy 对curve_fit中的设定值赋予更多权重 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:17.943000             🧑  作者: Mango

代码示例1
from scipy.optimize import curve_fit

# simply add an uncertainties to each sample;
# very small uncertainty mean almost as true value, so will be taken as reference point;
uncertainties = numpy.array([1.0E-10, 1.0E-10, 1.0E-10, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,1.0, 1.0])

# Use uncertainties with absolute_sigma as True;
fittedParameters, pcov = curve_fit(func, xData, yData, sigma=uncertainties, absolute_sigma=True)