pyhf: pure-Python implementation of HistFactory statistical models

Statistical analysis of High Energy Physics (HEP) data relies on quantifying the compatibility of observed collision events with theoretical predictions. The relationship between them is often formalised in a statistical model f(x|φ) describing the probability of data x given model parameters φ. Given observed data, the likelihood L(φ) then serves as the basis for inference on the parameters φ. For measurements based on binned data (histograms), the HistFactory family of statistical models (Cranmer et al., 2012) has been widely used in both Standard Model measurements (ATLAS Collaboration, 2013) as well as searches for new physics (ATLAS Collaboration, 2018). pyhf is a pure-Python implementation of the HistFactory model specification and implements a declarative, plain-text format for describing HistFactorybased likelihoods that is targeted for reinterpretation and long-term preservation in analysis data repositories such as HEPData (Maguire et al., 2017). The source code for pyhf has been archived on Zenodo with the linked DOI: (Heinrich, Lukas and Feickert, Matthew and Stark, Giordon, 2020). At the time of writing this paper, the most recent release of pyhf is v0.5.4.