# Extended Likelihood Question of ROOFIT

**URL:** <https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786>\
**Category:** Roofit and RooStats\
**Tags:** root\
**Created:** [April 10, 2026, 4:49am UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786 "2026-04-10T04:49:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gao](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@Gao](https://root-forum.cern.ch/u/Gao)\
**Post date:** [April 10, 2026, 4:49am UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786/1 "2026-04-10T04:49:20Z")

</div>

Hi, everyone,

I have a basic question about extended likelihood used in “fitTo“ in ROOFIT like this.

```auto
model.fitTo(data, Extended(kTure), Save());

```

I understand this extended means there is a Poisson distribution multiplied to regular likelihood function. From source code, maybe use Poisson from expected total number and put observed events to this Poisson to get a extra constrain from Line 752 of this websit:

> **[ROOT: roofit/roofitcore/src/RooAbsPdf.cxx Source File](https://root.cern.ch/doc/master/RooAbsPdf_8cxx_source.html)**

My question is: why not we use Poisson distribution of observed event number, and take expected total number into this distribution as a extra constrain? And what’s the difference of these two opinions?

Thank you in advance!

Best Regards!

---

<div class="post-metadata">

**Author:** ![devajith](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/devajith/32/37165_2.png) [@devajith](https://root-forum.cern.ch/u/devajith)\
**Post date:** [April 10, 2026, 7:44am UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786/2 "2026-04-10T07:44:28Z")

</div>

Hi @Gao,

Thank you for your question. I’m sure @jonas will be able to help you.

Cheers,

Dev

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [April 10, 2026, 9:30am UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786/3 "2026-04-10T09:30:46Z")

</div>

Hi, thanks for the question!

> My question is: why not we use Poisson distribution of observed event number, and take expected total number into this distribution as a extra constrain?

I don’t see how this is different from what is done already 😃 Maybe you mean to do the same with a different interface? Can you maybe show some code sketch about how you would expect these two options to look like and differ? Maybe I understand better what you mean then.

Cheers,  
Jonas

---

<div class="post-metadata">

**Author:** ![Gao](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@Gao](https://root-forum.cern.ch/u/Gao)\
**Post date:** [April 10, 2026, 10:34am UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786/4 "2026-04-10T10:34:00Z")

</div>

Hi, firstly, thanks for devajith’s kind reminder and your generous help.

To be clear, I can show the formulas directly. The ROOFIT may use the extended likelihood as this

LL=\mathrm{Pois}(n\_{obs}; n\_{s}+n\_{b})\times \mathrm{PDF}\_{\mathrm{total}}=\frac{(n\_{s}+n\_{b})^{n\_{obs}}e^{-(n\_{s}+n\_{b})}}{n\_{obs}!}\times \mathrm{PDF}\_{\mathrm{total}}

This is what we learn from some textbook. Then I wonder why not use this LL instead?

LL’=\mathrm{Pois}(n\_{s}+n\_{b}; n\_{obs})\times \mathrm{PDF}\_{\mathrm{total}}=\frac{n\_{obs}^{(n\_{s}+n\_{b})}e^{-n\_{obs}}}{(n\_{s}+n\_{b})!}\times \mathrm{PDF}\_{\mathrm{total}}

Maybe these two LLs would have some differences in some cases?  
Thanks for your generous help again.

Cheers,

Gao

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [April 10, 2026, 11:53am UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786/5 "2026-04-10T11:53:39Z")

</div>

Okay I see what you mean! The second formula is indeed not correct. The [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution) is not symmetric under the exchange of the parameter and the observable, so mathematically your two options are not equivalent.

The first formula is correct. For the likelihood, you are interested in the probability of n\_{obs} as a function of your model parameter, which is here n\_s + n\_b.

---

<div class="post-metadata">

**Author:** ![Gao](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@Gao](https://root-forum.cern.ch/u/Gao)\
**Post date:** [April 10, 2026, 1:22pm UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786/6 "2026-04-10T13:22:25Z")

</div>

Thanks for your kind explanation! In addition, I have two following doubts.

One is what’s the solution that we should use extended likelihood? I think I only use it when I need to fit the mass distribution to get signal yields and when we perform pwa fit or polarization parameter fit, I think simple likelihood used in fact? Maybe I am wrong?

Another is that we are facing this case:  
Step1, we fit a mass distribution with extended likelihood from ROOFIT and scan n\_{s} to get a \mathrm{PDF}\_{n\_{s}}. We have many kinds of samples (\mathrm{sample}\_{1}~...~\mathrm{sample}\_{k}) and get these \mathrm{PDF}^{1}\_{n\_{s}}~...~\mathrm{PDF}^{k}\_{n\_{s}}. At the same time, we can also set n\_{s} to be free and get the fitted mean value (n\_{s~1}^{\mathrm{max}},...,n\_{s~k}^{\mathrm{max}}) with the maximum extended likelihood.  
Step2, we have some physical variables (\theta\_{1}~...~\theta\_{m}) and can get n^{i}\_{\theta} with a function n^{i}\_{\theta}=f\_{i}(\theta\_{1},...,\theta\_{m}), then how should we construct the likelihood? We have three methods:

Method 1: Likelihood: L=\prod\_{i=1}^{k}\mathrm{PDF}^{i}\_{n\_{s}}(n^{i}\_{\theta}).  
Method 2: Extended Likelihood like ROOFIT: L=\prod\_{i=1}^{k}\mathrm{Pois}(n^{\mathrm{max}}\_{s~i};n^{i}\_{\theta})\mathrm{PDF}\_{n\_{s}}^{i}(n\_{\theta}^{i})  
Method 3: L=\prod\_{i=1}^{k}\mathrm{Pois}(n\_{s~i}^{\mathrm{max}};n\_{\theta}^{i})

Whether we still need to use extended likelihood or not? Maybe \mathrm{PDF}^{i}\_{n\_{s}} has taken account into the extended Poisson contribution in step 1 and should use simple likelihood?

Many thanks for your generous answer again!

Best Regards!  
G

---

<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:** [April 24, 2026, 1:22pm UTC](https://root-forum.cern.ch/t/extended-likelihood-question-of-roofit/64786/7 "2026-04-24T13:22:40Z")

</div>

Closed on April 24, 2026, 1:22pm UTC

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