# Offset in likelihood function

**URL:** <https://root-forum.cern.ch/t/offset-in-likelihood-function/64393>\
**Category:** Roofit and RooStats\
**Created:** [November 11, 2025, 8:50am UTC](https://root-forum.cern.ch/t/offset-in-likelihood-function/64393 "2025-11-11T08:50:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yagao](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/y/6f9a4e/32.png) [@yagao](https://root-forum.cern.ch/u/yagao)\
**Post date:** [November 11, 2025, 8:50am UTC](https://root-forum.cern.ch/t/offset-in-likelihood-function/64393/1 "2025-11-11T08:50:42Z")

</div>

Dear experts,

I have a question about offset in likelihood function.  
I try to get a Nll by createNLL() with RooFit.Offset(“initial”).  
But it does not work, and the Nll is the same value whether I set the offset true of false.

And here is my test code:

```python
from ROOT import RooWorkspace,RooFit,RooMinimizer

w = RooWorkspace(“w”)

w.factory(“Gaussian:f1(m\[80,120\],mean\[100\],sigma\[20\])”)
w.factory(“Gaussian:f2(m,mean_1\[100,90,110\],sigma_1\[20,10,50\])”)
Data = w\[‘f1’\].generate(w\[‘m’\],2000)

r = w\[‘f2’\].fitTo(Data,RooFit.Save(True),RooFit.Offset(“initial”))

print(r.minNll())
nll = w\[‘f2’\].createNLL(Data,RooFit.Offset(“initial”))
nll_n = w\[‘f2’\].createNLL(Data,RooFit.Offset(“none”))
print(“###############”)
print(nll.getVal())
print(nll_n.getVal())
minim_with = RooMinimizer(nll)
minim_with.minimize(“Minuit2”, “Migrad”)
print(nll.getVal())

```

And all the printing give the same value. And my ROOT version is 6.30.06.  
Thanks

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [November 11, 2025, 9:00am UTC](https://root-forum.cern.ch/t/offset-in-likelihood-function/64393/2 "2025-11-11T09:00:36Z")

</div>

I guess @jonas can help you

---

<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:** [November 25, 2025, 9:00am UTC](https://root-forum.cern.ch/t/offset-in-likelihood-function/64393/3 "2025-11-25T09:00:56Z")

</div>

Closed on November 25, 2025, 9:00am UTC

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