ROOT
6.07/01
Reference Guide
|
HypoTestInverter class for performing an hypothesis test inversion by scanning the hypothesis test results of an HypoTestCalculator for various values of the parameter of interest.
By looking at the confidence level curve of the result an upper limit, where it intersects the desired confidence level, can be derived. The class implements the RooStats::IntervalCalculator interface and returns an RooStats::HypoTestInverterResult class. The result is a SimpleInterval, which via the method UpperLimit returns to the user the upper limit value.
The HypoTestInverter implements various option for performing the scan. HypoTestInverter::RunFixedScan will scan using a fixed grid the parameter of interest. HypoTestInverter::RunAutoScan will perform an automatic scan to find optimally the curve and it will stop until the desired precision is obtained. The confidence level value at a given point can be done via HypoTestInverter::RunOnePoint. The class can scan the CLs+b values or alternativly CLs (if the method HypoTestInverter::UseCLs has been called).
Contributions to this class have been written by Giovanni Petrucciani and Annapaola Decosa
Definition at line 61 of file HypoTestInverter.h.
Public Types | |
enum | ECalculatorType { kUndefined = 0, kHybrid = 1, kFrequentist = 2, kAsymptotic = 3 } |
Public Member Functions | |
HypoTestInverter () | |
HypoTestInverter (HypoTestCalculatorGeneric &hc, RooRealVar *scannedVariable=0, double size=0.05) | |
HypoTestInverter (HybridCalculator &hc, RooRealVar *scannedVariable=0, double size=0.05) | |
HypoTestInverter (FrequentistCalculator &hc, RooRealVar *scannedVariable, double size=0.05) | |
HypoTestInverter (AsymptoticCalculator &hc, RooRealVar *scannedVariable, double size=0.05) | |
HypoTestInverter (RooAbsData &data, ModelConfig &sb, ModelConfig &b, RooRealVar *scannedVariable=0, ECalculatorType type=kFrequentist, double size=0.05) | |
virtual HypoTestInverterResult * | GetInterval () const |
Main interface to get a ConfInterval, pure virtual. More... | |
void | Clear () |
void | SetFixedScan (int nBins, double xMin=1, double xMax=-1, bool scanLog=false) |
void | SetAutoScan () |
bool | RunFixedScan (int nBins, double xMin, double xMax, bool scanLog=false) const |
bool | RunOnePoint (double thisX, bool adaptive=false, double clTarget=-1) const |
bool | RunLimit (double &limit, double &limitErr, double absTol=0, double relTol=0, const double *hint=0) const |
void | UseCLs (bool on=true) |
virtual void | SetData (RooAbsData &) |
Set the DataSet ( add to the the workspace if not already there ?) More... | |
virtual void | SetModel (const ModelConfig &) |
Set the Model. More... | |
virtual void | SetTestSize (Double_t size) |
set the size of the test (rate of Type I error) ( e.g. 0.05 for a 95% Confidence Interval) More... | |
virtual void | SetConfidenceLevel (Double_t cl) |
set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval) More... | |
virtual Double_t | Size () const |
Get the size of the test (eg. rate of Type I error) More... | |
virtual Double_t | ConfidenceLevel () const |
Get the Confidence level for the test. More... | |
virtual | ~HypoTestInverter () |
HypoTestCalculatorGeneric * | GetHypoTestCalculator () const |
SamplingDistribution * | GetLowerLimitDistribution (bool rebuild=false, int nToys=100) |
SamplingDistribution * | GetUpperLimitDistribution (bool rebuild=false, int nToys=100) |
SamplingDistribution * | RebuildDistributions (bool isUpper=true, int nToys=100, TList *clsDist=0, TList *clsbDist=0, TList *clbDist=0, const char *outputfile="HypoTestInverterRebuiltDist.root") |
TestStatistic * | GetTestStatistic () const |
bool | SetTestStatistic (TestStatistic &stat) |
void | SetVerbose (int level=1) |
void | SetMaximumToys (int ntoys) |
void | SetNumErr (double err) |
Public Member Functions inherited from RooStats::IntervalCalculator | |
virtual | ~IntervalCalculator () |
Static Public Member Functions | |
static void | SetCloseProof (Bool_t flag) |
Protected Member Functions | |
HypoTestInverter (const HypoTestInverter &rhs) | |
HypoTestInverter & | operator= (const HypoTestInverter &rhs) |
void | CreateResults () const |
HypoTestResult * | Eval (HypoTestCalculatorGeneric &hc, bool adaptive, double clsTarget) const |
Static Protected Member Functions | |
static RooRealVar * | GetVariableToScan (const HypoTestCalculatorGeneric &hc) |
static void | CheckInputModels (const HypoTestCalculatorGeneric &hc, const RooRealVar &scanVar) |
Private Attributes | |
std::unique_ptr< TGraphErrors > | fLimitPlot |
int | fTotalToysRun |
plot of limits More... | |
int | fMaxToys |
HypoTestCalculatorGeneric * | fCalculator0 |
std::unique_ptr < HypoTestCalculatorGeneric > | fHC |
RooRealVar * | fScannedVariable |
pointer to the generic hypotest calculator used More... | |
HypoTestInverterResult * | fResults |
bool | fUseCLs |
bool | fScanLog |
double | fSize |
int | fVerbose |
ECalculatorType | fCalcType |
int | fNBins |
double | fXmin |
double | fXmax |
double | fNumErr |
Static Private Attributes | |
static unsigned int | fgNToys = 500 |
static double | fgCLAccuracy = 0.005 |
static double | fgAbsAccuracy = 0.05 |
static double | fgRelAccuracy = 0.05 |
static bool | fgCloseProof = false |
static std::string | fgAlgo = "logSecant" |
#include <RooStats/HypoTestInverter.h>
Enumerator | |
---|---|
kUndefined | |
kHybrid | |
kFrequentist | |
kAsymptotic |
Definition at line 65 of file HypoTestInverter.h.
HypoTestInverter::HypoTestInverter | ( | ) |
Definition at line 140 of file HypoTestInverter.cxx.
RooStats::HypoTestInverter::HypoTestInverter | ( | HypoTestCalculatorGeneric & | hc, |
RooRealVar * | scannedVariable = 0 , |
||
double | size = 0.05 |
||
) |
RooStats::HypoTestInverter::HypoTestInverter | ( | HybridCalculator & | hc, |
RooRealVar * | scannedVariable = 0 , |
||
double | size = 0.05 |
||
) |
RooStats::HypoTestInverter::HypoTestInverter | ( | FrequentistCalculator & | hc, |
RooRealVar * | scannedVariable, | ||
double | size = 0.05 |
||
) |
RooStats::HypoTestInverter::HypoTestInverter | ( | AsymptoticCalculator & | hc, |
RooRealVar * | scannedVariable, | ||
double | size = 0.05 |
||
) |
RooStats::HypoTestInverter::HypoTestInverter | ( | RooAbsData & | data, |
ModelConfig & | sb, | ||
ModelConfig & | b, | ||
RooRealVar * | scannedVariable = 0 , |
||
ECalculatorType | type = kFrequentist , |
||
double | size = 0.05 |
||
) |
|
virtual |
Definition at line 381 of file HypoTestInverter.cxx.
|
protected |
Definition at line 345 of file HypoTestInverter.cxx.
|
staticprotected |
Definition at line 102 of file HypoTestInverter.cxx.
void HypoTestInverter::Clear | ( | ) |
Definition at line 410 of file HypoTestInverter.cxx.
|
inlinevirtual |
Get the Confidence level for the test.
Implements RooStats::IntervalCalculator.
Definition at line 133 of file HypoTestInverter.h.
Referenced by CreateResults().
|
protected |
Definition at line 417 of file HypoTestInverter.cxx.
Referenced by RunFixedScan(), and RunOnePoint().
|
protected |
Definition at line 477 of file HypoTestInverter.cxx.
Referenced by GetInterval(), RebuildDistributions(), RunLimit(), and RunOnePoint().
|
inline |
Definition at line 140 of file HypoTestInverter.h.
|
virtual |
Main interface to get a ConfInterval, pure virtual.
Implements RooStats::IntervalCalculator.
Definition at line 446 of file HypoTestInverter.cxx.
Referenced by RebuildDistributions().
SamplingDistribution * HypoTestInverter::GetLowerLimitDistribution | ( | bool | rebuild = false , |
int | nToys = 100 |
||
) |
Definition at line 983 of file HypoTestInverter.cxx.
TestStatistic * HypoTestInverter::GetTestStatistic | ( | void | ) | const |
Definition at line 390 of file HypoTestInverter.cxx.
SamplingDistribution * HypoTestInverter::GetUpperLimitDistribution | ( | bool | rebuild = false , |
int | nToys = 100 |
||
) |
Definition at line 1006 of file HypoTestInverter.cxx.
|
staticprotected |
Definition at line 82 of file HypoTestInverter.cxx.
|
protected |
Definition at line 358 of file HypoTestInverter.cxx.
SamplingDistribution * HypoTestInverter::RebuildDistributions | ( | bool | isUpper = true , |
int | nToys = 100 , |
||
TList * | clsDist = 0 , |
||
TList * | clsbDist = 0 , |
||
TList * | clbDist = 0 , |
||
const char * | outputfile = "HypoTestInverterRebuiltDist.root" |
||
) |
Definition at line 1034 of file HypoTestInverter.cxx.
Referenced by GetLowerLimitDistribution(), and GetUpperLimitDistribution().
bool HypoTestInverter::RunFixedScan | ( | int | nBins, |
double | xMin, | ||
double | xMax, | ||
bool | scanLog = false |
||
) | const |
Definition at line 565 of file HypoTestInverter.cxx.
Referenced by GetInterval().
bool HypoTestInverter::RunLimit | ( | double & | limit, |
double & | limitErr, | ||
double | absTol = 0 , |
||
double | relTol = 0 , |
||
const double * | hint = 0 |
||
) | const |
Definition at line 719 of file HypoTestInverter.cxx.
Referenced by GetInterval().
bool HypoTestInverter::RunOnePoint | ( | double | thisX, |
bool | adaptive = false , |
||
double | clTarget = -1 |
||
) | const |
Definition at line 628 of file HypoTestInverter.cxx.
Referenced by RunFixedScan(), and RunLimit().
|
inline |
Definition at line 110 of file HypoTestInverter.h.
Definition at line 76 of file HypoTestInverter.cxx.
set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval)
Implements RooStats::IntervalCalculator.
Definition at line 129 of file HypoTestInverter.h.
|
virtual |
Set the DataSet ( add to the the workspace if not already there ?)
Implements RooStats::IntervalCalculator.
Definition at line 1030 of file HypoTestInverter.cxx.
Referenced by RebuildDistributions().
|
inline |
Definition at line 103 of file HypoTestInverter.h.
Referenced by SetAutoScan().
|
inline |
Definition at line 160 of file HypoTestInverter.h.
|
inlinevirtual |
Set the Model.
Implements RooStats::IntervalCalculator.
Definition at line 124 of file HypoTestInverter.h.
Definition at line 163 of file HypoTestInverter.h.
set the size of the test (rate of Type I error) ( e.g. 0.05 for a 95% Confidence Interval)
Implements RooStats::IntervalCalculator.
Definition at line 127 of file HypoTestInverter.h.
bool HypoTestInverter::SetTestStatistic | ( | TestStatistic & | stat | ) |
Definition at line 400 of file HypoTestInverter.cxx.
|
inline |
Definition at line 157 of file HypoTestInverter.h.
|
inlinevirtual |
Get the size of the test (eg. rate of Type I error)
Implements RooStats::IntervalCalculator.
Definition at line 131 of file HypoTestInverter.h.
|
inline |
Definition at line 120 of file HypoTestInverter.h.
|
private |
Definition at line 213 of file HypoTestInverter.h.
Referenced by Eval(), and operator=().
|
private |
Definition at line 204 of file HypoTestInverter.h.
Referenced by CreateResults(), GetHypoTestCalculator(), GetTestStatistic(), operator=(), RebuildDistributions(), RunOnePoint(), SetData(), SetTestStatistic(), and ~HypoTestInverter().
|
staticprivate |
Definition at line 191 of file HypoTestInverter.h.
Referenced by RunLimit().
|
staticprivate |
Definition at line 194 of file HypoTestInverter.h.
Referenced by RunLimit().
|
staticprivate |
Definition at line 190 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 193 of file HypoTestInverter.h.
Referenced by GetInterval().
|
staticprivate |
Definition at line 189 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 192 of file HypoTestInverter.h.
Referenced by RunLimit().
|
private |
Definition at line 205 of file HypoTestInverter.h.
|
mutableprivate |
Definition at line 197 of file HypoTestInverter.h.
Referenced by Clear(), and RunLimit().
|
private |
Definition at line 202 of file HypoTestInverter.h.
Referenced by operator=(), RunLimit(), and SetMaximumToys().
|
private |
Definition at line 214 of file HypoTestInverter.h.
Referenced by GetInterval(), operator=(), RebuildDistributions(), and SetFixedScan().
|
private |
Definition at line 217 of file HypoTestInverter.h.
Referenced by Eval(), operator=(), and SetNumErr().
|
mutableprivate |
Definition at line 207 of file HypoTestInverter.h.
Referenced by Clear(), CreateResults(), GetInterval(), GetLowerLimitDistribution(), GetUpperLimitDistribution(), RebuildDistributions(), RunFixedScan(), RunLimit(), RunOnePoint(), SetConfidenceLevel(), SetTestSize(), UseCLs(), and ~HypoTestInverter().
|
private |
Definition at line 210 of file HypoTestInverter.h.
Referenced by GetInterval(), operator=(), and SetFixedScan().
|
private |
pointer to the generic hypotest calculator used
Definition at line 206 of file HypoTestInverter.h.
Referenced by CreateResults(), Eval(), operator=(), RebuildDistributions(), RunFixedScan(), RunLimit(), and RunOnePoint().
|
private |
Definition at line 211 of file HypoTestInverter.h.
Referenced by ConfidenceLevel(), CreateResults(), operator=(), RunLimit(), SetConfidenceLevel(), SetTestSize(), and Size().
|
mutableprivate |
plot of limits
Definition at line 201 of file HypoTestInverter.h.
Referenced by Eval(), operator=(), and RunLimit().
|
private |
Definition at line 209 of file HypoTestInverter.h.
Referenced by CreateResults(), Eval(), GetLowerLimitDistribution(), GetUpperLimitDistribution(), operator=(), RunLimit(), and UseCLs().
|
private |
Definition at line 212 of file HypoTestInverter.h.
Referenced by Eval(), operator=(), RunLimit(), RunOnePoint(), and SetVerbose().
|
private |
Definition at line 216 of file HypoTestInverter.h.
Referenced by GetInterval(), operator=(), and SetFixedScan().
|
private |
Definition at line 215 of file HypoTestInverter.h.
Referenced by GetInterval(), operator=(), and SetFixedScan().