set_stat

sherpa.astro.ui.set_stat(stat)

Set the statistical method.

Changes the method used to evaluate the fit statistic, that is the numerical measure that determines how closely the model represents the data.

Parameters

stat (str or sherpa.stats.Stat instance) – When a string, the name of the statistic (case is not important): see list_stats() for supported values. Otherwise an instance of the statistic to use.

Raises

sherpa.utils.err.ArgumentErr – If the stat argument is not recognized.

calc_stat

Calculate the statistic value for a dataset.

get_stat_name

Return the current statistic method.

list_stats

List the supported fit statistics.

Create a user-defined statistic.

Notes

The available statistics include:

cash

A maximum likelihood function 1.

chi2

Chi-squared statistic using the supplied error values.

chi2constvar

Chi-squared with constant variance computed from the counts data.

chi2datavar

Chi-squared with data variance.

chi2gehrels

Chi-squared with gehrels method 2. This is the default method.

chi2modvar

Chi-squared with model amplitude variance.

chi2xspecvar

Chi-squared with data variance (XSPEC-style, variance = 1.0 if data less than or equal to 0.0).

cstat

A maximum likelihood function (the XSPEC implementation of the Cash function) 3. This does not include support for including the background.

wstat

A maximum likelihood function which includes the background data as part of the fit (i.e. for when it is not being explicitly modelled) (the XSPEC implementation of the Cash function) 3.

leastsq

The least-squares statisic (the error is not used in this statistic).

References

1

Cash, W. “Parameter estimation in astronomy through application of the likelihood ratio”, ApJ, vol 228, p. 939-947 (1979). http://adsabs.harvard.edu/abs/1979ApJ…228..939C

2

Gehrels, N. “Confidence limits for small numbers of events in astrophysical data”, ApJ, vol 303, p. 336-346 (1986). http://adsabs.harvard.edu/abs/1986ApJ…303..336G

3(1,2)
{"ft_lang_label":"__label__en","ft_lang_prob":0.6632733,"math_prob":0.8959275,"size":2114,"snap":"2022-05-2022-21","text_gpt3_token_len":542,"char_repetition_ratio":0.13270143,"word_repetition_ratio":0.038194444,"special_character_ratio":0.243614,"punctuation_ratio":0.17391305,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9744482,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-28T11:53:53Z\",\"WARC-Record-ID\":\"<urn:uuid:7f355b2a-053e-4655-935d-615e25bd9bae>\",\"Content-Length\":\"65887\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:da25ac08-9504-44ad-ad93-7475881e6ef2>\",\"WARC-Concurrent-To\":\"<urn:uuid:17b6921f-8ea6-468d-9b10-c2c65f635478>\",\"WARC-IP-Address\":\"104.17.33.82\",\"WARC-Target-URI\":\"https://sherpa.readthedocs.io/en/latest/ui/api/sherpa.astro.ui.set_stat.html\",\"WARC-Payload-Digest\":\"sha1:HRHQMSD3EJM2IK6Q63YSQTMG4DE5TZJ2\",\"WARC-Block-Digest\":\"sha1:KWXQPFMMHFBZQAEEJE6IH5NRL3ROL3E2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320305494.6_warc_CC-MAIN-20220128104113-20220128134113-00576.warc.gz\"}"}