Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files 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 
15 
17 
18 namespace RooStats {
19 
20  class LikelihoodInterval;
21 
22  class ProfileLikelihoodCalculator : public CombinedCalculator {
23 
24  public:
25 
26  /// Default constructor (needed for I/O)
27  ProfileLikelihoodCalculator();
28 
29  /// Constructor from data, from a full model pdf describing both parameter of interest and nuisance parameters
30  /// and from the set specifying the parameter of interest (POI).
31  /// There is no need to specify the nuisance parameters since they are all other parameters of the model.
32  /// When using the calculator for performing an hypothesis test one needs to provide also a snapshot (a copy)
33  /// defining the null parameters and their value. There is no need to pass the alternate parameters. These
34  /// will be obtained by the value maximizing the likelihood function
35  ProfileLikelihoodCalculator(RooAbsData& data, RooAbsPdf& pdf, const RooArgSet& paramsOfInterest,
36  Double_t size = 0.05, const RooArgSet* nullParams = 0 );
37 
38 
39  /// Constructor from data and a model configuration
40  /// If the ModelConfig defines a prior pdf for any of the parameters those will be included as constrained terms in the
41  /// likelihood function
42  ProfileLikelihoodCalculator(RooAbsData& data, ModelConfig & model, Double_t size = 0.05);
43 
44 
45  virtual ~ProfileLikelihoodCalculator();
46 
47  /// Return a likelihood interval. A global fit to the likelihood is performed and
48  /// the interval is constructed using the profile likelihood ratio function of the POI.
49  virtual LikelihoodInterval* GetInterval() const ;
50 
51  /// Return the hypothesis test result obtained from the likelihood ratio of the
52  /// maximum likelihood value with the null parameters fixed to their values, with respect to keeping all parameters
53  /// floating (global maximum likelihood value).
54  virtual HypoTestResult* GetHypoTest() const;
55 
56 
57 
58  protected:
59 
60  // clear internal fit result
61  void DoReset() const;
62 
63  // perform a global fit
64  RooAbsReal * DoGlobalFit() const;
65 
66  // minimize likelihood
67  static RooFitResult * DoMinimizeNLL(RooAbsReal * nll);
68 
69 
70  mutable RooFitResult * fFitResult; // internal result of global fit
71  mutable bool fGlobalFitDone; // flag to control if a global fit has been done
72 
73 
74  ClassDef(ProfileLikelihoodCalculator,2) // A concrete implementation of CombinedCalculator that uses the ProfileLikelihood ratio.
75 
76  };
77 }
78 #endif