-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Treating arbitrarily correlated parameters with pyhf #2463
Comments
I think it would be useful to add this under hist1 = np.array([2. , 3., 6., 8., 7., 7., 6., 2., 3., 1.])
hist2 = np.array([3. , 6., 9., 12., 15., 9., 6., 3., 3., 2.]) How do I know what the resulting fully-correlated histogram should look like under Also from a naive look through, my guess is we want to use |
I need to have a more detailed look, am I understanding correctly that this effectively defines new uncorrelated parameters? When reading this issue I at first expected multi-dimensional Gaussian constraint terms to model covariances, but I think this goes the opposite direction and defines pyhf-compatible uncorrelated parameters from correlated input. |
@kratsg As you say, I am using PCA to transform the correlated variables to an equal number of uncorrelated ones. For each of the uncorrelated variables, I determine the corresponding shift and add this as a new modifier. For two fully correlated variables, only one new modifier is added with the sum of the up/down variations (in the The shifts are calculated here: Does that answer your question?
Good point, we should align it with how correlations are treated in HS3. The other, simple solution, would be to just take the decorrelated spec, which is completely
Do you mean replacing the
I have added some tests here: @alexander-held Exactly, I am transforming and adding new uncorrelated parameters. The reason I opted for this, is that it is a simple pre-processing step, and it is non-invasive to the actual pyhf/HistFactory model. What would the benefit of multivariate constraint terms, apart from the interpretability of the resulting modifier parameters (which is partially lost in my approach)? |
Summary
So far, pyhf does not have the option to arbitrarily correlate modifier parameters. I have seen multiple workarounds implemented for Belle II analyses (and maybe also other places).
It was requested from the Belle II community, that I create a small extension package to pyhf, which lets you include arbitrary correlations between parameters:
https://github.com/lorenzennio/pyhfcorr
I have also added an example notebook here:
https://github.com/lorenzennio/pyhfcorr/blob/main/examples.ipynb
Would there be interest to merge this either into pyhf or cabinetry (@alexander-held), or should this just be kept as a standalone package?
Additional Information
Code of Conduct
The text was updated successfully, but these errors were encountered: