# Minuit lnlikelihood

Hi,

Right now, I am using Minuit to minimize the distance between two histograms by using chi2. One of the histograms contain the experimental data, and the other is made of three different histograms each multiplied by a parameter and an exponential function. So, I have five parameters in total (3+2). My chi2 is defined as follows:

chi2 = sum over bins [pow(nctot[ibin] - nc_sum(par,ibin),2)/pow(nctot_error[ibin],2)]

where

nctot[ibin] = bin content of the histogram containing the experimental data
nc_sum(par,ibin)= my simulated histogram bin content defined as ncsum=par[0]*nc1[j]+par[1]*nc2[j]+par[2]*nc3[j]+par[3]*exp(-par[4]*x[j]);, nc1, nc2 and nc3 are the simulated histograms.

Then I am doing

TMinuit *min = new TMinuit(npar);
min->SetFCN(chi2)

and getting the parameters that minimize chi2.

As I have very low statistics, I wanted to see if the fits were better using a loglikelihood for FCN, but I am not sure about how it should be defined in my case. Any hint?

Regards,

Thanks!

Hi,

In order to use a likelihood you need to have a model to describe your observation. For example you have a Poisson model describing the observation in each bin of your histogram given some number of expected events in each bin.
The number of expected events is computed from your other histograms and your function.

Any statistical book for HEP is describing this and gives the exact formula to compute the likelihood. For example, you can look at chapter 2 of this book
eu.wiley.com/WileyCDA/WileyTitle … 10589.html

Best Regards

Lorenzo

Hi,

[code]void lnlikelihood(Int_t &npar, Double_t *gin, Double_t &result, Double_t *par, Int_t flg){

//binned likelihood (from loop over bins in histogram):

double bllh = 0.0;
for (int ibin=0; ibin < nbins; ibin++) {
double nexp = nc_sum(par,ibin);
double nobs = nctot[ibin];// content of a bin for the experimental histogram, which is cross section in mb
bllh += -2.0*log(TMath::Poisson(int(nobs), nexp));
}

result = bllh;
cout << result << endl;
}[/code]

The minimization seems to be minimizing properly, I see how “result” is becoming smaller with the iterations. But I am not happy with the result obtained, If I use “lnlikelihood” when the script finishes the minimization, the fit is looking good if you make zoom, but there is a factor between the fit and the experimental curve. This can be fixed by changing the limits of the parameters, but I don’t understand why these parameters are working fine for the minimization using chi2 and not for the likelihood. I was expecting to use the same limits for both of them because the parameters can not differ that much. I am doing the first tests with a case with quite good statistics I would say. Do you think the problem with the likelihood could be that I don’t have counts but cross section so the assumption of Poisson is not good?

Best regards

Hi,

Yes I was assuming the histogram contents are counts and therefore a Poisson distribution could be used. If they are not and they are normal distributed , then the chi2 is exactly equivalent to the Gaussian likelihood.
If they are something else, you should use their appropriate distributions

Cheers

Lorenzo

ok.

Thanks!