# Argument nullPoi in SimpleLikelihood

I don’t understand the parameter RooArgSet& nullPOI in the method:

SimpleLikelihoodRatioTestStat::Evaluate(RooAbsData& data, RooArgSet& nullPOI)

in fact, if you look at the code: root.cern.ch/root/html532/src/Ro … html#sya23

it is not used.

Hi,

The nullPOI is the snapshot of the parameter of interest (i.e. the values of the parameters) which are used to evaluate the likelihood ratio. FOr example, when computing a limit via the HypoTestInverter, you care going to scan several values of the POI to find the one which gives a p-value (e.g. CLs+b or CLs) of 0.05 (for a 95% limit).
The test POI value is passed to the test statistic class to evaluate itself.

If you look carefully at the code is used (see line 173 in the current trunk version)

Best Regards

Lorenzo

[quote=“moneta”]Hi,

The nullPOI is the snapshot of the parameter of interest (i.e. the values of the parameters) which are used to evaluate the likelihood ratio. FOr example, when computing a limit via the HypoTestInverter, you care going to scan several values of the POI to find the one which gives a p-value (e.g. CLs+b or CLs) of 0.05 (for a 95% limit).
The test POI value is passed to the test statistic class to evaluate itself.

[/quote]

I don’t understand. I’ve two different likelihood, one for H0 and one for H1:

`````` SimpleLikelihoodRatioTestStat test(*opal_model, *quartz_model);
RooArgSet nullPOI(0); // this is dummy !!!
RooDataSet* data_opal = opal_model->generate(*density, nmeas);
q_value = test.Evaluate(*data_opal, nullPOI); // what is the meaning of nullPOI here?``````

for the code I really don’t understand how the class use nullPOI:

``````         // make sure we set the variables attached to this nll
RooArgSet* attachedSet = fNllNull->getVariables();
*attachedSet = *fNullParameters;
*attachedSet = nullPOI; // ??? it's seems that the previous line effect is discarded
double nullNLL = fNllNull->getVal();

delete fNllNull ; fNllNull = NULL ;
delete attachedSet;   // ??? where did you use atthachedSet?

created = kFALSE ;
if (!fNllAlt) {
fNllAlt = (RooNLLVar*) fAltPdf->createNLL(data, RooFit::CloneData(kFALSE));
created = kTRUE ;
}
if (reuse && !created) {
fNllAlt->setData(data, kFALSE) ;
}
// make sure we set the variables attached to this nll
attachedSet = fNllAlt->getVariables();
*attachedSet = *fAltParameters;
double altNLL = fNllAlt->getVal();

delete fNllAlt ; fNllAlt = NULL ;
delete attachedSet;``````

all these lines seems a no-operation

HI,

if you look at the code :

``````         RooArgSet* attachedSet = fNllNull->getVariables();
*attachedSet = *fNullParameters;
*attachedSet = nullPOI;
double nullNLL = fNllNull->getVal();``````

The first line gets all the variables of the NLL (i.e the parameters of the model).
The second one sets the values of these parameters to some saved values (the nominal ones)
The third one sets the values for the POI only.
So, basically, the nuisance parameters (all the parameters except the POI) are set to some nominal values
(stored in fNullParameters) and the poi values are set to the one given by nullPOI (test value).

To understand it better, you should look at how the operator= is implemented in RooAbsColletion.
RooAbsCLollection contains a list of RooRealVars objects.
Operator= set just the values of the parameters but not the object itself

Lorenzo

[quote=“moneta”]HI,

if you look at the code :

``````         RooArgSet* attachedSet = fNllNull->getVariables();
*attachedSet = *fNullParameters;
*attachedSet = nullPOI;
double nullNLL = fNllNull->getVal();``````

The first line gets all the variables of the NLL (i.e the parameters of the model).
The second one sets the values of these parameters to some saved values (the nominal ones)
The third one sets the values for the POI only.
So, basically, the nuisance parameters (all the parameters except the POI) are set to some nominal values
(stored in fNullParameters) and the poi values are set to the one given by nullPOI (test value).

To understand it better, you should look at how the operator= is implemented in RooAbsColletion.
RooAbsCLollection contains a list of RooRealVars objects.
Operator= set just the values of the parameters but not the object itself

Lorenzo[/quote]

ahhhhhhhhhhh, ok: you have implemented an operator= with a semantic very different from the assigment operator. You can do it, but in my opinion it creates only confusion.

What about my code, I haven’t understood the meaning of nullPOI in my code. I seen that someone edited the documentation of the class

Hi,

[quote]ok: you have implemented an operator= with a semantic very different from the assigment operator. You can do it, but in my opinion it creates only confusion.
[/quote]

I agree with you about this point, it would have been better to use a different method for this. I am not the author of RooFit and maybe the author wants to comment on this.

I am not sure I have understood your question. If you refer to that code

Here nullPOI since is empty has no effect. The likelihood ratio will be evaluated at whatever values the parameters of opal_model and quartz_model have

Lorenzo

[quote=“moneta”]Hi,

[quote]ok: you have implemented an operator= with a semantic very different from the assigment operator. You can do it, but in my opinion it creates only confusion.
[/quote]

I agree with you about this point, it would have been better to use a different method for this. I am not the author of RooFit and maybe the author wants to comment on this.

I am not sure I have understood your question. If you refer to that code

Here nullPOI since is empty has no effect. The likelihood ratio will be evaluated at whatever values the parameters of opal_model and quartz_model have

Lorenzo[/quote]

Ok, thank you, the fact is the my models don’t have parameters