Skip to content

Handling non-existent Hessian in fits with no free parameters with latest iminuit #2637

@alexander-held

Description

@alexander-held

iminuit v2.32.0 causes a change in behavior when "fitting" functions with no free parameters. Instead of reporting a Hessian with all zeros, the Hessian is no longer defined and the .correlation() call fails:

import pyhf

pyhf.set_backend("numpy", "minuit")
model = pyhf.simplemodels.uncorrelated_background(
signal=[10.0], bkg=[70.0], bkg_uncertainty=[10.0]
)
data = [80] + model.config.auxdata
pyhf.infer.mle.fit(data, model, fixed_params=[True, True])

->

[...]
  File "[...]/pyhf/src/pyhf/optimize/opt_minuit.py", line 141, in _minimize
    corr = hess_inv.correlation()
           ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'correlation'

Earlier versions of iminuit, such as 2.31.3, report the warning "IMinuitWarning: Hesse called with all parameters fixed" but still return a covariance matrix full of zeros. This special case should be handled in pyhf to avoid a runtime crash with the latest version.

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions