ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FeldmanCousins.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
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_FeldmanCousins
12 #define ROOSTATS_FeldmanCousins
13 
14 
15 #ifndef ROOT_Rtypes
16 #include "Rtypes.h"
17 #endif
18 
19 #ifndef ROOSTATS_IntervalCalculator
21 #endif
22 
23 #include "RooStats/ToyMCSampler.h"
26 
27 #include "RooAbsData.h"
28 #include "RooAbsPdf.h"
29 #include "RooArgSet.h"
30 #include "TList.h"
31 
32 class RooAbsData;
33 
34 namespace RooStats {
35 
36  class ConfInterval;
37 
38 /**
39 
40  \ingroup Roostats
41 
42 The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration
43  of the more general NeymanConstruction. It is a concrete implementation of the IntervalCalculator interface that, which uses the NeymanConstruction in a particular way. As the name suggests, it returns a ConfidenceInterval. In particular, it produces a RooStats::PointSetInterval, which is a concrete implementation of the ConfInterval interface.
44 
45 The Neyman Construction is not a uniquely defined statistical technique, it requires that one specify an ordering rule
46 or ordering principle, which is usually incoded by choosing a specific test statistic and limits of integration
47 (corresponding to upper/lower/central limits). As a result, this class must be configured with the corresponding
48 information before it can produce an interval.
49 
50 In the case of the Feldman-Cousins approach, the ordering principle is the likelihood ratio -- motivated
51 by the Neyman-Pearson lemma. When nuisance parameters are involved, the profile likelihood ratio is the natural generalization. One may either choose to perform the construction over the full space of the nuisance parameters, or restrict the nusiance parameters to their conditional MLE (eg. profiled values).
52 
53 */
54 
55 
57 
58  public:
59 
60  // FeldmanCousins();
61 
62  /// Common constructor
63  FeldmanCousins(RooAbsData& data, ModelConfig& model);
64 
65  virtual ~FeldmanCousins();
66 
67  /// Main interface to get a ConfInterval (will be a PointSetInterval)
68  virtual PointSetInterval* GetInterval() const;
69 
70  /// Get the size of the test (eg. rate of Type I error)
71  virtual Double_t Size() const {return fSize;}
72  /// Get the Confidence level for the test
73  virtual Double_t ConfidenceLevel() const {return 1.-fSize;}
74  /// Set the DataSet
75  virtual void SetData(RooAbsData& /*data*/) {
76  std::cout << "DEPRECATED, set data in constructor" << std::endl;
77  }
78  /// Set the Pdf
79  virtual void SetPdf(RooAbsPdf& /*pdf*/) {
80  std::cout << "DEPRECATED, use ModelConfig" << std::endl;
81  }
82 
83  /// specify the parameters of interest in the interval
84  virtual void SetParameters(const RooArgSet& /*set*/) {
85  std::cout << "DEPRECATED, use ModelConfig" << std::endl;
86  }
87 
88  /// specify the nuisance parameters (eg. the rest of the parameters)
89  virtual void SetNuisanceParameters(const RooArgSet& /*set*/) {
90  std::cout << "DEPRECATED, use ModelConfig" << std::endl;
91  }
92 
93  /// User-defined set of points to test
94  void SetParameterPointsToTest(RooAbsData& pointsToTest) {
95  fPointsToTest = &pointsToTest;
96  }
97 
98  /// User-defined set of points to test
99  void SetPOIPointsToTest(RooAbsData& poiToTest) {
100  fPOIToTest = &poiToTest;
101  }
102 
103  /// set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
104  virtual void SetTestSize(Double_t size) {fSize = size;}
105  /// set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
106  virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;}
107 
108  virtual void SetModel(const ModelConfig &);
109 
112  return fPointsToTest;
113  }
114 
116 
117  void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;}
118 
120 
122 
123  void FluctuateNumDataEntries(bool flag=true){fFluctuateData = flag;}
124 
125  void SaveBeltToFile(bool flag=true){
126  fSaveBeltToFile = flag;
127  if(flag) fCreateBelt = true;
128  }
129  void CreateConfBelt(bool flag=true){fCreateBelt = flag;}
130 
131  /// Returns instance of TestStatSampler. Use to change properties of
132  /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(Double_t size);
134 
135 
136  private:
137 
138  /// initializes fPointsToTest data member (mutable)
139  void CreateParameterPoints() const;
140 
141  /// initializes fTestStatSampler data member (mutable)
142  void CreateTestStatSampler() const;
143 
144  Double_t fSize; // size of the test (eg. specified rate of Type I error)
146  RooAbsData & fData; // data set
147 
148  /*
149  RooAbsPdf * fPdf; // common PDF
150  RooArgSet fPOI; // RooArgSet specifying parameters of interest for interval
151  RooArgSet fNuisParams;// RooArgSet specifying nuisance parameters for interval
152  RooArgSet fObservables;// RooArgSet specifying nuisance parameters for interval
153  */
154 
155  mutable ToyMCSampler* fTestStatSampler; // the test statistic sampler
156  mutable RooAbsData* fPointsToTest; // points to perform the construction
157  mutable RooAbsData* fPOIToTest; // value of POI points to perform the construction
159  Bool_t fAdaptiveSampling; // controls use of adaptive sampling algorithm
160  Double_t fAdditionalNToysFactor; // give user ability to ask for more toys
161  Int_t fNbins; // number of samples per variable
162  Bool_t fFluctuateData; // tell ToyMCSampler to fluctuate number of entries in dataset
163  Bool_t fDoProfileConstruction; // instead of full construction over nuisance parametrs, do profile
164  Bool_t fSaveBeltToFile; // controls use if ConfidenceBelt should be saved to a TFile
165  Bool_t fCreateBelt; // controls use if ConfidenceBelt should be saved to a TFile
166 
167  protected:
168  ClassDef(FeldmanCousins,2) // Interface for tools setting limits (producing confidence intervals)
169  };
170 }
171 
172 
173 #endif
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:52
void AdditionalNToysFactor(double fact)
IntervalCalculator is an interface class for a tools which produce RooStats ConfIntervals.
ConfidenceBelt * GetConfidenceBelt()
void SaveBeltToFile(bool flag=true)
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
virtual void SetTestSize(Double_t size)
set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval) ...
virtual void SetParameters(const RooArgSet &)
specify the parameters of interest in the interval
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const TKDTreeBinning * bins
RooAbsData * GetPointsToScan()
virtual Double_t ConfidenceLevel() const
Get the Confidence level for the test.
virtual void SetConfidenceLevel(Double_t cl)
set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval) ...
#define ClassDef(name, id)
Definition: Rtypes.h:254
void CreateTestStatSampler() const
initializes fTestStatSampler data member (mutable)
ConfidenceBelt is a concrete implementation of the ConfInterval interface.
virtual void SetData(RooAbsData &)
Set the DataSet.
virtual ~FeldmanCousins()
destructor if(fOwnsWorkspace && fWS) delete fWS;
void SetNBins(Int_t bins)
void FluctuateNumDataEntries(bool flag=true)
void SetPOIPointsToTest(RooAbsData &poiToTest)
User-defined set of points to test.
ToyMCSampler * fTestStatSampler
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:37
ToyMCSampler is an implementation of the TestStatSampler interface.
Definition: ToyMCSampler.h:99
The FeldmanCousins class (like the Feldman-Cousins technique) is essentially a specific configuration...
TestStatSampler * GetTestStatSampler() const
Returns instance of TestStatSampler.
PointSetInterval is a concrete implementation of the ConfInterval interface.
double Double_t
Definition: RtypesCore.h:55
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
FeldmanCousins(RooAbsData &data, ModelConfig &model)
Common constructor.
virtual void SetPdf(RooAbsPdf &)
Set the Pdf.
void SetParameterPointsToTest(RooAbsData &pointsToTest)
User-defined set of points to test.
virtual void SetModel(const ModelConfig &)
set the model
void CreateConfBelt(bool flag=true)
ConfidenceBelt * fConfBelt
void CreateParameterPoints() const
initializes fPointsToTest data member (mutable)
virtual Double_t Size() const
Get the size of the test (eg. rate of Type I error)
virtual void SetNuisanceParameters(const RooArgSet &)
specify the nuisance parameters (eg. the rest of the parameters)
void UseAdaptiveSampling(bool flag=true)