Project collaborators
Lukas Heinrich, Department of Data Science for Physics, Technical University of Munich
Giordon Stark, Department of Physics, Santa Cruz Institute for Particle Physics, UC Santa Cruz
Matthew Feickert, Alexander Held, and Kyle Cranmer, Data Science Institute
Project start and end dates
This ongoing project began in January 2018
Project summary
Wow. THANK YOU. I can’t believe this actually exists. I’ve been waiting for a simple easy-to-use example since… forever. I went from zero to a result in 2 minutes, including installation time and in Python! I’m totally using this with all new students.
—Anonymous phyf user
pyhf is an open source, pure-Python library that implements statistical modeling and inference techniques commonly used in particle physics. The aim of the library is to make model building, inspection, use, and distribution easier for the broader particle physics community. pyhf supports modern computational graph libraries such as PyTorch and JAX in order to make use of features such as auto-differentiation and GPU acceleration.
pyhf implements the “HistFactory” statistical model, common in particle physics analyses at the Large Hadron Collider, for multi-bin, histogram-based analysis with interval estimation based on the asymptotic formulas from Asymptotic formulae for likelihood-based tests of new physics. pyhf supports modern computational graph libraries such as PyTorch and JAX in order to make use of features such as auto-differentiation and GPU acceleration. While it continues to be actively developed, it is used in production for physics analyses by the ATLAS collaboration at CERN, the Belle II Collaboration at KEK, the MicroBooNE collaboration at Fermilab, and by particle physics phenomenologists and theorists around the world.
Project outputs/deliverables
Software and data products
- The pyhf source code is open source on GitHub
- pyhf Documentation
- pyhf user guide and tutorials
- pyhf is distributed as a Python package on PyPI
- pyhf is distributed as a conda package on conda-forge
Presentations
A full list of presentations on pyhf are listed in the documentation. Recent presentations of interest include:
- Matthew Feickert. pyhf: pure-Python statistical fitting library with tensors and automatic differentiation. International Conference on High Energy Physics (ICHEP) 2022, Jul 2022.
- Matthew Feickert. Distributed statistical inference with pyhf powered by funcX. 20th Python in Science Conference (SciPy 2021), Jul 2021.
- Matthew Feickert. pyhf: a pure Python statistical fitting library with tensors and autograd. 19th Python in Science Conference (SciPy 2020), July 2020.
Publications
- Bayesian Methodologies with pyhf. M. Feickert, L. Heinrich and M. Horstmann, EPJ Web Conf. 295 06004 (2024) (29 Sep 2023).
- pyhf: a pure-Python statistical fitting library with tensors and automatic differentiation. M. Feickert, L. Heinrich and G. Stark, arXiv 2211.15838 (28 Nov 2022).
- Publishing statistical models: Getting the most out of particle physics experiments. K. Cranmer et. al., SciPost Phys. 12 037 (2022) (10 Sep 2021).
- Distributed statistical inference with pyhf enabled through funcX. M. Feickert, L. Heinrich, G. Stark and B. Galewsky, EPJ Web Conf. 251 02070 (2021) (03 Mar 2021).
- pyhf: pure-Python implementation of HistFactory statistical models. L. Heinrich, M. Feickert, G. Stark and K. Cranmer, J.Open Source Softw. 6 2823 (2021) (04 Feb 2021).
- Reproducing searches for new physics with the ATLAS experiment through publication of full statistical likelihoods. ATL-PHYS-PUB-2019-029 (05 Aug 2019).
One feature of the pyhf package that I really appreciate is that I can validate the limit-setting with RooStats by converting my json file into XML-root and run the same statistical tests and get the same limit. As this is a new tool, cross-check with RooStats is necessary and you made it very easy to do.
—Anonymous phyf user