Speaker
Description
Statistical procedures at the end stages of analysis such as hypothesis testing. likelihood scans, and pull plots are currently implemented across multiple Python packages, yet lack interoperability despite performing similar functions once the log-likelihood is constructed. We present a contribution to HEPStats of the Scikit-HEP ecosystem to provide a common interface for these final stages of analysis. Any combination of log-likelihood and parameter objects adhering to a minimal interface becomes compatible with HEPStats and gains access to a comprehensive suite of tools supporting both frequentist and asymptotic inference. Internally, generality is achieved through being able to handle model parameters and data provided in nearly arbitrary python data structures. We introduce a novel approach by representing these structures as PyTrees, enabling automatic traversal, fitting, and tracking of parameters of interest without requiring custom logic for each data type. Any nesting of common python objects such as lists, dicts, and NamedTuples are recognized natively as PyTrees, and additional types can be internally registered to extend functionality without sacrificing generality. These tree operations are efficiently implemented using the optree package, offering performance benefits over manual traversals. The talk will demonstrate how this approach streamlines statistical inference in HEP statistical workflows and its implementation with PyTrees.