calc_bkg_stat
- sherpa.astro.ui.calc_bkg_stat(id: IdType | None = None, *otherids: IdType)
Calculate the fit statistic for a background data set.
Evaluate the current background models for the background datasets, calculate the statistic for each background, and return the sum. No fitting is done, as the current model parameter, and any filters, are used. The
calc_bkg_stat_info
routine should be used if the result for a particular background component needs to be returned.Added in version 4.16.0.
- Parameters:
- Returns:
stat – The current statistic value.
- Return type:
number
See also
calc_bkg_stat_info
,calc_stat
,fit_bkg
,get_bkg_stat_info
,set_stat
Examples
Calculate the statistic for the background in the default data set:
>>> stat = calc_bkg_stat()
Find the statistic for the background for data set 3:
>>> stat = calc_bkg_stat(3)
Calculate the background statistic value using two different statistics:
>>> set_stat('chi2datavar') >>> s1 = calc_bkg_stat() >>> set_stat('chi2gehrels') >>> s2 = calc_bkg_stat()