Different results from "manual" NLL minimization and fitTo

Dear experts,

I am trying to plot the profileLL of my model with and without external constraints (gaussian functions) to visualize the impact on the precision of my variable. My model with constraints is a RooSimultaneous pdf called combModel and the one without constraints is also a RooSimultaneous combModel_bare. combModel and combModel_bare consists of (for the moment) two sub-models parametrizing the (signal+background)*constraints and (signal+background) of the two categories respectively.

I am first fitting the combModel to the combined dataset made of the two categories datasets (Asimov datasets created out of MC data), then create the NLL function and minimize it with the same specifications than the fit. Lastly, I create the profile LL of my variable out of the minimized NLL.

Then I fix the global observables appearing in the combModel to the expectation and fit the combModel_bare to another combined dataset made for the unconstrained models (I can also use the dataset from above, there is no difference regarding the problem) and also create the NLL function and minimize it with the same specifications as the second fit. Also here, I construct the profile LL of the variable out of the second minimized NLL.

The issue now is, that I observe different minima of the variable in the profile LL calculations than in the original fits. It seems to me, that the call of the profile likelihood changes the “best fit” value of the fitTo result. Is there something, I can do to use the minimized NLL variable as “best fit” of my POI in the profile LL?

Thank you very much!


I think @moneta can help you.

I just found out, that the best fit value of my variable gets modified when plotting the profileLL together in one plot. When I print the profileLL before the plotting, I get the values from the fit.

Is there a way to plot the two profileLL’s in one plot without disturbing the best-fit values I obtained from the fit?

I will attach also the piece of code.

Thank you very much!


NLLfitTo.cpp (8.7 KB)

Any ideas why the value of the best fit is (or seems to be) disturbed when calling plotOn?

Thank you!

That’s for @moneta .

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