Last modified: December 2013

Jump to: Description · Example · Bugs · See Also

AHELP for CIAO 4.16 Sherpa


Context: statistics


Chi-square statistic with the Gehrels variance function.


chi2gehrels is the default statistic in Sherpa.

If the number of counts in each bin is small (< 5), then we cannot assume that the Poisson distribution from which the counts are sampled has a nearly Gaussian shape. The standard deviation (i.e., the square-root of the variance) for this low-count case has been derived by Gehrels (1986):

sigma(i,S) = 1 + (sqrt)[N(i,S)+0.75] .

Higher-order terms have been dropped from the expression; it is accurate to approximately one percent. If one does not perform background subtraction, then sigma(i) = sigma(i,S); otherwise, one may use standard error propagation to estimate that

sigma(i)^2 = sigma(i,S)^2 + [A(S)/A(B)]^2 sigma(i,B)^2 .

The background term appears only if a background region is specified and background subtraction is done. The help file on the chi-square statistic has more information, including definitions of the quantities in the equation: "ahelp chisquare" .

Note on Background Subtraction

The accuracy of the latter expression has not been determined, thus the user should proceed with caution when subtracting background from the raw data when using this statistic. An approach preferable to background subtraction is to model the background and data simultaneously.


sherpa> set_stat("chi2gehrels")
sherpa> show_stat()
Statistic: Chi2Gehrels

Set the fitting statistic and then confirm the new value.


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

See Also

cash, chi2constvar, chi2datavar, chi2modvar, chi2xspecvar, chisquare, cstat, get_prior, leastsq, list_priors, set_prior, set_sampler, set_stat, wstat