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:
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