{"id":28061839,"url":"https://github.com/rupt/interval-evidence","last_synced_at":"2025-05-12T10:29:59.333Z","repository":{"id":37250156,"uuid":"487860277","full_name":"Rupt/interval-evidence","owner":"Rupt","description":"Abandoned. HEP is fine without. Calculate probabilities with interval methods.","archived":false,"fork":false,"pushed_at":"2022-11-06T19:27:51.000Z","size":72954,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-04T15:02:55.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rupt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-02T13:42:57.000Z","updated_at":"2023-02-11T15:45:28.000Z","dependencies_parsed_at":"2023-01-21T04:02:50.834Z","dependency_job_id":null,"html_url":"https://github.com/Rupt/interval-evidence","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rupt%2Finterval-evidence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rupt%2Finterval-evidence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rupt%2Finterval-evidence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rupt%2Finterval-evidence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rupt","download_url":"https://codeload.github.com/Rupt/interval-evidence/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253719638,"owners_count":21952852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-12T10:29:58.671Z","updated_at":"2025-05-12T10:29:59.325Z","avatar_url":"https://github.com/Rupt.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Likelihood intervals for ATLAS discovery regions\n\nUnfinished research project.\n\nWhere is my likelihood above this threshold?\u003cbr/\u003e\n_This project answers that question for likelihoods on signal yields\nafter integrating out background uncertainties._\n\nRe-interpreting ATLAS results for single-bin signal-plus-background \"discovery\"\nregions.\nATLAS amazingly publishes many of their complete models for these regions\nin pyhf format through HEPData.\n\nWe use those models to assign uncertain predictions (priors)\nin their single signal region bins.\nTo compute likelihoods on signal yields alone\n(independent of background variations)\nwe marginalize the background uncertainty.\n\nOur marginalization integrals average the Poisson likelihood on observed\ndata.\nThese integrals are computed by the `lebesgue` module, which bounds integrals\nof general unimodal (likelihood) functions over general (prior) measures.\n\nThe `discohisto` module interprets the ATLAS models and uses `lebesgue` to\nextract results.\n\n## to do\n- [x] Implement efficient integration.\n- [x] Extract models from HEPData.\n- [x] Uncertainty assignments: best fit\n- [x] Uncertainty assignments: maximum likelihood profile\n- [x] Uncertainty assignments: MCMC\n- [x] Assign limits.\n- [ ] Produce summary figures.\n- [ ] Write a paper.\n- [ ] Document usage scripts.\n\n\n# Use this software\n\nSetup: prepare and activate our virtual environment:\n\n```bash\nsource setup.sh\n\n```\n\n## Development\n\nAuto-format code:\n```bash\nmake fmt\n\n```\n\nRun tests:\n```bash\nmake test\n\n```\n\nClean up:\n\n```bash\nmake clean\n\n```\n\n## Reproduce results\n\nThis software goes to some length to unsure that the results are fully\nreproducible on hardware.\n\nHowever, the compilation phases are liable to generate semantically different\nfloating-point calculations when optimizing for different machines.\n\nDifferent numerical errors do not change the conclusions, but do\naccumulate to produce different Markov chains.\n\n### Prepare `pyhf` models and extract likelihood intervals:\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand shell script\u003c/summary\u003e\n\n```sh\nSEARCHES='\natlas_susy_1Lbb_2020\natlas_susy_1Ljets_2021\natlas_susy_2hadtau_2020\natlas_susy_2L0J_2019\natlas_susy_2Ljets_2022\natlas_susy_3L_2021\natlas_susy_3Lresonance_2020\natlas_susy_3LRJmimic_2020\natlas_susy_3Lss_2019\natlas_susy_4L_2021\natlas_susy_compressed_2020\natlas_susy_DVmuon_2020\natlas_susy_hb_2019\natlas_susy_jets_2021\n'\n\n# Download and prepare HEPData serialized workspaces.\nfor search in ${SEARCHES}\ndo\n    ./searches/${search}/make_workspaces.sh\ndone\n\n# Extract single-region workspaces for our discovery regions.\n# Outputs searches/*/*/region.json.gz\nfor search in ${SEARCHES}\ndo\n    python searches/${search}/dump_regions.py\ndone\n\n# Fits extract properties of the pyhf models from which we later assign\n# background predictions with uncertainty.\n\n# Extract fits with best fitting strategies (cabinetry, normal, profile)\n# Outputs searches/*/*/fit/{normal,cabinetry,cabinetry_post,linspace}.json\nfor search in ${SEARCHES}\ndo\n    { time python searches/${search}/dump_fits.py ; } |\u0026 tee log/dump_fits_${search}.log\ndone\n\n# Extract maxima with constant added signal yields.\n# (This is more similar to current practice, but not so relevant.)\n# Outputs searches/*/*/fit/signal.json\nfor search in ${SEARCHES}\ndo\n    { time python searches/${search}/dump_fit_signal.py ; } |\u0026 tee log/dump_fit_signal_${search}.log\ndone\n\n# Extract histograms with MCMC (Markov Chain Monte Carlo) sampling. (SLOW!)\n# We use up to ${NPROCESSES} CPU threads with Jax pmap parallelism.\n# Outputs searches/*/*/fit/mcmc_*.json\n# where * depends on the MCMC strategy employed.\nexport NPROCESSES=15\nfor search in ${SEARCHES}\ndo\n    { time python searches/${search}/dump_fit_mcmc.py ; } |\u0026 tee log/dump_fit_mcmc_${search}.log\ndone\n\n# Assign probabilities from the fits and data in models and scan marginal\n# likelihoods and assign upper limits at various levels.\n# Outputs searches/*/*/fit/limit/scan_*_{central,up,down,observed}.json\n# where * names the fit used and {central,up,down,observed} are variations on\n# the data. Observed is integer Poisson, others are real interpolated Poisson\n# using lebesgue.likelihood.gamma1.\nfor search in ${SEARCHES}\ndo\n    { time python searches/${search}/dump_limits.py ; } |\u0026 tee log/dump_limits_${search}.log\ndone\n\n```\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupt%2Finterval-evidence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frupt%2Finterval-evidence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupt%2Finterval-evidence/lists"}