Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RatioOfProfiledLikelihoodsTestStat.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Authors: Kyle Cranmer, Sven Kreiss June 2010
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOSTATS_RatioOfProfiledLikelihoodsTestStat
12#define ROOSTATS_RatioOfProfiledLikelihoodsTestStat
13
14
15#include "Rtypes.h"
16
18
20
21
22namespace RooStats {
23
25
26 public:
27
29 const RooArgSet* altPOI=nullptr) :
34 fDetailedOutput(nullptr)
35 {
36 // Calculates the ratio of profiled likelihoods.
37
38 if (altPOI) {
39 fAltPOI = (RooArgSet*) altPOI->snapshot();
40 } else {
41 fAltPOI = new RooArgSet(); // empty set
42 }
43 }
44
45 //__________________________________________
47 if(fAltPOI) delete fAltPOI;
49 }
50
51
52 /// returns -logL(poi, conditional MLE of nuisance params)
53 /// it does not subtract off the global MLE
54 /// because nuisance parameters of null and alternate may not
55 /// be the same.
57
58 /// evaluate the ratio of profile likelihood
60
66
67 static void SetAlwaysReuseNLL(bool flag);
68
73
74 void SetMinimizer(const char* minimizer){
75 fNullProfile.SetMinimizer(minimizer);
76 fAltProfile.SetMinimizer(minimizer);
77 }
90
91 /// set the conditional observables which will be used when creating the NLL
92 /// so the pdf's will not be normalized on the conditional observables when computing the NLL
97
98 /// set the global observables which will be used when creating the NLL
99 /// so the constraint pdf's will be normalized correctly on the global observables when computing the NLL
104
105 /// Returns detailed output. The value returned by this function is updated after each call to Evaluate().
106 /// The returned RooArgSet contains the following for the alternative and null hypotheses:
107 /// - the minimum nll, fitstatus and convergence quality for each fit
108 /// - for each fit and for each non-constant parameter, the value, error and pull of the parameter are stored
109 const RooArgSet* GetDetailedOutput(void) const override {
110 return fDetailedOutput;
111 }
112
113
114
115
116 const TString GetVarName() const override { return "log(L(#mu_{1},#hat{#nu}_{1}) / L(#mu_{0},#hat{#nu}_{0}))"; }
117
118 // const bool PValueIsRightTail(void) { return false; } // overwrites default
119
121
122 private:
123
126
129 static bool fgAlwaysReuseNll ;
130
133
134 ClassDefOverride(RatioOfProfiledLikelihoodsTestStat,0) // implements the ratio of profiled likelihood as test statistic
135 };
136
137}
138
139
140#endif
#define e(i)
Definition RSha256.hxx:103
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:40
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
ProfileLikelihoodTestStat is an implementation of the TestStatistic interface that calculates the pro...
virtual void EnableDetailedOutput(bool e=true, bool withErrorsAndPulls=false)
void SetConditionalObservables(const RooArgSet &set) override
set the conditional observables which will be used when creating the NLL so the pdf's will not be nor...
void SetGlobalObservables(const RooArgSet &set) override
set the global observables which will be used when creating the NLL so the constraint pdf's will be n...
TestStatistic that returns the ratio of profiled likelihoods.
double Evaluate(RooAbsData &data, RooArgSet &nullParamsOfInterest) override
evaluate the ratio of profile likelihood
void SetGlobalObservables(const RooArgSet &set) override
set the global observables which will be used when creating the NLL so the constraint pdf's will be n...
void SetConditionalObservables(const RooArgSet &set) override
set the conditional observables which will be used when creating the NLL so the pdf's will not be nor...
RatioOfProfiledLikelihoodsTestStat(RooAbsPdf &nullPdf, RooAbsPdf &altPdf, const RooArgSet *altPOI=nullptr)
const RooArgSet * GetDetailedOutput(void) const override
Returns detailed output.
double ProfiledLikelihood(RooAbsData &data, RooArgSet &poi, RooAbsPdf &pdf)
returns -logL(poi, conditional MLE of nuisance params) it does not subtract off the global MLE becaus...
TestStatistic is an interface class to provide a facility for construction test statistics distributi...
Basic string class.
Definition TString.h:139
Namespace for the RooStats classes.
Definition CodegenImpl.h:58