gammapy.stats.wstat(n_on, n_off, alpha, mu_sig, mu_bkg=None, extra_terms=True)[source]

W statistic, for Poisson data with Poisson background.

For a definition of WStat see Poisson data with background measurement. If mu_bkg is not provided it will be calculated according to the profile likelihood formula.

n_on : array_like

Total observed counts

n_off : array_like

Total observed background counts

alpha : array_like

Exposure ratio between on and off region

mu_sig : array_like

Signal expected counts

mu_bkg : array_like, optional

Background expected counts

extra_terms : bool, optional

Add model independent terms to convert stat into goodness-of-fit parameter, default: True

stat : ndarray

Statistic per bin