Minuit2 Machine Accuracy Limit Reached

When trying to fit my 2D histogram using RooFit I cannot get the fit to converge. I get the following error:

Info in : VariableMetricBuilder: Stop the minimization - reached machine accuracy limit
Info in : Edm is smaller than machine accuracy : machineLimit = 0.0464087
Info in : Current Edm is : edm = 0.00333633
Info in : Required Edm is : edmval = 0.001

After looking into this error I saw that one way around this is to raise the tolerance by running Minuit2 directly with RooMinuit::setEps(Double_t eps)
But I am new to RooFit and have been using the fitTo function:

GJfit = simpdf.fitTo(obs,
                          ROOT.RooFit.Extended(True),
                          ROOT.RooFit.SumW2Error(True),
                          ROOT.RooFit.Strategy(2),
                          ROOT.RooFit.Save(),
                          ROOT.RooFit.Minimizer('Minuit2', 'migrad'),
                          ROOT.RooFit.PrintLevel(1),
                          )

In order to perform my fit. Is there a way to change the tolerance of the fit for the fitTo function or do I need to learn how to use Minuit2 directly?

Hi,

You can change the tolerance in RooFit only if you use the RooMinimizer interface for fitting instead of fitTo. You need to create the RooNLLVar object using RooAbsPdf::createNLL and then create the RooMinimizer class.

However the problem is probably caused by a numerical error in evaluating your likelihood.
You can try to mitigate it by using the option Offset(true) or a better parametrisation of your model causing less numerical error. Also be sure you are using everywhere double precision and not floats. If your model contains histograms make sure you are using TH1D objects instead of TH1F

Best regards

Lorenzo

Thanks, adding the Offset(true) fixed the issue

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