Negative log likelihood using root fitter and combinedFit.C

Hello Rooters,
I am trying to fit my data (combinedFit.C) and estimate the parameters using negative log-likelihood. The code runs but without finding the minimum values.
Before this I used the Chi-square and it worked fine.

Can you guys help me out with performing the negative log-likelihood ?

I attach a simple code which reads the text file and performs either chi-square [commented] or negative log likelihood (PoissonLLFunction).

data.txt (2.7 KB)
rate_fit.C (5.8 KB)

Thank you


I think @moneta can help.

1 Like

your code works if using Minuit instead of Minuit2 and

1 Like

You are right, Thank you. It works with Minuit.
The only problem that I have now is that the error bars are very high on each parameter. Do you know how to can reduce the error bars? I can try changing parameters to different values.

Errors of parameters are okey for the chi^2 fit, but are too big for
the likelihood fit. Maybe the ROOT experts know the reason.
In any case Iā€™d recommend to redefine your fit functions like this

TF1 *fexp1 = new TF1("fexp1", "[2]/86400.*exp(-x/[0])+[1]", 23,123);
TF1 *fexp2 = new TF1("fexp2", "[2]/86400.*exp(-x/[0])+[1]", 23,123);
1 Like

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