    Return the statistic values for the current models.

get_stat_info()

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

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

PARAMETERS

This function has no parameters

The return value from this function is:

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.

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 return value of `get_stat_info` differs to `get_fit_results`

since it includes values for each data set, individually, rather than just the combined results.

The fields of the object include:

Item
Definition
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.

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023