ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProfileLikelihoodCalculator.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_ProfileLikelihoodCalculator
12 #define ROOSTATS_ProfileLikelihoodCalculator
13 
14 #ifndef ROOSTATS_CombinedCalculator
16 #endif
17 
19 
20 
21 
22 
23 namespace RooStats {
24 
25  class LikelihoodInterval;
26 
27 
28  /**
29 
30 ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class for a tools which can produce both RooStats HypoTestResults and ConfIntervals).
31 The tool uses the profile likelihood ratio as a test statistic, and assumes that Wilks' theorem is valid. Wilks' theorem states that -2* log (profile likelihood ratio) is asymptotically distributed as a chi^2 distribution with N-dof, where N is the number of degrees of freedom. Thus, p-values can be constructed and the profile likelihood ratio can be used to construct a LikelihoodInterval. (In the future, this class could be extended to use toy Monte Carlo to calibrate the distribution of the test statistic).
32 
33 Usage: It uses the interface of the CombinedCalculator, so that it can be configured by specifying:
34 
35 * a model common model (eg. a family of specific models which includes both the null and alternate),
36 * a data set,
37 * a set of parameters of interest. The nuisance parameters will be all other parameters of the model
38 * a set of parameters of which specify the null hypothesis (including values and const/non-const status)
39 
40 The interface allows one to pass the model, data, and parameters either directly or via a ModelConfig class. The alternate hypothesis leaves the parameter free to take any value other than those specified by the null hypotesis. There is therefore no need to specify the alternate parameters.
41 
42 After configuring the calculator, one only needs to ask GetHypoTest() (which will return a HypoTestResult pointer) or GetInterval() (which will return an ConfInterval pointer).
43 
44  This calculator can work with both one-dimensional intervals or multi-dimensional ones (contours)
45 
46  Note that for hypothesis tests, it is oftern better to use the RooStats::AsymptoricCalculator class, which can compute in addition the expected p-value using an Asimov data set.
47 
48 
49  \ingroup Roostats
50  */
51 
53 
54  public:
55 
56  /// Default constructor (needed for I/O)
58 
59  /// Constructor from data, from a full model pdf describing both parameter of interest and nuisance parameters
60  /// and from the set specifying the parameter of interest (POI).
61  /// There is no need to specify the nuisance parameters since they are all other parameters of the model.
62  /// When using the calculator for performing an hypothesis test one needs to provide also a snapshot (a copy)
63  /// defining the null parameters and their value. There is no need to pass the alternate parameters. These
64  /// will be obtained by the value maximazing the likelihood function
65  ProfileLikelihoodCalculator(RooAbsData& data, RooAbsPdf& pdf, const RooArgSet& paramsOfInterest,
66  Double_t size = 0.05, const RooArgSet* nullParams = 0 );
67 
68 
69  /// Constructor from data and a model configuration
70  /// If the ModelConfig defines a prior pdf for any of the parameters those will be included as constrained terms in the
71  /// likelihood function
72  ProfileLikelihoodCalculator(RooAbsData& data, ModelConfig & model, Double_t size = 0.05);
73 
74 
76 
77  /// Return a likelihood interval. A global fit to the likelihood is performed and
78  /// the interval is constructed using the the profile likelihood ratio function of the POI
79  virtual LikelihoodInterval* GetInterval() const ;
80 
81  /// Return the hypothesis test result obtained from the likelihood ratio of the
82  /// maximum likelihood value with the null parameters fixed to their values, with respect keeping all parameters
83  /// floating (global maximum likelihood value).
84  virtual HypoTestResult* GetHypoTest() const;
85 
86 
87 
88  protected:
89 
90  // clear internal fit result
91  void DoReset() const;
92 
93  // perform a global fit
94  RooAbsReal * DoGlobalFit() const;
95 
96  // minimize likelihood
97  static RooFitResult * DoMinimizeNLL(RooAbsReal * nll);
98 
99 
100  mutable RooFitResult * fFitResult; // internal result of gloabl fit
101  mutable bool fGlobalFitDone; // flag to control if a global fit has been done
102 
103 
104  ClassDef(ProfileLikelihoodCalculator,2) // A concrete implementation of CombinedCalculator that uses the ProfileLikelihood ratio.
105 
106  };
107 }
108 #endif
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:52
LikelihoodInterval is a concrete implementation of the RooStats::ConfInterval interface.
static RooFitResult * DoMinimizeNLL(RooAbsReal *nll)
HypoTestResult is a base class for results from hypothesis tests.
ProfileLikelihoodCalculator is a concrete implementation of CombinedCalculator (the interface class f...
ProfileLikelihoodCalculator()
Default constructor (needed for I/O)
virtual LikelihoodInterval * GetInterval() const
Return a likelihood interval.
#define ClassDef(name, id)
Definition: Rtypes.h:254
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:37
CombinedCalculator is an interface class for a tools which can produce both RooStats HypoTestResults ...
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
virtual HypoTestResult * GetHypoTest() const
Return the hypothesis test result obtained from the likelihood ratio of the maximum likelihood value ...
virtual ~ProfileLikelihoodCalculator()
destructor cannot delete prod pdf because it will delete all the composing pdf's if (fOwnPdf) delete ...
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41