Calculate the fit statistic by data set ID
calc_stat( [ id, [otherids]] )
The function calc_stat returns the value of the fit statistic
for the data set ID(s) specified; the data set ID(s) supplied
to calc_stat must be ready for fitting, i.e. it has been
assigned a model to be fit. The calc_stat function can be
called with no arguments, in which
case the fit statistic for the default data set ready for fitting
will be returned. If multiple data set IDs are given, then the
simultaneous fit statistic is
calculated for those data sets. The fit statistic value
returned by calc_stat represents the initial fit statistic, which
matches the "istatval" value returned by get_fit_results.
-
id, otherids - the id(s) of the dataset(s) to use; if not given, uses the default dataset id (id=1 by default, see "ahelp get_default_id");
otherids=None
Below are the fit statistics available in Sherpa:
| chi2modvar |
\chi^2 with model amplitude variance. |
| chi2gehrels |
\chi^2 with gehrels method (default). |
| chi2datavar |
\chi^2 with data variance. |
| chi2xspecvar |
\chi^2 with data variance (XSPEC-style, variance = 1.0
if data less than or equal to 0.0) |
| cstat |
CStat - A maximum likelihood function (XSPEC implementation
of Cash). |
| cash |
Cash - A maximum likelihood function. |
When called with no arguments, calc_stat() returns the fit
statistic for the default data set, if it has been assigned a
model to be fit.
sherpa> calc_stat(1)
sherpa> calc_stat("src")
Supplying a specific data set ID to calc_stat - such as "1"
or a the string "src" - will return the initial fit
statistic for only that data set.
sherpa> calc_stat(1,2)
sherpa> calc_stat("src", "bkg")
When supplied with multiple data set IDs, calc_stat
returns the intial fit statistic produced by the
simultaneous fit on those data sets.
- py.sherpa
-
add_user_pars,
calc_chisqr,
calc_energy_flux,
calc_model_sum,
calc_photon_flux,
calc_source_sum,
clean,
contour_model,
contour_ratio,
contour_resid,
create_model_component,
delete_bkg_model,
delete_model,
delete_model_component,
delete_psf,
eqwidth,
fit,
gamma,
get_bkg_plot,
get_model,
get_model_autoassign_func,
get_model_plot,
get_num_par,
get_order_plot,
get_par,
get_pileup_model,
get_ratio,
get_resid,
get_source,
get_stat,
igam,
igamc,
image_fit,
image_model,
image_source,
incbet,
integrate,
lgam,
link,
list_model_ids,
load_table_model,
load_user_model,
plot_fit,
plot_model,
plot_source,
reset,
set_bkg_model,
set_model,
set_model_autoassign_func,
set_pileup_model,
set_source
- sherpa_tools
-
modelflux
|