pyhf

Pyhf logo with the words "differentiable likelihoods"

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

Presentations

A full list of presentations on pyhf are listed in the documentation. Recent presentations of interest include:

Publications

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