Multidimensional fit with Fumili

Dear Rooters,

I’ve found example of using Fumili (exampleFumili.C)
root.cern.ch/phpBB2/viewtopic.php?t=7821

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

Marina,
Take a look at your /tutorials/fit directory.
root.cern.ch/root/html/tutorials/fit/index.html
There are a lot of such examples (see myfit.C etc…)
To change default fitter i used this line:
(TVirtualFitter::GetFitter())->SetDefaultFitter(“Minuit2”);

Hi,

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:

TVirtualFitter::SetDefaultFitter("Fumili")

that is the same as doing

ROOT::Math::MinimizerOptions::SetDefaultMinimizer("Fumili")

Best Regards
Lorenzo

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,
Marina