Accelerate fitting

Hi,

is there a way to accelerate fitting? I’ve to read in a lot of measure points for each observable and to do three fits each time (TH1) to gain a certain point. In case of about 1-5k observables this takes about 5-15mins.

Speeding up fitting to a Landau distribution did not change anything. Maybe I did it wrong I put the two lines just before main().

Can somebody please help? Thank you!

Hi,
as a start, you should definitely put

ROOT::Math::MinimizerOptions::SetDefaultStrategy(0);
ROOT::Math::MinimizerOptions::SetDefaultTolerance(10);

inside main()

1 Like

Thank you! But this doesn’t affect anything.

In this case we need the help of someone that’s more of an expert than me: @xavi @moneta

Hi, Progressive.

I may have good news for you in a couple of days if:

  1. You’re on the master.
  2. You’re fitting with: Chi2, Unbinned or binned likelihood but not doing gradient computations or using the integral, binvolume options.

Ping me if you’re interested. If not, @moneta may have some other idea.

1 Like

Hi, thank you for your answer!

What do you mean by master? I’m working on my personal computer (quad core).

Unfortunately not. I use some exponential and polynom functions. Not sure if this is the correct answer. Otherwise I do not know in detail how the fitting is done (how do I?).

The “master” is the development version of ROOT … the most recent version you can find.

As Olivier said the master is the development version you can find here: https://github.com/root-project/root

Can you show me some code? At least the fitting related part.

The “master” version is working faster?

The fitting part is just:

TF1* fit_raw = new TF1("Raw data fit", "pol2",certain_data_points_Ubias[1],certain_data_points_Ubias[3]);
fit_raw->SetParameter(0, 380.0);
fit_raw->SetParameter(1, 1.2);
fit_raw->SetParameter(2, 1.0);
fit_raw->SetParameter(3, 0.03);
fit_raw->SetParLimits(3, 1e-9, 10.0 );

or something similar. I read in several devices with two sets of about 30-50 data points each and directly fit them. In case of 100, 200 it becomes significant slow. Upper limit will be about 5k devices, bust mostly just 2k.

I’m missing the part where you actually call the fit in there :slight_smile:

That’s only the creation of the TF1 and the parameter settings.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.