wstat#

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 WStat : Poisson data with background measurement. If mu_bkg is not provided it will be calculated according to the profile likelihood formula.

Parameters:
n_onndarray or array_like

Total observed counts.

n_offndarray or array_like

Total observed background counts.

alphandarray or array_like

Exposure ratio between on and off region.

mu_signdarray or array_like

Signal expected counts.

mu_bkgndarray or array_like, optional

Background expected counts.

extra_termsbool, optional

Add model independent terms to convert stat into goodness-of-fit parameter. Default is True.

Returns:
statndarray

Statistic per bin.

References