Module functions to get information about the quality of a fit.
Array_Type get_fit([Integer_Type | Array_Type])
Array_Type get_goodness([Integer_Type | Array_Type])
Error Return Value: NULL
Arguments:
(1) data set number (default all data sets), or an array of data set
numbers.
The functions get_fit() and get_goodness() return information about
the quality of fit. Currently, the function returns an array of
S-Lang variables of Struct_Type. The array is of length 1 if information
for only one data set is requested, or N+1
if information for N data sets is requested.
In the latter case, the total statistic, etc., is given by the first
element of the returned array.
The output Struct_Type variable contains the following fields:
- dataset: the number of the fit dataset; if NULL,
then the Struct_Type variable contains information about all fits.
- datatype: one of source, bkgd, or total.
- stat: the observed statistic value, or the sum of the statistic
values if datatype is set to total.
- numbins: the number of bins involved in the fit.
- dof: the number of degrees of freedom:
numbins minus the number of model free parameters.
- rstat: the reduced statistic, stat
divided by dof; this field is NULL for the statistics
CASH and BAYES.
- qval: the q value (see
get_qvalue()); this field is NULL for the statistics
CASH and BAYES.
See the related Sherpa command
GOODNESS for more information.
[...fit two datasets...]
sherpa> res = get_fit()
sherpa> print(res[0])
dataset = NULL # the total stat, etc., are shown
datatype = total #
stat = 127.821
numbins = 200
dof = 197
rstat = 0.64884
qval = 0.999964
sherpa> res = get_res(2)
sherpa> print(res[0])
dataset = 2 # only the fit info for dataset 2 shown
datatype = source
stat = 63.9103
numbins = 100
dof = 98
rstat = 0.652146
qval = 0.996969
The get_fit() function now works correctly when given an argument. Prior to CIAO 3.2 it would ignore the supplied argument.
- chandra
-
guide
- sherpa
-
get_analysis,
get_arf_axes,
get_axes,
get_coord,
get_data,
get_energy_axes,
get_errors,
get_filter,
get_filter_expr,
get_fluxed_spectrum,
get_ftest,
get_metadata,
get_photon_axes,
get_photon_energy_axes,
get_photon_wave_axes,
get_qvalue,
get_raw_axes,
get_record,
get_source,
get_statistic,
get_stats,
get_syserrors,
get_wave_axes,
get_weights,
record,
save,
write
|