Is there any way to ask the ProfileLikelihoodCalculator for the value of (the logarithm of ) the profile likelihood for a given value of the parameter of interest ( or -2log(lambda(mu)) in the usual terminology) ? It’s very easy to plot that for various mu by using the LikelihoodIntervalPlot but funnily enough I could not find any method to get the actual value for one specific mu ( as the name ‘ProfileLikelihoodCalculator’ is suggesting).
You can get the profile likelihood ratio function using LikelihoodInterval::GetLikelihoodRatio.
Below is an example on how to get the value of the profile likelihood ratio function for a given value of the parameter of interest (e.g. poi = 1)
// create calculator from data set and ModelConfig
ProfileLikelihoodCalculator pl(*data,*mc);
pl.SetConfidenceLevel(0.683); // 68% interval
LikelihoodInterval* interval = pl.GetInterval();
// find the interval on the first Parameter of Interest
RooRealVar* firstPOI = (RooRealVar*) mc->GetParametersOfInterest()->first();
// get value of PLR for POI=1
RooAbsReal * plr = interval->GetLikelihoodRatio();
firstPOI->setVal(1);
double val = plr->getVal();
cout << "PLR value at " << firstPOI->GetName() << " = 1 : " << val << endl;