Last modified: December 2020

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_stat.html
AHELP for CIAO 4.13 Sherpa v1

set_stat

Context: statistics

Synopsis

Set the statistical method.

Syntax

set_stat(stat)

stat - str

Description

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


Example

>>> set_stat('cash')

PARAMETERS

The parameter for this function is:

Parameter Definition
stat The name of the statistic (case is not important). The `list_stats` function returns the list of supported values.

Notes

The available statistics include:

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


Bugs

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

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
data
set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_dep, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror
filtering
set_filter
info
list_stats
methods
set_iter_method, set_iter_method_opt, set_method, set_method_opt
modeling
get_par, get_xsabund, get_xscosmo, get_xsxsect, get_xsxset, set_bkg_model, set_bkg_source, set_full_model, set_model, set_par, set_pileup_model, set_source, set_xsabund, set_xscosmo, set_xsxsect, set_xsxset
statistics
cash, chi2constvar, chi2datavar, chi2gehrels, chi2modvar, chi2xspecvar, chisquare, cstat, get_prior, get_stat_name, leastsq, list_priors, load_user_stat, set_prior, set_sampler, set_sampler_opt, wstat
utilities
calc_stat, set_analysis, set_default_id
visualization
image_setregion