chi2

gammapy.stats.chi2(N_S, B, S, sigma2)[source]

Chi-square statistic with user-specified variance.

\[\chi^2 = \frac{(N_S - B - S) ^ 2}{\sigma ^ 2}\]
Parameters:

N_S : array_like

Number of observed counts

B : array_like

Model background

S : array_like

Model signal

sigma2 : array_like

Variance

Returns:

stat : ndarray

Statistic per bin

References