-
Dear pyhf users, test_mus = np.linspace(0.2, 3, 60)
results = [
pyhf.infer.hypotest(
test_mu, data, model, return_expected_set=True, return_tail_probs=True
)
for test_mu in test_mus
] Unfortunately, the Call Limit is being reached in the fit. I tried adding Best, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@ssaha1234 Probably the most straightforward way to do this (in import pyhf
print(f"pyhf version: v{pyhf.__version__}") # pyhf version: v0.6.3
pyhf.set_backend("numpy", pyhf.optimize.scipy_optimizer(maxiter=2000000))
backend, optimizer = pyhf.get_backend()
print(f"{optimizer.maxiter=}") # optimizer.maxiter=2000000 Though I'll note that if your fit is struggling here bumping the |
Beta Was this translation helpful? Give feedback.
-
Here's a working example of what you intended to do. Note that a import pyhf
new_optimizer = pyhf.optimize.scipy_optimizer(maxiter=1000000)
pyhf.set_backend(pyhf.tensorlib, new_optimizer)
model = pyhf.simplemodels.uncorrelated_background([5], [10], [2.5])
data = [15] + model.config.auxdata
test_mu = 1.0
result = pyhf.infer.hypotest(
test_mu, data, model, return_expected_set=True, return_tail_probs=True,
) |
Beta Was this translation helpful? Give feedback.
Here's a working example of what you intended to do. Note that a
hypotest
call will instantiate multiple optimizers (because it's not a single fit, but at least 5 separate fits using the specified optimizer).