significance_on_off

gammapy.stats.significance_on_off(n_on, n_off, alpha, method='lima')[source]

Compute significance of an on-off observation.

The default method="lima" gives the significance estimate corresponding to equation (17) from the Li & Ma paper [1].

For method="simple", the significance estimate is given by Equation (5) from the Li & Ma paper [1]. It is somewhat biased, but has the advantage of being analytically invertible, which is useful for sensitivity computations.

\[ \begin{align}\begin{aligned}S_{simple} = \mu_{excess} / \Delta\mu_{excess}\\\mu_{excess} = n_{on} - \alpha n_{off}\\\Delta\mu_{excess} = \sqrt{n_{on} + \alpha ^ 2 n_{off}}\end{aligned}\end{align} \]
Parameters
n_onarray_like

Observed number of counts in the on region

n_offarray_like

Observed number of counts in the off region

alphaarray_like

On / off region exposure ratio for background events

method{“lima”, “simple”}

Method for significance estimation

Returns
significancendarray

Significance estimate

References

1(1,2)

Li and Ma, “Analysis methods for results in gamma-ray astronomy”, Link

Examples

>>> significance_on_off(n_on=10, n_off=20, alpha=0.1, method='lima')
3.6850322319420274
>>> significance_on_off(n_on=10, n_off=20, alpha=0.1, method='simple')
2.5048971643405982