I am fairly new to ROOT and wanted to minimise a function using the PyROOT framework, but don’t really know where to begin. I have stumped upon the TMinuit and Math.Minimizer classes, but there are very few tutorials available (or at least I haven’t found them), and I’m not sure if one has better performance / is more commonly used today. Any hints and recommendations would be appreciated!
The recommended way to minimise a function is to use the ROOT.Math.Minimizer class. There is this tutorial, ROOT: tutorials/fit/NumericalMinimization.C File Reference, but it is in C++. If you have issues translating it in Python, please let me know, I can provide that example also in Python
Hi @moneta, I was looking at your code, and wanted to point out two possible typos:
(1) In line 37 I think you mean MinimizerName
(2) In line 76 you perhaps mean if ( ret and abs(minimizer.MinValue()-f(xs)) < 1.E-4 ) :, so that you take the difference between the two minimum values instead of the values themselves, no?