Skip to content

Commit

Permalink
adjust to ignore zeroing out corr/cov for minuit, since it already ha…
Browse files Browse the repository at this point in the history
…ndles this
  • Loading branch information
phinate committed Aug 14, 2023
1 parent b48e544 commit 4ebf3e5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pyhf/optimize/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ def _internal_postprocess(
cov = hess_inv

# we also need to edit the covariance matrix to zero-out uncertainties!
if fixed_vals is not None:
if using_minuit:
fixed_bools = fitresult.minuit.fixed
else:
fixed_bools = [False] * len(init_pars)
if fixed_vals is not None and not using_minuit: # minuit already does this
fixed_bools = [False] * len(init_pars)
# Convert fixed_bools to a numpy array and reshape to make it a column vector
fixed_mask = tensorlib.reshape(
tensorlib.astensor(fixed_bools, dtype="bool"), (-1, 1)
Expand All @@ -158,7 +155,7 @@ def _internal_postprocess(
tensorlib.astensor(0.0),
)

if correlations_from_fit is not None:
if correlations_from_fit is not None and not using_minuit:
_zeros = tensorlib.zeros(num_fixed_pars)
# possibly a more elegant way to do this
stitched_columns = [
Expand Down

0 comments on commit 4ebf3e5

Please sign in to comment.