Skip to content

Commit

Permalink
added check to covmats
Browse files Browse the repository at this point in the history
  • Loading branch information
comane committed Jun 8, 2023
1 parent 7751162 commit 13896bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions validphys2/src/validphys/covmats.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
check_data_cuts_match_theorycovmat,
check_dataset_cuts_match_theorycovmat,
check_norm_threshold,
check_pdf_is_montecarlo,
check_pdf_is_montecarlo_or_symmhessian,
check_speclabels_different,
)
from validphys.commondata import loaded_commondata_with_cuts
Expand Down Expand Up @@ -677,6 +677,7 @@ def groups_corrmat(groups_covmat):
return mat


@check_pdf_is_montecarlo_or_symmhessian
def pdferr_plus_covmat(dataset, pdf, covmat_t0_considered):
"""For a given `dataset`, returns the sum of the covariance matrix given by
`covmat_t0_considered` and the PDF error:
Expand Down Expand Up @@ -733,7 +734,7 @@ def pdferr_plus_covmat(dataset, pdf, covmat_t0_considered):
X = hessian_eigenvectors - central_predictions.reshape((central_predictions.shape[0], 1))
# need to rescale the Hessian eigenvectors in case the eigenvector confidence interval is not 68%
X = X / rescale_fac
pdf_cov = np.einsum("ij,kj->ik", X, X)
pdf_cov = X @ X.T

return pdf_cov + covmat_t0_considered

Expand Down

0 comments on commit 13896bf

Please sign in to comment.