-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API to calculate the median expected discovery significance #1810
Comments
I should note of course, that you can do something similar to like what @alexander-held is doing now in import pyhf
from scipy.stats import norm
model = pyhf.simplemodels.uncorrelated_background([6], [9], [3])
data = [12] + model.config.auxdata
init_pars = model.config.suggested_init()
par_bounds = model.config.suggested_bounds()
fixed_params = model.config.suggested_fixed()
obs_p_val, exp_p_val = pyhf.infer.hypotest(
0.0,
data,
model,
init_pars=init_pars,
fixed_params=fixed_params,
par_bounds=par_bounds,
test_stat="q0",
return_expected=True,
)
obs_p_val = float(obs_p_val)
exp_p_val = float(exp_p_val)
obs_significance = norm.isf(obs_p_val, 0, 1)
exp_significance = norm.isf(exp_p_val, 0, 1)
print(f"Observed significance: {obs_significance}")
print(f"Expected significance: {exp_significance}")
but this still faces the same problems if someone has a workspace in which they have fixed the POI (e.g. Offering an straightforward API might be better. |
Yeah, I think just stealing what |
I'm not sure whether I understand the direction of this issue correctly. Is it specifically about calculating expected discovery significance without any reference to observed data? pyhf/src/pyhf/infer/calculators.py Line 378 in fc3cc62
(There may be some value in allowing other values here, but users could also re-scale their signal instead.) Is this what
refers to? If this is about doing a fully blind evaluation ("pre-fit Asimov") of the expected discovery significance, then the way to do this in cabinetry would be via
I see two options here, either ignoring what is set in the workspace for convenience (so that the calculation can go forward), or raising an error with a suitable message. I see value in both approaches. |
Summary
In PR #1232 we added the ability to calculate the discovery test statistic. 👍 That's all fine. But if you want to calculate the median expected significance in the presence of a signal you would need to calculate
q0(mu^=1)
(that's supposed to be mu-hat), so we need some way to be able to force the value of themu^
to be themu_Asimov
. This is currently not allowed with thev0.6.3
pyhf.infer.test_statistics.q0
API, though in thev0.7.0
API we will have thereturn_fitted_pars=True
optionpyhf/src/pyhf/infer/test_statistics.py
Lines 494 to 495 in 05e1338
to return
(mu^, theta^^)
and(mu^, theta^)
.It would be good if we provided a way to calculate the median expected significance.
Additional Information
I was reminded of this today when reading through Eilam Gross's lectures from the 2017 European School of High-Energy Physics, in particular Slide 79 "The Median Sensitivity (via ASIMOV)".
This is motivated by trying to work on a translation recipe for
WSMaker
in Issue #1341.Code of Conduct
The text was updated successfully, but these errors were encountered: