Dear experts,
I am trying to plot the likelihood function from a simultaneous fit done in different ranges of the observables. The plot I obtain, however, shows the minimum at a different value than that found in the minimisation. Investigating this, I narrowed it down to a difference between a NLL variable created with and without an specified Range:
RooAbsReal *nll = model.createNLL(*dataset);
vs
RooAbsReal *nllrange = model.createNLL(*dataset, RooFit::Range(“fitrange”));
even if “fitrange” is the whole range of the observable x. Running the attached code, for example, I get the following likelihood scan.
Is this behaviour expected? I am using ROOT 6.14/04.
Many thanks in advance.
Best,
Paula
NLLScanwithRange.pdf (13.4 KB)
plotLikelihoodFitRange.cxx (2.2 KB)
1 Like
Hi @palvarezc ,
I don’t see why this should happen. After all, the parameter values are inferred correctly. I added
model.paramOn(xframe);
to the plotting and that works fine.
To answer why the NLL is shifted will need some investigation. I opened a bug report
https://sft.its.cern.ch/jira/browse/ROOT-9752
1 Like
system
Closed
November 9, 2018, 3:31pm
3
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
jonas
October 2, 2022, 3:12pm
4
Hi, thanks for reporting this.
Indeed, this pointed to a bug is the RooFit dataset classes that I fixed in the 6.28 development cycle with this PR:
root-project:master
← guitargeek:roovectordatastore_native_1
opened 03:03PM - 02 Oct 22 UTC
The `RooVectorDataStore` had two different buffers to store the row data in: the… so-called "attached buffers" and the "native buffers".
The problem is that when external buffers are attached, the call to `RooVectorDataStore::get()` is not loading the native buffers anymore, which is breaking some code that assumes this, like `RooVectorDataStore::loadValues`, which is used in `RooDataSet::reduce`. This breaks the reduction of datasets with externally attached buffers, which breaks the copy constructor of the `RooNLLVar`.
This commit suggests to always load both the native and attached buffers if `RooVectorDataStore::get()` is called. This has almost no performance overhead and is much safeter.
Since this change fixes the copy constructor of the `RooNLLVar`, which is used when plotting the NLL, this commit fixes this JIRA ticket: https://sft.its.cern.ch/jira/browse/ROOT-9752
A unit test that covers the problem reported in the JIRA ticket is also added.
Cheers,
Jonas