Return the results of the last fit.
This function returns the results from the most-recent fit. The returned value includes information on the parameter values and fit statistic.
Returns: stats – The results of the last fit. It does not reflect any changes made to the model parameter, or settings, since the last fit. Return type: a sherpa.fit.FitResults instance
- Calculate the fit statistic for a data set.
- Display the statistic values for the current models.
- Fit a model to one or more data sets.
- Return the statistic values for the current models.
- Set the iterative-fitting scheme used in the fit.
The fields of the object include:
- A sequence of the data set ids included in the results.
- What iterated-fit scheme was used, if any (as set by set_iter_method).
- The name of the statistic function (as used in set_stat).
- Was the fit successful (did it converge)?
- A tuple of the parameter names that were varied in the fit (the thawed parameters in the model expression).
- A tuple of the parameter values, in the same order as
- The statistic value after the fit.
- The statistic value at the start of the fit.
- The change in the statistic value (
istatval - statval).
- The number of bins used in the fits.
- The number of degrees of freedom in the fit (the number of bins minus the number of free parameters).
- The Q-value (probability) that one would observe the
reduced statistic value, or a larger value, if the assumed
model is true and the current model parameters are the
true parameter values. This will be
Noneif the value can not be calculated with the current statistic (e.g. the Cash statistic).
- The reduced statistic value (the
statvalfield divided by
dof). This is not calculated for all statistics.
- A message about the results of the fit (e.g. if the fit was unable to converge). The format and contents depend on the optimisation method.
- The number of model evaluations made during the fit.
Display the fit results:
Inspect the fit results:
>>> res = get_fit_results() >>> res.statval 498.21750663761935 >>> res.dof 439 >>> res.parnames ('pl.gamma', 'pl.ampl', 'gline.fwhm', 'gline.pos', 'gline.ampl') >>> res.parvals (-0.20659543380329071, 0.00030398852609788524, 100.0, 4900.0, 0.001)