significance

gammapy.stats.significance(n_on, mu_bkg, method='lima', n_on_min=1)[source]

Compute significance for an observed number of counts and known background.

The default method="lima" gives the significance estimate corresponding to equation (17) from the Li & Ma paper [1] in the limiting of known background \(\mu_{bkg} = \alpha \times n_{off}\) with \(\alpha \to 0\).

It is given by the following formula:

\[S_{lima} = \left[ 2 n_{on} \log \left( \frac{n_{on}}{\mu_{bkg}} \right) - n_{on} + \mu_{bkg} \right] ^ {1/2}\]

For method="simple", the significance estimate is given by:

\[S_{simple} = (n_{on} - \mu_{bkg}) / \sqrt{\mu_{bkg}}\]
Parameters:
n_on : array_like

Observed number of counts

mu_bkg : array_like

Known background level

method : {“lima”, “simple”}

Method for significance estimation

n_on_min : float

Minimum n_on (return NaN for smaller values)

Returns:
significance : ndarray

Significance estimate

References

[1](1, 2) Li and Ma, “Analysis methods for results in gamma-ray astronomy”, Link

Examples

>>> significance(n_on=10, mu_bkg=2, method='lima')
4.0235256
>>> significance(n_on=10, mu_bkg=2, method='simple')
5.65685425