About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/goodness.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 goodness Context: sherpa

Synopsis

Reports information on the goodness-of-fit.

Syntax

sherpa> GOODNESS [<dataset range> | ALLSETS]

<dataset range> = # (or more generally #:#,#:#, etc.) such that #
specifies a dataset number and #:# represents an inclusive range of
datasets; one may specify multiple inclusive ranges by separating them
with commas. The default is to obtain information from all appropriate
datasets.

Description

GOODNESS reports to the user information about how well specified models fit to the data. At a minimum, it reports: the choice of statistic; the number of bins in the fit; the number of degrees of freedom (dof), i.e., the number of bins minus the number of free parameters; and the statistic value. (See the documentation on the command STATISTIC for more information on how to set the current statistic within Sherpa.)

If the chosen statistic is one of the chi-square statistics, or the CSTAT statistic, then more information is shown: the reduced statistic, i.e., the statistic value divided by the number of dof; and the probability, or Q-value:

Q = (integral)_(X^2_obs)^(infinity) dX^2 p(X^2 | N-P) ,

where X^2 is the chi-square statistic, X^2_obs represents a specific observed value of chi-square (e.g., resulting from a fit), N-P is the number of degrees of freedom (number of bins minus number of free parameters), and p(X^2 | N-P) is the chi-square probability sampling distribution.

Q measures the probability that one would observe the value X^2_obs, or a larger value, if the assumed model is true and the best-fit model parameters are the true parameter values. A value that is too small (e.g., Q < 0.05) indicates that the selected model does not accurately portray the data, while a value that is too large (Q -< 1) indicates that the fit is ``too good." The usual cause of a fit that is too good is an overestimation of the errors (e.g., by using CHI GEHRELS in the low-counts regime (see note below), or by adding in too much systematic error). Increasing the errors decreases X^2_obs, and increases Q.

Note that the accuracy of Q is dependent upon whether the selected statistic is actually sampled from the chi-square distribution! This may not be the case if the number of counts in any bin is too small (< 5-10).

The information output by GOODNESS may be retrieved using the Sherpa/S-Lang module function get_goodness.

Example

Report information on the goodness-of-fit:

sherpa> GOODNESS
Goodness: computed with Chi-Squared Data Variance

DataSet 1: 100 data points -- 99 degrees of freedom.
 Statistic value       = 82.7136
 Probability [Q-value] = 0.880939
 Reduced statistic     = 0.835491

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.