Skip to content

Commit 0f440e8

Browse files
feat(backport): Improve warnings for qmu and qmu_tilde for the set POI bounds (#2426)
* Backport PR #2390 * Add Lorenz Gaertner to contributors list. Co-authored-by: Lorenz Gaertner <[email protected]>
1 parent 3df4e52 commit 0f440e8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/contributors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ Contributors include:
3333
- Beojan Stanislaus
3434
- Daniel Werner
3535
- Jonas Rembser
36+
- Lorenz Gaertner

src/pyhf/infer/test_statistics.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def qmu(mu, data, pdf, init_pars, par_bounds, fixed_params, return_fitted_pars=F
134134
if par_bounds[pdf.config.poi_index][0] == 0:
135135
log.warning(
136136
'qmu test statistic used for fit configuration with POI bounded at zero.\n'
137-
+ 'Use the qmu_tilde test statistic (pyhf.infer.test_statistics.qmu_tilde) instead.'
137+
+ 'Use the qmu_tilde test statistic (pyhf.infer.test_statistics.qmu_tilde) instead.\n'
138+
+ 'If you called this from pyhf.infer.mle or pyhf.infer.hypotest, set test_stat="qtilde".'
138139
)
139140
return _qmu_like(
140141
mu,
@@ -229,7 +230,8 @@ def qmu_tilde(
229230
if par_bounds[pdf.config.poi_index][0] != 0:
230231
log.warning(
231232
'qmu_tilde test statistic used for fit configuration with POI not bounded at zero.\n'
232-
+ 'Use the qmu test statistic (pyhf.infer.test_statistics.qmu) instead.'
233+
+ 'Use the qmu test statistic (pyhf.infer.test_statistics.qmu) instead.\n'
234+
+ 'If you called this from pyhf.infer.mle or pyhf.infer.hypotest, set test_stat="q".'
233235
)
234236
return _qmu_like(
235237
mu,

0 commit comments

Comments
 (0)