pyhf: add staterror config to spec to have faithful roundtrip
Description
we should add staterrorconfig
as a channel property. Currently most analyses use Poisson
as the config, which is not the default and thus needs to be specificed in the XML.
Converting XML -> JSON -> XML loses this information since we never record this non-default value in the JSON and thus cannot reproduce the original XML
during parsing, the staterrorconfig should become a value in the paramsets used by the staterror modifier.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 15 (11 by maintainers)
hi, i appreciate the discussion here. we do generally have limited time and I do think this is prioritized enough that we want to make sure it gets into the upcoming major release. What I propose we’ll do (I have not discussed this with the core developers) is to support a user-friendly interface through
pyhf
in our next major release as this will change the API minimally, but allows for that support.That said, it is possible to make this functional today in your existing code like so:
and this seems to work in being able to change things on a global-level (which I propose that
pyhf
supports primarily):This does also allow you to change constraints for other modifier types in a global way in a similar fashion …
To summarize
pyhf
should support a global configuration forstaterror
constraint type (at least functionally in the code) which is an API changeminor
release can expand thev1.0.0
HiFa JSON specification to allow for this to be serializablestaterror
constraint should switch toPoisson
to match ROOT 6.22+Maybe to be practical, I think there are multiple aspects to this:
Changing the default without implementing a way to switch behavior might not be ideal, as it will change the results of people who are used to the Gaussian setup. I think it might be possible to make this configurable though without already involving the JSON spec, and only do so in a separate step (assuming that this is maybe easier to make some partial progress). The natural way to configure this to me would be
pyhf.Workspace.model
via themodifier_settings
kwarg, which already takes the interpolation codes fornormsys
andhistosys
, and could take anotherstaterror
key with something like{"constraint": "poisson"}
or{"constraint": "gaussian"}
as possible values.