get_stat_info

sherpa.astro.ui.get_stat_info()

Return the statistic values for the current models.

Calculate the statistic value for each data set, and the combined fit, using the current set of models, parameters, and ranges.

Returns:stats – The values for each data set. If there are multiple model expressions then the last element will be the value for the combined data sets.
Return type:array of sherpa.fit.StatInfoResults

See also

calc_stat()
Calculate the fit statistic for a data set.
calc_stat_info()
Display the statistic values for the current models.
get_fit_results()
Return the results of the last fit.
list_data_ids()
List the identifiers for the loaded data sets.
list_model_ids()
List of all the data sets with a source expression.

Notes

If a fit to a particular data set has not been made, or values - such as parameter settings, the noticed data range, or choice of statistic - have been changed since the last fit, then the results for that data set may not be meaningful and will therefore bias the results for the simultaneous results.

The fields of the object include:

name
The name of the data set, or sets, as a string.
ids
A sequence of the data set ids (it may be a tuple or array) included in the results.
bkg_ids
A sequence of the background data set ids (it may be a tuple or array) included in the results, if any.
statname
The name of the statistic function (as used in set_stat).
statval
The statistic value.
numpoints
The number of bins used in the fits.
dof
The number of degrees of freedom in the fit (the number of bins minus the number of free parameters).
qval
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 None if the value can not be calculated with the current statistic (e.g. the Cash statistic).
rstat
The reduced statistic value (the statval field divided by dof). This is not calculated for all statistics.

Examples

>>> res = get_stat_info()
>>> res[0].statval
498.21750663761935
>>> res[0].dof
439