Chi2ModVar

class sherpa.stats.Chi2ModVar(name='chi2modvar')[source]

Bases: sherpa.stats.Chi2

Chi Squared with model amplitude variance.

The variance in each bin is estimated from the model value in that bin. This contrasts with Chi2DataVar, Chi2XspecVar`, and Chi2Gehrels, which use the data values. The variance is

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

where B(i,off) is the background model amplitude in bin i of the off-source region.

Notes

The background should not be subtracted from the data when this statistic is used, as it underestimates the variance when fitting background-subtracted data.

Methods Summary

calc_chisqr(data, model) Return the chi-square value for each bin.
calc_stat(data, model)
calc_staterror(data)

Methods Documentation

calc_chisqr(data, model)

Return the chi-square value for each bin.

Parameters:
  • data (a Data or DataSimulFit instance) – The data set, or sets, to use.
  • model (a Model or SimulFitModel instance) – The model expression, or expressions. If a SimulFitModel is given then it must match the number of data sets in the data parameter.
Returns:

chisqr – The per-bin chi-square values.

Return type:

array of numbers

calc_stat(data, model)
static calc_staterror(data)[source]