Using fitTo without Constrain argument

Hello,

I am doing a simple fit of a Poisson model to some data. The expected number of events is nexp = (1+delta . Theta) s + b, Theta and s are floating, Theta is constrained by a Gaussian G(Theta,GlobalTheta,1), with GlobalTheta = 0, and in a range [-5,5]. The pdf is built via RooWorkspace::factory.

I am doing the fit just via pdf->fitTo(data). data is just the number of observed events nobs. If I do this two times, the NLL at minimum are very different (although the two found (s,Theta) are very close to (nobs-b,0)). The difference in NLL is ln(10). This is because the contribution from the Gaussian constrain is 0.5 ln(2pi) in the first fit, but it is ln(2pi*Delta) in the second, where Delta is the length of the interval for GlobalTheta : in the second fit, the normalisation for the Constrain is w.r.t. to Theta and GlobalTheta. Is it the expected behaviour ? Shouldn’t one also cache the parameters cPars here


in addition to the constrain, and retrieve them if cached ? At this level, the GlobalTheta has been removed, whereas if one uses the cache, GlobalTheta is still in the parameters used for the constrain normalisation, isn’t it ?
Best,
Jean-Baptiste

Hello.
Here is a simple macro illustrating the question. In root (6.22/02 on my mac) I did

root [0] .L testWSsimpleWithCons.C+
root [1] go()

The output is:

Without using Constrain(*n) option in fitTo
With useConstrain = 0, the minNLL for the three fits : 4.21107 6.4305 6.4305
Using Constrain(*n) option in fitTo
With useConstrain = 1, the minNLL for the three fits : 4.21107 4.21107 4.21107
Without using Constrain(*n) option in fitTo but removing the cached set
With useConstrain = 0, the minNLL for the three fits : 4.21107 4.21107 4.21107

Best

Jean-Baptiste

testWSsimpleWithCons.C (2.0 KB)

@moneta could you please take a look? Thank you in advance!

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