WStatCountsStatistic#

class gammapy.stats.WStatCountsStatistic[source]#

Bases: CountsStatistic

Class to compute statistics for Poisson distributed variable with unknown background.

Parameters:
n_onint

Measured counts in on region.

n_offint

Measured counts in off region.

alphafloat

Acceptance ratio of on and off measurements.

mu_sigfloat

Expected signal counts in on region.

Attributes Summary

error

Approximate error from the covariance matrix.

n_bkg

Known background computed alpha * n_off.

n_sig

Excess.

stat_max

Stat value for best fit hypothesis.

stat_null

Stat value for null hypothesis, i.e. mu_sig expected signal counts.

Methods Summary

info_dict()

A dictionary of the relevant quantities.

sum([axis])

Return summed CountsStatistics.

Attributes Documentation

error#

Approximate error from the covariance matrix.

n_bkg#

Known background computed alpha * n_off.

n_sig#

Excess.

stat_max#

Stat value for best fit hypothesis.

i.e. expected signal mu = n_on - alpha * n_off - mu_sig.

stat_null#

Stat value for null hypothesis, i.e. mu_sig expected signal counts.

Methods Documentation

info_dict()[source]#

A dictionary of the relevant quantities.

Returns:
info_dictdict

Dictionary with summary info.

sum(axis=None)[source]#

Return summed CountsStatistics.

Parameters:
axisNone or int or tuple of ints, optional

Axis or axes on which to perform the summation. Default, axis=None, will perform the sum over the whole array.

Returns:
statCountsStatistics

The summed stat object.

__init__(n_on, n_off, alpha, mu_sig=None)[source]#
classmethod __new__(*args, **kwargs)#