Linear Template Fit

I propose to add a new class to ROOT that implements the Linear Template Fit as described in Eur.Phys.J.C 82 (2022) 731 [arXiv:2112.01548].

The Linear Template Fit is an analytic expression for a maximum likelihood estimator in a uni- or multi-variate parameter estimation problem. It combines a linear regression with the analytic solution of a least squares expression. The best estimator is then just obtained from a simple matrix equation. The full implementation provides comprehensive opportunities for error propagation and cross checks, and also the Quadratic Template Fit.

The algorithm can be used for precision phenomenology, like the determination of the strong coupling constant (as in the paper), for top-quark mass determinations (CMS), or multivariate problems in performance critical cases, like MC tuning. Many more applications are thinkable. The Linear Template Fit offers the very unique opportunity for statistical inference with just a very minimal set of reference predictions, namely just n+1 for n free parameters, and it is therefore optimally suited for performance critical applications.

Thus, I believe, the algorithm would be useful for a broader community and would nicely complement the set of other statistics tools in ROOT.

There is a C++ implementation available on github, which has an interface to TH1D’s but uses EIGEN for matrix calculations.
For the ROOT implementation, I would suggest to re-implement the algorithm, using native ROOT linear algebra classes, and with a more user-friendly and ROOT-like user interface, and add some tutorials.

1 Like

Thank you for the proposal! @moneta what’s your take?

Dear Daniel,
Just for my understanding the following question. You suggest to re-implement the algorithms using the ROOT linear-algebra classes. What does that imply for future maintenance of this code. You are currently the expert of this code base, re-implementation will cause not completely trivial code changes. Will there then be two branches of code to maintain ?
best regards, Eddy

Dear Eddy, that’s indeed an important consideration. Indeed, yes, I would opt a full re-implementation of the algorithm within ROOT. One goal would be a high efficiency of the code according to available TMatrix functionality, and the second would be a more ROOT-style and user-friendly interface to facilitate the usage.
Of course, this decision would increase to the maintenance costs, but I believe, that the algorithm is fairly complete and no considerable new developments are to be expected. In addition, a second, independent, implementation is highly valuable for validation and cross checks, even more, since in such kind of linear algebra calculations implementation-bugs are often difficult to identify. In fact, for the initial public code, I had in addition a second (and in parts a third) implementation for cross checks. One even based on ROOT. Best wishes, Daniel