这是一个关于从lmfit
fit_report()
( 1 ) 对象中提取拟合统计信息的问题
在此 lmfit
示例中,返回以下部分输出:
[[Model]]
Model(gaussian)
[[Fit Statistics]]
# function evals = 31
# data points = 101
# variables = 3
chi-square = 3.409
reduced chi-square = 0.035
Akaike info crit = -336.264
Bayesian info crit = -328.418
.
.
.
.
.
.
我试图将该Fit Statistics
部分中的所有数量提取为单独的变量。
例如。要提取模型参数,我们可以使用 (per 1 , 2 ):
for key in fit.params:
print(key, "=", fit.params[key].value, "+/-", fit.params[key].stderr)
然而,这只给出了模型参数;它没有给出拟合统计参数,这些参数也很有用。我似乎在文档中找不到这个。
是否有类似的方法可以分别提取拟合统计参数(chi-square
、reduced chi-square
、function evals
等)?