# Negative minNll

**URL:** <https://root-forum.cern.ch/t/negative-minnll/64286>\
**Category:** Roofit and RooStats\
**Created:** [October 6, 2025, 1:20pm UTC](https://root-forum.cern.ch/t/negative-minnll/64286 "2025-10-06T13:20:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anikiten](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@anikiten](https://root-forum.cern.ch/u/anikiten)\
**Post date:** [October 6, 2025, 1:20pm UTC](https://root-forum.cern.ch/t/negative-minnll/64286/1 "2025-10-06T13:20:22Z")

</div>

Dear experts,

I guess I am asking very stupid question, but I have to understand it.

I print NLL from RooFit as r→minNll, where r is from RooFitResult\* r = model.FitTo(….

I get negative value, for example for S+B fit I got -11254.9 and for B only fit I got -11250.2.

I say then that S+B fit is better than B fit. But why ? The smaller NLL the smaller probability of describing data. So, B fit is better describes data than S+B… The Log likelihood function is always negative, right ? since p\_i for each event/bin is less than 1.

What I do not understand ?

Thanks, Sasha.

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [October 6, 2025, 5:10pm UTC](https://root-forum.cern.ch/t/negative-minnll/64286/2 "2025-10-06T17:10:55Z")

</div>

Hi Sasha,

NLL stands for Negative Log Likelihood, see [ROOT: RooFitResult Class Reference](https://root.cern.ch/doc/master/classRooFitResult.html#affa82ac97ca3e3a43f0ab518a655fe66) .

Apart from that, I do not fully understand your statement

> The smaller NLL the smaller probability of describing data. So, B fit is better describes data than S+B

I do not know if the dataset you studied is contained or not signal, but in the case described above the S+B value is _smaller_ than the B value (-11254.9 VS -11250.2).

Cheers,  
D

---

<div class="post-metadata">

**Author:** ![anikiten](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@anikiten](https://root-forum.cern.ch/u/anikiten)\
**Post date:** [October 7, 2025, 8:26am UTC](https://root-forum.cern.ch/t/negative-minnll/64286/3 "2025-10-07T08:26:09Z")

</div>

Hi Danilo,

Sorry, my email was indeed confusing.

I hope attached plot with S+B and B only fit of Run II data  
will clarify my question.

Solid line is S+B fit, dashed line is B only fit. It is unbinned fit.

One can see that S+B fit better describes data than B only fit. However NLL(S+B)=-11254.9 is smaller than  
NLL(B)=-11250.2. In my understanding it should be other way around…

Cheers, Sasha.

> **(attachments)**
>
> [2018UL\_SR1\_Cheb3.pdf](https://root-forum.cern.ch/uploads/short-url/bOocMdSlXFzEUD5ep7fMV12LU15.pdf) (21.9 KB)

---

<div class="post-metadata">

**Author:** ![leonhard](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/94ad74/32.png) [@leonhard](https://root-forum.cern.ch/u/leonhard)\
**Post date:** [October 7, 2025, 8:46am UTC](https://root-forum.cern.ch/t/negative-minnll/64286/4 "2025-10-07T08:46:36Z")

</div>

Hi Sasha,

This statement from your first post is incorrect.

> [@anikiten](#):
>
> The smaller NLL the smaller probability of describing data.

As Danilo said

> [@Danilo](#):
>
> NLL stands for Negative Log Likelihood

So your smallest NLL corresponds to the highest likelihood.  
I would recommend you to look up how maximum likelihood fits work on Wikipedia or in a statistics book of your choice for more information.

Cheers,  
Leonhard

---

<div class="post-metadata">

**Author:** ![anikiten](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@anikiten](https://root-forum.cern.ch/u/anikiten)\
**Post date:** [October 7, 2025, 9:15am UTC](https://root-forum.cern.ch/t/negative-minnll/64286/5 "2025-10-07T09:15:40Z")

</div>

Hi Leonhard.

Thanks for responce !

Before I go to books, here is one comment:

Log Likelihood in my case of unbinned fit over m\_mumu is a sum of Ln (p\_i), where p\_i is a probability for event I to have a given m\_mumu.  
Since p\_i \< 1.0, Ln(p\_i) \< 0.0. Therefore sum of Logarithms is negative at the beginning. Therefore the smaller the sum the less compatibity  
with data. -10 is worse than -5.

Cheers, Sasha.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [October 21, 2025, 9:15am UTC](https://root-forum.cern.ch/t/negative-minnll/64286/6 "2025-10-21T09:15:57Z")

</div>

Closed on October 21, 2025, 9:15am UTC

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