SpeysideHEP / spey

Smooth inference for reinterpretation studies
https://spey.readthedocs.io
MIT License
7 stars 1 forks source link

Enable computation of p-values from chi-square CDF #16

Closed jackaraz closed 1 year ago

jackaraz commented 1 year ago

Feature details

One can compute the exclusion limits using $\chi^2$ values by computing its CDF with respect to the DOF of the statistical model. This will allow users to compute p-values without the asymptotic formulae or generating toy models. This is especially useful if the model description does not allow for generating data.

Implementation

Extend exclusion limit computer with $\chi^2$ method using the following example

>>> from scipy.stats import chisqprob, chi2
>>> chisqprob(3.84,1)
... 0.050043521248705189
>>> 1 - chi2.cdf(3.84,1)
... 0.050043521248705147

How important would you say this feature is?

2: Somewhat important.

Additional information

No response