This is a question about extracting fit statistics from the lmfit
fit_report()
(1) object
In this lmfit
example, the following partial output is returned:
[[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
.
.
.
.
.
.
I am trying to extract all the quantities in the Fit Statistics
section as separate variables.
eg. to extract the model parameters, we could use (per 1,2):
for key in fit.params:
print(key, "=", fit.params[key].value, "+/-", fit.params[key].stderr)
However, this only gives the model parameters; it does not give the fit statistics parameters, which are also useful. I cannot seem to find this in the documentation.
Is there a similar way to extract the Fit Statistics parameters (chi-square
, reduced chi-square
, function evals
, etc.) separately?