Error when using ProfileLikelihoodCalculator GetInterval

Dear all,

I am trying to calculate an upper limit using the ProfleLikelihoodCalculator class. Although fitting works quite fine, I get the error message ‘Error - invalid parameter signal_yield specified for finding the interval limits’. The only solution I could find suggested to explicitly set the parameter non-const, but that didn’t help either. Moreover, I get the exact same error message when I set a different parameter to be the parameter of interest.

Here is what I am doing:
RooArgSet paramOfInterest(m_sigYield);
RooStats::ModelConfig modelConfig(“modelConfig”, new RooWorkSpace());
modelConfig.SetPdf(m_combinedModel);
modelConfig.SetParametersOfInterest(paramOfInterest);
RooRealVar
myPOI = (RooRealVar
) modelConfig.GetParametersOfInterest()->first();
myPOI->setConstant(false);
RooStats::ProfileLikelihoodCalculator pl_calculator(data, modelConfig);
pl_calculator.SetTestSize(0.05);
RooStats::LikelihoodInterval
pl_interval = pl_calculator.GetInterval();

Here, data is a RooDataSet, m_combinedModel is a RooAddPdf and m_sigYield a RooRealVar.

I am very thankful for any response.

regards,
Johannes

Hi,
This should not happen. It means that the given parameter is not a variable of profiled likelihood function.
So, there is probably something fuzzy in the model. Could you please attach your workspace, including the dataset and ModelConfig object, so I could reproduce this problem

Best Regards

Lorenzo

Hi Lorenzo,

thank you very much for your quick answer. The workspace is attached.

regards,
Johannes
error_workspace.root (13.4 KB)

Hi,

It seems I am not getting this error in your model. I am doing:

root[] .x $ROOTSYS/tutorials/roostats/StandardProfileLikelihoodDemo("error_workspace.root","wspace","modelConfig","wu")

I have other errors when making the plot of the internal due to invalid fits, but this is another problem

Best Regards

Lorenzo

Hi Lorenzo,

thank you very much. The error disappears if I do not use my pdf directly but if I put it in a workspace first and retrieve it later when I’m calculating the limit as it happens when you read the workspace from a file. Your answer was a big help for me.

kind regards,
Johannes