【发布时间】:2020-04-24 10:04:08
【问题描述】:
输入数据和函数形式是已知的。你必须找出函数的系数。这些需要确定的系数的值也是已知的(60.351、4.388、4.806)。在编写代码时,我的灵感来自:nonlinear-regression with python 唯一的区别在于输入数据和函数的定义。
xData = numpy.array([1, 23385, 35800, 63699, 106798, 222064, 4272000, 20296, 461351, 175300, 11815])
yData = numpy.array([198.9, 112.2, 100.3, 89.8, 80.3, 69.8, 60.8, 120.1, 65.3, 74.9, 127.7])
def func(x, a, b, Offset): # Sigmoid A With Offset from zunzun.com
return Offset + 139.0/ ((numpy.exp((log10(x))/a))**b)
我相信当我使用 log10() 函数时,初始参数存在一些问题。 错误如下: error capture
【问题讨论】:
标签: python curve-fitting non-linear-regression sn