Dear expert,
This might be a dummy question,
Let’s say i am fitting the same data, with different initial values and different configuration of sharing parameters.
What i would like to do is to make a comparison of N fits likelihood minimum value to the nominal one i have. In order to improve stability of my complex fit i do the Offset() on the likelihoods before actually minimizing things.
My question is if having this prevent a proper comparison or not and whether i need the setHideOffset on whatever LL i create.
My question stem from the fact that in our fit which has 390 parameters , and uses a complex model , external gauss constraints and create the likelihood for 24 datasets simultaneously, what i noticed is that the likelihood created has on 6/24 datasets a LL value of 1e+7 and in general we initialize the parameters pretty close to the expected convergence point.
With/without offsets the fit converge and give a correct covariance , while without it still converge but the covariance quality is not good.
Therefore, i would like to configure my fit to always do the offsetting , but be still able , regardless of the initial value i set likelihoods from different fits.
For each fit you should be able to get the offset and then use it to correct the obtained FCN. The offset can be retrieved from the RooMinimizerFCN class, see https://root.cern.ch/doc/master/classRooAbsMinimizerFcn.html#aaa7e3b77280fdbeb95ed5a98aa604673
and a pointer to that class can be obtained from RooMinmizer::getMultiGenFunction after having done a dynamic cast to the right type.
//Create a sum of Log(Likelihood terms)
RooAddition _nllSimultaneous("nllCombined", "-log(likelihood)", _nLL);
//enable offsetting
_nllSimultaneous.enableOffsetting(m_offsetLikelihood);
//Create the RooMinmizer instance
RooMinimizer _minimizer(_nllSimultaneous);
//Configure the fit
ConfigureMinimizer(_minimizer, m_name + "_Fit.log");
//Run the fit
FittingProcedure(_minimizer, &_nllSimultaneous);
At which stage do i need to
auto fcn = dynamic_cast<RooAddition>( _minimizer.getMultiGenFcn());
offset = fcn-> getOffset();
Yes @moneta
That’s what i concluded as well, to getVal before actually running the fit to have the offset value the fitter use, why would i need the getVal after? Maybe i miss something.
Ah i see you think that the offsetted value is something the fitresults know about but the original nLL object keeps it without offset?
Hi,
I guess you wanted to compare the nLL values of two fits, i.e. the value on the same data set with same model, but different parameter values. For this you can call nLL->getVal() after the fits. The return value should be re-correct re-adding the internal offset (if used).