ROOT 6.08/07 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) | |
Constructor from a model for B model and a model for S+B. More... | |
virtual | ~HypoTestInverter () |
void | Clear () |
virtual Double_t | ConfidenceLevel () const |
Get the Confidence level for the test. More... | |
HypoTestCalculatorGeneric * | GetHypoTestCalculator () const |
virtual HypoTestInverterResult * | GetInterval () const |
Main interface to get a ConfInterval, pure virtual. More... | |
SamplingDistribution * | GetLowerLimitDistribution (bool rebuild=false, int nToys=100) |
TestStatistic * | GetTestStatistic () const |
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") |
bool | RunFixedScan (int nBins, double xMin, double xMax, bool scanLog=false) const |
bool | RunLimit (double &limit, double &limitErr, double absTol=0, double relTol=0, const double *hint=0) const |
bool | RunOnePoint (double thisX, bool adaptive=false, double clTarget=-1) const |
void | SetAutoScan () |
virtual void | SetConfidenceLevel (Double_t cl) |
set the confidence level for the interval (e.g. 0.95 for a 95% Confidence Interval) More... | |
virtual void | SetData (RooAbsData &) |
Set the DataSet ( add to the the workspace if not already there ?) More... | |
void | SetFixedScan (int nBins, double xMin=1, double xMax=-1, bool scanLog=false) |
void | SetMaximumToys (int ntoys) |
virtual void | SetModel (const ModelConfig &) |
Set the Model. More... | |
void | SetNumErr (double err) |
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... | |
bool | SetTestStatistic (TestStatistic &stat) |
void | SetVerbose (int level=1) |
virtual Double_t | Size () const |
Get the size of the test (eg. rate of Type I error) More... | |
void | UseCLs (bool on=true) |
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) | |
void | CreateResults () const |
HypoTestResult * | Eval (HypoTestCalculatorGeneric &hc, bool adaptive, double clsTarget) const |
HypoTestInverter & | operator= (const HypoTestInverter &rhs) |
Static Protected Member Functions | |
static void | CheckInputModels (const HypoTestCalculatorGeneric &hc, const RooRealVar &scanVar) |
static RooRealVar * | GetVariableToScan (const HypoTestCalculatorGeneric &hc) |
Private Attributes | |
ECalculatorType | fCalcType |
HypoTestCalculatorGeneric * | fCalculator0 |
std::unique_ptr< HypoTestCalculatorGeneric > | fHC |
std::unique_ptr< TGraphErrors > | fLimitPlot |
int | fMaxToys |
int | fNBins |
double | fNumErr |
HypoTestInverterResult * | fResults |
bool | fScanLog |
RooRealVar * | fScannedVariable |
pointer to the generic hypotest calculator used More... | |
double | fSize |
int | fTotalToysRun |
plot of limits More... | |
bool | fUseCLs |
int | fVerbose |
double | fXmax |
double | fXmin |
Static Private Attributes | |
static double | fgAbsAccuracy = 0.05 |
static std::string | fgAlgo = "logSecant" |
static double | fgCLAccuracy = 0.005 |
static bool | fgCloseProof = false |
static unsigned int | fgNToys = 500 |
static double | fgRelAccuracy = 0.05 |
#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.
HypoTestInverter::HypoTestInverter | ( | HypoTestCalculatorGeneric & | hc, |
RooRealVar * | scannedVariable = 0 , |
||
double | size = 0.05 |
||
) |
Definition at line 157 of file HypoTestInverter.cxx.
HypoTestInverter::HypoTestInverter | ( | HybridCalculator & | hc, |
RooRealVar * | scannedVariable = 0 , |
||
double | size = 0.05 |
||
) |
Definition at line 211 of file HypoTestInverter.cxx.
HypoTestInverter::HypoTestInverter | ( | FrequentistCalculator & | hc, |
RooRealVar * | scannedVariable, | ||
double | size = 0.05 |
||
) |
Definition at line 245 of file HypoTestInverter.cxx.
HypoTestInverter::HypoTestInverter | ( | AsymptoticCalculator & | hc, |
RooRealVar * | scannedVariable, | ||
double | size = 0.05 |
||
) |
Definition at line 275 of file HypoTestInverter.cxx.
HypoTestInverter::HypoTestInverter | ( | RooAbsData & | data, |
ModelConfig & | sbModel, | ||
ModelConfig & | bModel, | ||
RooRealVar * | scannedVariable = 0 , |
||
ECalculatorType | type = kFrequentist , |
||
double | size = 0.05 |
||
) |
Constructor from a model for B model and a model for S+B.
An HypoTestCalculator (Hybrid of Frequentis) will be created using the S+B model as the null and the B model as the alternate If no variable to scan are given they are assumed to be the first variable from the parameter of interests of the null model
Definition at line 314 of file HypoTestInverter.cxx.
|
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.
|
protected |
Definition at line 417 of file HypoTestInverter.cxx.
|
protected |
Definition at line 477 of file HypoTestInverter.cxx.
|
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.
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.
bool HypoTestInverter::RunFixedScan | ( | int | nBins, |
double | xMin, | ||
double | xMax, | ||
bool | scanLog = false |
||
) | const |
Definition at line 565 of file HypoTestInverter.cxx.
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.
bool HypoTestInverter::RunOnePoint | ( | double | thisX, |
bool | adaptive = false , |
||
double | clTarget = -1 |
||
) | const |
Definition at line 628 of file HypoTestInverter.cxx.
|
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.
|
inline |
Definition at line 103 of file HypoTestInverter.h.
|
inline |
Definition at line 160 of file HypoTestInverter.h.
|
inlinevirtual |
Set the Model.
Implements RooStats::IntervalCalculator.
Definition at line 124 of file HypoTestInverter.h.
|
inline |
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.
|
private |
Definition at line 204 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 191 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 194 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 190 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 193 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 189 of file HypoTestInverter.h.
|
staticprivate |
Definition at line 192 of file HypoTestInverter.h.
|
private |
Definition at line 205 of file HypoTestInverter.h.
|
mutableprivate |
Definition at line 197 of file HypoTestInverter.h.
|
private |
Definition at line 202 of file HypoTestInverter.h.
|
private |
Definition at line 214 of file HypoTestInverter.h.
|
private |
Definition at line 217 of file HypoTestInverter.h.
|
mutableprivate |
Definition at line 207 of file HypoTestInverter.h.
|
private |
Definition at line 210 of file HypoTestInverter.h.
|
private |
pointer to the generic hypotest calculator used
Definition at line 206 of file HypoTestInverter.h.
|
private |
Definition at line 211 of file HypoTestInverter.h.
|
mutableprivate |
plot of limits
Definition at line 201 of file HypoTestInverter.h.
|
private |
Definition at line 209 of file HypoTestInverter.h.
|
private |
Definition at line 212 of file HypoTestInverter.h.
|
private |
Definition at line 216 of file HypoTestInverter.h.
|
private |
Definition at line 215 of file HypoTestInverter.h.