Skip to content

Access modifier values #1735

Answered by alexander-held
ssaha1234 asked this question in Q&A
Dec 17, 2021 · 4 comments · 10 replies
Discussion options

You must be logged in to vote

Hi Shreya, what do you mean by "values of the modifiers"? Here is an example for how to access the constraint term width:

import pyhf

model = pyhf.simplemodels.uncorrelated_background([6], [9], [3])

for parameter in model.config.par_order:
    print(f"parameter {parameter} has type {dict(model.config.modifiers)[parameter]}")
    if model.config.param_set(parameter).constrained:
        print(f"  width of parameter: {model.config.param_set(parameter).width()}")

This might be useful for staterror pruning.

A nice (and I think quite general) approach may be using model._modifications, but I cannot comment much on that since I have not tried it yet. See #1652 and validate_systs.py.

A more co…

Replies: 4 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ssaha1234
Comment options

You must be logged in to vote
8 replies
@ssaha1234
Comment options

@alexander-held
Comment options

@ssaha1234
Comment options

@alexander-held
Comment options

@ssaha1234
Comment options

Comment options

You must be logged in to vote
1 reply
@alexander-held
Comment options

Comment options

You must be logged in to vote
1 reply
@alexander-held
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants