Skip to content

Commit

Permalink
remove old way to calulate post fit bin by bin uncertainty
Browse files Browse the repository at this point in the history
  • Loading branch information
welschma committed Mar 11, 2021
1 parent 227df5a commit 66a23a0
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions templatefitter/templates/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,31 +308,6 @@ def plot_post_fit_stacked_on(self, ax, result_params, **kwargs):
stacked=True,
)

# uncertainties_sq = [
# (
# template.fractions(template.nui_params)
# * result_params[f"{name}_yield"][1]
# )
# ** 2
# for name, template in self._template_dict.items()
# ]
if self._dim > 1:
raise NotImplementedError(
"Plotting for hihger dimensions is not implemented yet"
)

# total_uncertainty = np.sqrt(np.sum(np.array(uncertainties_sq), axis=0))
# print(total_uncertainty)

jac = nd.Jacobian(self.bin_counts_from_param_values)(result_params.values)
total_uncertainty = np.array(
[
np.sqrt(jac[i] @ result_params.covariance @ np.transpose(jac[i]))
for i in range(self.num_bins)
]
)
# print(total_uncertainty)

post_fit_cov = self.propagate_parameter_uncertainties(result_params)
total_uncertainty = np.sqrt(np.diag(post_fit_cov))
total_bin_count = np.sum(np.array(bin_counts), axis=0)
Expand Down

0 comments on commit 66a23a0

Please sign in to comment.