Skip to content
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

Inconsistent results with signal uncertainties #37

Closed
1 task done
jackaraz opened this issue Feb 14, 2024 · 0 comments · Fixed by #38
Closed
1 task done

Inconsistent results with signal uncertainties #37

jackaraz opened this issue Feb 14, 2024 · 0 comments · Fixed by #38
Assignees
Labels
bug Something isn't working simplified likelihoods simplified likelihood interface related issues

Comments

@jackaraz
Copy link
Member

System Settings

Name: spey
Version: 0.1.7
Summary: Smooth inference for reinterpretation studies
Home-page: https://github.com/SpeysideHEP/spey
Author: Jack Y. Araz
Author-email: [email protected]
License: MIT
Requires: autograd, numpy, requests, scipy, semantic_version, tqdm
Required-by: spey-pyhf

Platform info:            macOS-14.2.1-arm64-arm-64bit
Python version:           3.9.18
Numpy version:            1.23.5
Scipy version:            1.10.0
Autograd version:         1.5
tqdm version:             4.65.0
semantic_version version: 2.10.0

Installed backend plug-ins:

- pyhf (spey-pyhf-0.1.4)
Name: spey-pyhf
Version: 0.1.4
Summary: pyhf plugin for spey interface
Home-page: https://github.com/SpeysideHEP/spey-pyhf
Author: Jack Y. Araz
Author-email: [email protected]
License: MIT
Requires: pyhf, spey
Required-by: 

- pyhf.simplify (spey-pyhf-0.1.4)
- pyhf.uncorrelated_background (spey-pyhf-0.1.4)
- default_pdf.correlated_background (spey-0.1.7)
- default_pdf.effective_sigma (spey-0.1.7)
- default_pdf.poisson (spey-0.1.7)
- default_pdf.third_moment_expansion (spey-0.1.7)
- default_pdf.uncorrelated_background (spey-0.1.7)

Describe the bug

Exclusion limits with signal uncertainties should be looser, but they are higher.

Thanks to @sabinekraml for pointing this issue out.

Source code

pdf_wrapper = spey.get_backend("default_pdf.uncorrelated_background")
statistical_model = pdf_wrapper(
    signal_yields=[12.0, 15.0],
    background_yields=[50.0,48.0],
    data=[36, 33],
    absolute_uncertainties=[12.0,16.0],
    signal_uncertainty_configuration={"absolute_uncertainties":[3,4]},
    analysis="example",
    xsection=0.123,
)

print(f"1 - CLs: {statistical_model.exclusion_confidence_level()[0]:.5f}")
print(f"POI upper limit: {statistical_model.poi_upper_limit():.5f}")

# 1 - CLs: 0.99563
# POI upper limit: 0.51504

pdf_wrapper = spey.get_backend("default_pdf.uncorrelated_background")
statistical_model = pdf_wrapper(
    signal_yields=[12.0, 15.0],
    background_yields=[50.0,48.0],
    data=[36, 33],
    absolute_uncertainties=[12.0,16.0],
    #signal_uncertainty_configuration={"absolute_uncertainties":[3,4]},
    analysis="example",
    xsection=0.123,
)
print(f"1 - CLs: {statistical_model.exclusion_confidence_level()[0]:.5f}")
print(f"POI upper limit: {statistical_model.poi_upper_limit():.5f}")

# 1 - CLs: 0.97018
# POI upper limit: 0.85633

Tracebacks

No response

Expected behaviour

When signal uncertainties are added, the $\chi^2$ distribution should get wider, but it's getting narrower instead. This might be due to the scaling of the constraint term.

Additional information

No response

Existing GitHub issues

  • I have searched existing GitHub issues to make sure the issue does not already exist.
@jackaraz jackaraz added the bug Something isn't working label Feb 14, 2024
@jackaraz jackaraz self-assigned this Feb 14, 2024
@jackaraz jackaraz added the simplified likelihoods simplified likelihood interface related issues label Feb 14, 2024
@jackaraz jackaraz linked a pull request Feb 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working simplified likelihoods simplified likelihood interface related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant