#include "RooStats/RatioOfProfiledLikelihoodsTestStat.h"
#include "RooArgSet.h"
#include "RooAbsData.h"
#include "TMath.h"
#include "RooMsgService.h"
#include "RooGlobalFunc.h"
Bool_t RooStats::RatioOfProfiledLikelihoodsTestStat::fgAlwaysReuseNll = kTRUE ;
void RooStats::RatioOfProfiledLikelihoodsTestStat::SetAlwaysReuseNLL(Bool_t flag) { fgAlwaysReuseNll = flag ; }
Double_t RooStats::RatioOfProfiledLikelihoodsTestStat::ProfiledLikelihood(RooAbsData& data, RooArgSet& poi, RooAbsPdf& pdf) {
int type = (fSubtractMLE) ? 0 : 2;
if ( &pdf == fNullProfile.GetPdf() )
return fNullProfile.EvaluateProfileLikelihood(type, data, poi);
else if (&pdf == fAltProfile.GetPdf() )
return fAltProfile.EvaluateProfileLikelihood(type, data, poi);
oocoutE((TObject*)NULL,InputArguments) << "RatioOfProfiledLikelihoods::ProfileLikelihood - invalid pdf used for computing the profiled likelihood - return NaN"
<< std::endl;
return TMath::QuietNaN();
}
Double_t RooStats::RatioOfProfiledLikelihoodsTestStat::Evaluate(RooAbsData& data, RooArgSet& nullParamsOfInterest) {
int type = (fSubtractMLE) ? 0 : 2;
double nullNLL = fNullProfile.EvaluateProfileLikelihood(type, data, nullParamsOfInterest);
const RooArgSet *nullset = fNullProfile.GetDetailedOutput();
double altNLL = fAltProfile.EvaluateProfileLikelihood(type, data, *fAltPOI);
const RooArgSet *altset = fAltProfile.GetDetailedOutput();
if (fDetailedOutput != NULL) {
delete fDetailedOutput;
fDetailedOutput = NULL;
}
if (fDetailedOutputEnabled) {
fDetailedOutput = new RooArgSet();
RooRealVar* var(0);
for(TIterator *it = nullset->createIterator();(var = dynamic_cast<RooRealVar*>(it->Next()));) {
RooRealVar* cloneVar = new RooRealVar(TString::Format("nullprof_%s", var->GetName()),
TString::Format("%s for null", var->GetTitle()), var->getVal());
fDetailedOutput->addOwned(*cloneVar);
}
for(TIterator *it = altset->createIterator();(var = dynamic_cast<RooRealVar*>(it->Next()));) {
RooRealVar* cloneVar = new RooRealVar(TString::Format("altprof_%s", var->GetName()),
TString::Format("%s for null", var->GetTitle()), var->getVal());
fDetailedOutput->addOwned(*cloneVar);
}
}
return nullNLL -altNLL;
}
RatioOfProfiledLikelihoodsTestStat.cxx:1 RatioOfProfiledLikelihoodsTestStat.cxx:2 RatioOfProfiledLikelihoodsTestStat.cxx:3 RatioOfProfiledLikelihoodsTestStat.cxx:4 RatioOfProfiledLikelihoodsTestStat.cxx:5 RatioOfProfiledLikelihoodsTestStat.cxx:6 RatioOfProfiledLikelihoodsTestStat.cxx:7 RatioOfProfiledLikelihoodsTestStat.cxx:8 RatioOfProfiledLikelihoodsTestStat.cxx:9 RatioOfProfiledLikelihoodsTestStat.cxx:10 RatioOfProfiledLikelihoodsTestStat.cxx:11 RatioOfProfiledLikelihoodsTestStat.cxx:12 RatioOfProfiledLikelihoodsTestStat.cxx:13 RatioOfProfiledLikelihoodsTestStat.cxx:14 RatioOfProfiledLikelihoodsTestStat.cxx:15 RatioOfProfiledLikelihoodsTestStat.cxx:16 RatioOfProfiledLikelihoodsTestStat.cxx:17 RatioOfProfiledLikelihoodsTestStat.cxx:18 RatioOfProfiledLikelihoodsTestStat.cxx:19 RatioOfProfiledLikelihoodsTestStat.cxx:20 RatioOfProfiledLikelihoodsTestStat.cxx:21 RatioOfProfiledLikelihoodsTestStat.cxx:22 RatioOfProfiledLikelihoodsTestStat.cxx:23 RatioOfProfiledLikelihoodsTestStat.cxx:24 RatioOfProfiledLikelihoodsTestStat.cxx:25 RatioOfProfiledLikelihoodsTestStat.cxx:26 RatioOfProfiledLikelihoodsTestStat.cxx:27 RatioOfProfiledLikelihoodsTestStat.cxx:28 RatioOfProfiledLikelihoodsTestStat.cxx:29 RatioOfProfiledLikelihoodsTestStat.cxx:30 RatioOfProfiledLikelihoodsTestStat.cxx:31 RatioOfProfiledLikelihoodsTestStat.cxx:32 RatioOfProfiledLikelihoodsTestStat.cxx:33 RatioOfProfiledLikelihoodsTestStat.cxx:34 RatioOfProfiledLikelihoodsTestStat.cxx:35 RatioOfProfiledLikelihoodsTestStat.cxx:36 RatioOfProfiledLikelihoodsTestStat.cxx:37 RatioOfProfiledLikelihoodsTestStat.cxx:38 RatioOfProfiledLikelihoodsTestStat.cxx:39 RatioOfProfiledLikelihoodsTestStat.cxx:40 RatioOfProfiledLikelihoodsTestStat.cxx:41 RatioOfProfiledLikelihoodsTestStat.cxx:42 RatioOfProfiledLikelihoodsTestStat.cxx:43 RatioOfProfiledLikelihoodsTestStat.cxx:44 RatioOfProfiledLikelihoodsTestStat.cxx:45 RatioOfProfiledLikelihoodsTestStat.cxx:46 RatioOfProfiledLikelihoodsTestStat.cxx:47 RatioOfProfiledLikelihoodsTestStat.cxx:48 RatioOfProfiledLikelihoodsTestStat.cxx:49 RatioOfProfiledLikelihoodsTestStat.cxx:50 RatioOfProfiledLikelihoodsTestStat.cxx:51 RatioOfProfiledLikelihoodsTestStat.cxx:52 RatioOfProfiledLikelihoodsTestStat.cxx:53 RatioOfProfiledLikelihoodsTestStat.cxx:54 RatioOfProfiledLikelihoodsTestStat.cxx:55 RatioOfProfiledLikelihoodsTestStat.cxx:56 RatioOfProfiledLikelihoodsTestStat.cxx:57 RatioOfProfiledLikelihoodsTestStat.cxx:58 RatioOfProfiledLikelihoodsTestStat.cxx:59 RatioOfProfiledLikelihoodsTestStat.cxx:60 RatioOfProfiledLikelihoodsTestStat.cxx:61 RatioOfProfiledLikelihoodsTestStat.cxx:62 RatioOfProfiledLikelihoodsTestStat.cxx:63 RatioOfProfiledLikelihoodsTestStat.cxx:64 RatioOfProfiledLikelihoodsTestStat.cxx:65 RatioOfProfiledLikelihoodsTestStat.cxx:66 RatioOfProfiledLikelihoodsTestStat.cxx:67 RatioOfProfiledLikelihoodsTestStat.cxx:68 RatioOfProfiledLikelihoodsTestStat.cxx:69 RatioOfProfiledLikelihoodsTestStat.cxx:70 RatioOfProfiledLikelihoodsTestStat.cxx:71 RatioOfProfiledLikelihoodsTestStat.cxx:72 RatioOfProfiledLikelihoodsTestStat.cxx:73 RatioOfProfiledLikelihoodsTestStat.cxx:74 RatioOfProfiledLikelihoodsTestStat.cxx:75 RatioOfProfiledLikelihoodsTestStat.cxx:76 RatioOfProfiledLikelihoodsTestStat.cxx:77 RatioOfProfiledLikelihoodsTestStat.cxx:78 RatioOfProfiledLikelihoodsTestStat.cxx:79 RatioOfProfiledLikelihoodsTestStat.cxx:80 RatioOfProfiledLikelihoodsTestStat.cxx:81 RatioOfProfiledLikelihoodsTestStat.cxx:82 RatioOfProfiledLikelihoodsTestStat.cxx:83 RatioOfProfiledLikelihoodsTestStat.cxx:84 RatioOfProfiledLikelihoodsTestStat.cxx:85 RatioOfProfiledLikelihoodsTestStat.cxx:86 RatioOfProfiledLikelihoodsTestStat.cxx:87 RatioOfProfiledLikelihoodsTestStat.cxx:88 RatioOfProfiledLikelihoodsTestStat.cxx:89