qmutilde in pyhf #1334
-
Hi all, I'm just getting my feet using the pyhf software and ran into a couple of errors. I took a simple hypothesis test model from the pyhf examples and attempted to run it for integer test values from 0 to 400 for 9 different signal files (just looped over below 9 times with a different spec input to the workspace). Trying this gave the error workspace = pyhf.Workspace(spec)
model = workspace.model(measurement_name="Measurement")
data = pyhf.tensorlib.astensor(background_data + model.config.auxdata)
poisson_vals = np.linspace(0, 400, 400)
init_parameters = model.config.suggested_init()
parameter_bounds = model.config.suggested_bounds()
fixed_parameters = model.config.suggested_fixed()
results = [
pyhf.infer.hypotest(
test_poi,
data,
model,
test_stat=pyhf.infer.test_statistics.qmu_tilde(
test_poi, data, model, init_parameters, parameter_bounds, fixed_parameters
),
return_expected_set=True,
)
for test_poi in poisson_vals
] I then updated from 0.5.4 to 0.6.0 to see if that may help and it could no longer deal with the previous code; I then changed the results array to the simpler one seen below and re-ran it. results = [
pyhf.infer.hypotest(
test_poi, data, model, test_stat="qmu_tilde", return_expected_set=True
)
for test_poi in poisson_vals
] Which gave the error Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi, the There is also a related issue about allowing additional names: #1246. |
Beta Was this translation helpful? Give feedback.
-
For posterity, I'll also note that the results = [
pyhf.infer.hypotest(
test_poi,
data,
model,
init_par=init_parameters,
par_bounds=parameter_bounds,
fixed_params=fixed_parameters,
qtilde=True,
return_expected_set=True,
)
for test_poi in poisson_vals
]
|
Beta Was this translation helpful? Give feedback.
-
Thanks all, changing it to qtilde seems to have fixed the error. Silly error on my part. |
Beta Was this translation helpful? Give feedback.
Hi, the
test_stat
is called"qtilde"
instead, see theAsymptoticCalculator
documentation for details (linked from thehypotest
documentation but admittedly easy to overlook).There is also a related issue about allowing additional names: #1246.