Multidimensional fit with Fumili

Dear Rooters,

I’ve found example of using Fumili (exampleFumili.C)

I’ll be very thankful if you can help me to have the similar code (with Fumili) for case of multidimentional minimizing function (in my case function depends on x[0],…x[9]).

Thank you in advance,
Best regards,
Marina Golubeva

Take a look at your /tutorials/fit directory.
There are a lot of such examples (see myfit.C etc…)
To change default fitter i used this line:


The quoted example for minimization using Fumili already is for a multi-dimensional objective function. You are fitting 2 parameters, so the function is bi-dimensional.
If you want an example for fitting using a multi-dimensional observables (not parameters), for example fitting a Tree with 9 variable, the quoted example can be early extended to this. I can do this if you want.

Also, if you are just fitting a multi-dimensional ROOT object (for example a TH2 or TH3 or TGraph2D) using a
TF2 or TF3, you can simply use Fumili as suggested by the above post:


that is the same as doing


Best Regards

Dear Lorenzo,

We’ve changed in your code exampleFumili.C the fitting function of TF1 class
MyChi2Function(int npoint, TF1 * modelFunc, const double *x, const double *y, const double * ey ) :

to function of class ROOT::Math::Functor :

MyChi2Function(int npoint, ROOT::Math::Functor modelFunc, const double *x, const double *y, const double * ey ) :

and it works fine. Functor now points to f(double[6]), we have 3 observables and 3 parameters (can be changed to any number).

Of course if possible we’d like to have the example of fitting a Tree with 9 variables (with Fumili with a customized objective function).

Thank you in advance,
Best regards,