Module function to estimate a statistic given arrays of data, model amplitudes, and errors, etc.
Double_Type compute_statistic(Struct_Type)
Double_Type compute_statistic(Array_Type,Array_Type \
[,Array_Type[,Array_Type[,Array_Type]]]))
Error Return Value: NULL
Arguments:
(1) Structure containing data, model amplitude, etc., arrays; or
(1) Array of observed data
(2) Array of predicted model amplitudes
(3) Array of estimated errors
(4) Array of systematic errors
(5) Array of statistical weights
This function computes the
summed statistic value given Sherpa's current
STATISTIC setting.
(Note that the data et al. need not have been input into Sherpa!)
If an error array is input, then note that the actual setting of
chi-square
(e.g., CHI GEHRELS or CHI DVAR)
does not matter (since the input
errors are used instead of error estimates) if the
chi-square statistic is used. Also note
that the error array is ignored for likelihood-based statistics
(e.g., CASH).
On the other hand, if an errors array is not provided,
and a data-based variance is used (chi gehrels,
chi dvar, and chi parent),
then errors are estimated via a call to the function
compute_errors; there is thus an
implicit assumption that the input data array elements are counts.
If chi mvar is used, then the errors are set equal
to the input predicted model amplitudes.
Compute the statistic given a data and model array (with errors
estimated):
sherpa> get_stat_expr
chi gehrels
sherpa> d = [55,53,59]
sherpa> m = [55.5,55.6,55.7]
sherpa> compute_statistic(d,m)
0.243771
Because an error array was not provided, errors were estimated using
the CHI GEHRELS variance formula; then the total
statistic was computed. Below, we explicit create and use an array
of errors:
sherpa> e = [5.5,5.3,5.9]
sherpa> compute_statistic(d,m,e)
0.561761
sherpa> STATISTIC CHI DVAR
sherpa> compute_statistic(d,m,e)
0.561761
The version of chi-square does not matter
since the error estimates are provided.
- sherpa
-
berrors,
bsyserrors,
compute_errors,
covariance,
errors,
ftest,
get_paramest,
get_paramestint,
get_paramestlim,
get_paramestreg,
goodness,
interval-projection,
interval-uncertainty,
list_paramest,
mlr,
projection,
region-projection,
region-uncertainty,
restore_paramest,
run_paramest,
run_paramestint,
run_paramestlim,
run_paramestreg,
set_errors,
set_syserrors,
staterrors,
syserrors,
uncertainty
|