Home | News | Documentation | Download

Profile NLL with constraints

Dear Roofit experts,

I have a model depending on few parameters. Among the parameters I have alpha and beta which are constrained.

I am trying to plot the profile NLL for alpha and beta: when profiling over alpha I constrain beta, and viceversa when profiling beta:

RooAbsReal *nll1 = model->createNLL(*data, RooFit::Extended(kTRUE), RooFit::Constrain(RooArgSet(*beta)), RooFit::NumCPU(2));
RooAbsReal *pll_alpha = nll1->createProfile(*alpha);
RooAbsReal *nll2 = model->createNLL(*data, RooFit::Extended(kTRUE), RooFit::Constrain(RooArgSet(*alpha)), RooFit::NumCPU(2));
RooAbsReal *pll_beta = nll2->createProfile(*beta);

From the output I get, it seems that the constrained parameters is alpha in both cases:

[#1] INFO:Minization -- createNLL: caching constraint set under name CONSTR_OF_PDF_model_FOR_OBS_evis:z with 1 entries
[#1] INFO:Minization --  Including the following constraint terms in minimization: (gaus_beta)
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[alpha]) Creating instance of MINUIT
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model_genDataToy0_with_constr) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[alpha]) determining minimum likelihood for current configurations w.r.t all observable
[#1] INFO:Eval -- RooAbsTestStatistic::initMPMode: started 2 remote server process.
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[alpha]) minimum found at (alpha=0.635529)
..........................................................................................................................................................................................................
[#1] INFO:Minization -- createNLL picked up cached consraints from workspace with 1 entries
[#1] INFO:Minization --  Including the following constraint terms in minimization: (gaus_beta)
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[beta]) Creating instance of MINUIT
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model_genDataToy0_with_constr) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[beta]) determining minimum likelihood for current configurations w.r.t all observable
[#1] INFO:Eval -- RooAbsTestStatistic::initMPMode: started 2 remote server process.
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[beta]) minimum found at (beta=-0.762351)

It seems like the first NLL configuration is cached and then used again.
Is there something I am missing? Should I use another aproach?

Thanks for your help.

Antonio

Hi,
I don’t see any problem in the output. I might miss something, if it does not work as expected, please include the full code that can be run to reproduce the problem

Best regards

Lorenzo

Hi,

thanks for your reply.

What I mean is that from the log output seems like the constraint is set on beta even when I am profiling on beta itself.
In fact, from the alpha profiling I see:

[#1] INFO:Minization -- createNLL: caching constraint set under name CONSTR_OF_PDF_model_FOR_OBS_evis:z with 1 entries
[#1] INFO:Minization --  Including the following constraint terms in minimization: (gaus_beta)
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[alpha]) Creating instance of MINUIT
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model_genDataToy0_with_constr) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[alpha]) determining minimum likelihood for current configurations w.r.t all observable
[#1] INFO:Eval -- RooAbsTestStatistic::initMPMode: started 2 remote server process.
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[alpha]) minimum found at (alpha=0.635529)

as I would expect (the constraint term is gaus_beta). Whereas when profiling beta I see:

[#1] INFO:Minization -- createNLL picked up cached consraints from workspace with 1 entries
[#1] INFO:Minization --  Including the following constraint terms in minimization: (gaus_beta)
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[beta]) Creating instance of MINUIT
[#1] INFO:Fitting -- RooAddition::defaultErrorLevel(nll_model_genDataToy0_with_constr) Summation contains a RooNLLVar, using its error level
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[beta]) determining minimum likelihood for current configurations w.r.t all observable
[#1] INFO:Eval -- RooAbsTestStatistic::initMPMode: started 2 remote server process.
[#1] INFO:Minization -- RooProfileLL::evaluate(nll_model_genDataToy0_with_constr_Profile[beta]) minimum found at (beta=-0.762351)

from the second line I understand the constraint term is gaus_beta also here. Should not be gaus_alpha instead? As I am explicitly requiring in the createNLL().

Maybe is sommething obvious that I am missing.

Thanks,
Antonio

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