Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nnpdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emanuele Roberto Nocera
nnpdf
Commits
09dc4c87
Unverified
Commit
09dc4c87
authored
2 years ago
by
Zaharid
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1560 from NNPDF/fix_thcovmatchi2_inreport
Fixed chi2 with thcovmat in report
parents
672cd502
58a685b7
No related branches found
Branches containing commit
Tags
4.0.5
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
validphys2/src/validphys/covmats.py
+18
-3
18 additions, 3 deletions
validphys2/src/validphys/covmats.py
with
18 additions
and
3 deletions
validphys2/src/validphys/covmats.py
+
18
−
3
View file @
09dc4c87
...
...
@@ -534,10 +534,22 @@ def pdferr_plus_covmat(dataset, pdf, covmat_t0_considered):
pdf_cov
=
np
.
cov
(
th
.
error_members
,
rowvar
=
True
)
return
pdf_cov
+
covmat_t0_considered
def
reorder_thcovmat_as_expcovmat
(
fitthcovmat
,
data
):
"""
Reorder the thcovmat in such a way to match the order of the experimental covmat, which
means the order of the runcard
"""
theory_covmat
=
fitthcovmat
.
load
()
bb
=
[
str
(
i
)
for
i
in
data
]
tmp
=
theory_covmat
.
droplevel
(
0
,
axis
=
0
).
droplevel
(
0
,
axis
=
1
)
return
tmp
.
reindex
(
index
=
bb
,
columns
=
bb
,
level
=
0
)
def
pdferr_plus_dataset_inputs_covmat
(
data
,
pdf
,
dataset_inputs_covmat_t0_considered
):
def
pdferr_plus_dataset_inputs_covmat
(
data
,
pdf
,
dataset_inputs_covmat_t0_considered
,
fitthcovmat
):
"""
Like `pdferr_plus_covmat` except for an experiment
"""
# do checks get performed here?
if
fitthcovmat
is
not
None
:
#change ordering according to exp_covmat (so according to runcard order)
return
pdferr_plus_covmat
(
data
,
pdf
,
dataset_inputs_covmat_t0_considered
+
reorder_thcovmat_as_expcovmat
(
fitthcovmat
,
data
).
values
)
return
pdferr_plus_covmat
(
data
,
pdf
,
dataset_inputs_covmat_t0_considered
)
...
...
@@ -690,12 +702,15 @@ def _covmat_t0_considered(covmat_t0_considered):
return
covmat_t0_considered
def
_dataset_inputs_covmat_t0_considered
(
dataset_inputs_covmat_t0_considered
):
def
_dataset_inputs_covmat_t0_considered
(
dataset_inputs_covmat_t0_considered
,
fitthcovmat
,
data
):
"""
Helper function so we can dispatch the full
covariance matrix accross dataset_inputs, having considered both ``use_t0``
and ``use_pdferr``
"""
return
dataset_inputs_covmat_t0_considered
if
fitthcovmat
is
not
None
:
#change ordering according to exp_covmat (so according to runcard order)
return
dataset_inputs_covmat_t0_considered
+
reorder_thcovmat_as_expcovmat
(
fitthcovmat
,
data
).
values
return
dataset_inputs_covmat_t0_considered
groups_covmat_collection
=
collect
(
'
dataset_inputs_covariance_matrix
'
,
(
'
group_dataset_inputs_by_metadata
'
,)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment