Summary
For models where a sample in a given channel is affected by multiple modifiers of the same type with the same name, only one of the modifiers is kept and the rest is silently dropped.
I am not sure if support for this is in scope of HistFactory. There is one natural way I see to handle such cases, which is to handle the automatic combination at the modifier level (normsys compose multiplicatively, histosys additively). A two-NP model with both NPs evaluated at +1 should predict the same distribution as a one-NP model with that NP evaluated at +1. With a distinction between modifiers and parameters controlling them, that would be equivalent to keeping both modifiers and equating the parameters.
If out of scope, I think such cases need to raise an error as the current behavior could easily be missed.
Use case example: I ran into this in a scenario where object calibrations are correlated and separate variations are produced but then are recommended to be correlated. Users could combine histograms externally, but the most natural idea was to just do it within the model.
somewhat related: #1830
OS / Environment
Steps to Reproduce
import pyhf
spec = {
"channels": [
{
"name": "SR",
"samples": [
{
"data": [50],
"modifiers": [
{
"data": {"hi": 1.2, "lo": 0.8},
"name": "np1",
"type": "normsys"
},
{
"data": {"hi": 1.3, "lo": 0.7},
"name": "np1",
"type": "normsys"
}
],
"name": "sample"
}
]
}
],
"measurements": [
{
"config": {"parameters": [], "poi": ""},
"name": "test"
}
],
"observations": [{"data": [50], "name": "SR"}],
"version": "1.0.0"
}
ws = pyhf.Workspace(spec)
model = ws.model()
print(model.expected_data([1.0], include_auxdata=False))
File Upload (optional)
No response
Expected Results
[78.] (1.2 * 1.3 * 50) or raising an error
Actual Results
pyhf Version
Code of Conduct
Summary
For models where a sample in a given channel is affected by multiple modifiers of the same type with the same name, only one of the modifiers is kept and the rest is silently dropped.
I am not sure if support for this is in scope of HistFactory. There is one natural way I see to handle such cases, which is to handle the automatic combination at the modifier level (
normsyscompose multiplicatively,histosysadditively). A two-NP model with both NPs evaluated at +1 should predict the same distribution as a one-NP model with that NP evaluated at +1. With a distinction between modifiers and parameters controlling them, that would be equivalent to keeping both modifiers and equating the parameters.If out of scope, I think such cases need to raise an error as the current behavior could easily be missed.
Use case example: I ran into this in a scenario where object calibrations are correlated and separate variations are produced but then are recommended to be correlated. Users could combine histograms externally, but the most natural idea was to just do it within the model.
somewhat related: #1830
OS / Environment
n/aSteps to Reproduce
File Upload (optional)
No response
Expected Results
[78.](1.2 * 1.3 * 50) or raising an errorActual Results
[65.]pyhf Version
HEADCode of Conduct