ROOT   6.14/05 Reference Guide
RooStats::AsymptoticCalculator Class Reference

Hypothesis Test Calculator based on the asymptotic formulae for the profile likelihood ratio.

Performs hypothesis tests using asymptotic formula for the profile likelihood and Asimov data set

See G. Cowan, K. Cranmer, E. Gross and O. Vitells: Asymptotic formulae for likelihood- based tests of new physics. Eur. Phys. J., C71:1–19, 2011. It provides method to perform an hypothesis tests using the likelihood function and computes the p values for the null and the alternate using the asymptotic formulae for the profile likelihood ratio described in the given paper.

The calculator provides methods to produce the Asimov dataset, i.e a dataset generated where the observed values are equal to the expected ones. The Asimov data set is then used to compute the observed asymptotic p-value for the alternate hypothesis and the asymptotic expected p-values.

The asymptotic formulae are valid only for one POI (parameter of interest). So the calculator works only for one-dimensional (one POI) model. If more than one POI exists consider as POI only the first one is used.

Definition at line 27 of file AsymptoticCalculator.h.

## Public Member Functions

AsymptoticCalculator (RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, bool nominalAsimov=false)
constructor for asymptotic calculator from Data set and ModelConfig More...

~AsymptoticCalculator ()

const RooArgSetGetBestFitParams () const
return best fit value for all parameters More...

const RooArgSetGetBestFitPoi () const
return snapshot of the best fit parameter More...

virtual HypoTestResultGetHypoTest () const
re-implement HypoTest computation using the asymptotic More...

const RooRealVarGetMuHat () const
return best fit parameter (firs of poi) More...

bool Initialize () const
initialize the calculator by performing a global fit and make the Asimov data set More...

bool IsOneSidedDiscovery () const

bool IsTwoSided () const

virtual void SetAlternateModel (const ModelConfig &altModel)

virtual void SetData (RooAbsData &data)

virtual void SetNullModel (const ModelConfig &nullModel)
re-implementation of setters since they are needed to re-initialize the calculator More...

void SetOneSided (bool on)
set test statistic for one sided (upper limits) More...

void SetOneSidedDiscovery (bool on)
set the test statistics for one-sided discovery More...

void SetQTilde (bool on)
set using of qtilde, by default is controlled if RoORealVar is limited or not More...

void SetTwoSided ()
set the test statistics for two sided (in case of upper limits for discovery does not make really sense) More...

Public Member Functions inherited from RooStats::HypoTestCalculatorGeneric
HypoTestCalculatorGeneric (const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=0)
Constructor. More...

~HypoTestCalculatorGeneric ()

const ModelConfigGetAlternateModel (void) const

const RooAbsDataGetData (void) const

virtual const RooArgSetGetFitInfo () const

const ModelConfigGetNullModel (void) const

TestStatSamplerGetTestStatSampler (void) const

void UseSameAltToys ()
to re-use same toys for alternate hypothesis More...

Public Member Functions inherited from RooStats::HypoTestCalculator
virtual ~HypoTestCalculator ()

virtual void SetCommonModel (const ModelConfig &model)

## Static Public Member Functions

static RooAbsDataGenerateAsimovData (const RooAbsPdf &pdf, const RooArgSet &observables)
generate the asimov data for the observables (not the global ones) need to deal with the case of a sim pdf More...

static double GetExpectedPValues (double pnull, double palt, double nsigma, bool usecls, bool oneSided=true)
function given the null and the alt p value - return the expected one given the N - sigma value More...

static RooAbsDataMakeAsimovData (RooAbsData &data, const ModelConfig &model, const RooArgSet &poiValues, RooArgSet &globObs, const RooArgSet *genPoiValues=0)
make the asimov data from the ModelConfig and list of poi - return data set and snapshot of global obs poiValues is the snapshot of POI used for finding the best nuisance parameter values (conditioned at these values) genPoiValues is optionally a different set of POI values used for generating. More...

static RooAbsDataMakeAsimovData (const ModelConfig &model, const RooArgSet &allParamValues, RooArgSet &globObs)
make a nominal asimov data from the ModelConfig and parameter values The parameter values (including the nuisance) could be given from a fit to data or be at the nominal values More...

static void SetPrintLevel (int level)
set print level (static function) More...

## Static Protected Member Functions

static double EvaluateNLL (RooAbsPdf &pdf, RooAbsData &data, const RooArgSet *condObs, const RooArgSet *globObs, const RooArgSet *poiSet=0)

static void FillBins (const RooAbsPdf &pdf, const RooArgList &obs, RooAbsData &data, int &index, double &binVolume, int &ibin)
fill bins by looping recursively on observables More...

static RooAbsDataGenerateAsimovDataSinglePdf (const RooAbsPdf &pdf, const RooArgSet &obs, const RooRealVar &weightVar, RooCategory *channelCat=0)
compute the asimov data set for an observable of a pdf use the number of bins sets in the observables to do : (possibility to change number of bins) implement integration over bin content More...

static RooAbsDataGenerateCountingAsimovData (RooAbsPdf &pdf, const RooArgSet &obs, const RooRealVar &weightVar, RooCategory *channelCat=0)
generate counting Asimov data for the case when the pdf cannot be extended assume pdf is a RooPoisson or can be decomposed in a product of RooPoisson, otherwise we cannot know how to make the Asimov data sets in the other cases More...

static bool SetObsToExpected (RooAbsPdf &pdf, const RooArgSet &obs)
set observed value to the expected one works for Gaussian, Poisson or LogNormal assumes mean parameter value is the argument not constant and not depending on observables (if more than two arguments are not constant will use first one but print a warning !) need to iterate on the components of the Poisson to get n and nu (nu can be a RooAbsReal) (code from G. More...

static bool SetObsToExpected (RooProdPdf &prod, const RooArgSet &obs)
iterate a Prod pdf to find all the Poisson or Gaussian part to set the observed value to expected one More...

## Private Attributes

RooAbsDatafAsimovData

RooArgSet fAsimovGlobObs

RooArgSet fBestFitParams

RooArgSet fBestFitPoi

bool fIsInitialized

double fNLLAsimov

double fNLLObs

bool fNominalAsimov

bool fOneSided

bool fOneSidedDiscovery

int fUseQTilde
flag to check if calculator is initialized More...

## Static Private Attributes

static int fgPrintLevel = 1

## Additional Inherited Members

Protected Member Functions inherited from RooStats::HypoTestCalculatorGeneric
virtual int CheckHook (void) const

virtual void PostHook () const

virtual int PreAltHook (RooArgSet *, double) const

virtual void PreHook () const

virtual int PreNullHook (RooArgSet *, double) const

Protected Attributes inherited from RooStats::HypoTestCalculatorGeneric
const ModelConfigfAltModel

unsigned int fAltToysSeed

const RooAbsDatafData

TestStatSamplerfDefaultSampler

TestStatisticfDefaultTestStat

const ModelConfigfNullModel

TestStatSamplerfTestStatSampler

#include <RooStats/AsymptoticCalculator.h>

Inheritance diagram for RooStats::AsymptoticCalculator:
[legend]

## ◆ AsymptoticCalculator()

 AsymptoticCalculator::AsymptoticCalculator ( RooAbsData & data, const ModelConfig & altModel, const ModelConfig & nullModel, bool nominalAsimov = false )

constructor for asymptotic calculator from Data set and ModelConfig

Definition at line 92 of file AsymptoticCalculator.cxx.

## ◆ ~AsymptoticCalculator()

 RooStats::AsymptoticCalculator::~AsymptoticCalculator ( )
inline

Definition at line 40 of file AsymptoticCalculator.h.

## ◆ EvaluateNLL()

 Double_t AsymptoticCalculator::EvaluateNLL ( RooAbsPdf & pdf, RooAbsData & data, const RooArgSet * condObs, const RooArgSet * globObs, const RooArgSet * poiSet = 0 )
staticprotected

Definition at line 289 of file AsymptoticCalculator.cxx.

## ◆ FillBins()

 void AsymptoticCalculator::FillBins ( const RooAbsPdf & pdf, const RooArgList & obs, RooAbsData & data, int & index, double & binVolume, int & ibin )
staticprotected

fill bins by looping recursively on observables

Definition at line 852 of file AsymptoticCalculator.cxx.

## ◆ GenerateAsimovData()

 RooAbsData * AsymptoticCalculator::GenerateAsimovData ( const RooAbsPdf & pdf, const RooArgSet & observables )
static

generate the asimov data for the observables (not the global ones) need to deal with the case of a sim pdf

Definition at line 1124 of file AsymptoticCalculator.cxx.

## ◆ GenerateAsimovDataSinglePdf()

 RooAbsData * AsymptoticCalculator::GenerateAsimovDataSinglePdf ( const RooAbsPdf & pdf, const RooArgSet & obs, const RooRealVar & weightVar, RooCategory * channelCat = 0 )
staticprotected

compute the asimov data set for an observable of a pdf use the number of bins sets in the observables to do : (possibility to change number of bins) implement integration over bin content

Definition at line 1046 of file AsymptoticCalculator.cxx.

## ◆ GenerateCountingAsimovData()

 RooAbsData * AsymptoticCalculator::GenerateCountingAsimovData ( RooAbsPdf & pdf, const RooArgSet & obs, const RooRealVar & weightVar, RooCategory * channelCat = 0 )
staticprotected

generate counting Asimov data for the case when the pdf cannot be extended assume pdf is a RooPoisson or can be decomposed in a product of RooPoisson, otherwise we cannot know how to make the Asimov data sets in the other cases

Definition at line 1008 of file AsymptoticCalculator.cxx.

## ◆ GetBestFitParams()

 const RooArgSet& RooStats::AsymptoticCalculator::GetBestFitParams ( ) const
inline

return best fit value for all parameters

Definition at line 103 of file AsymptoticCalculator.h.

## ◆ GetBestFitPoi()

 const RooArgSet& RooStats::AsymptoticCalculator::GetBestFitPoi ( ) const
inline

return snapshot of the best fit parameter

Definition at line 99 of file AsymptoticCalculator.h.

## ◆ GetExpectedPValues()

 double AsymptoticCalculator::GetExpectedPValues ( double pnull, double palt, double nsigma, bool usecls, bool oneSided = true )
static

function given the null and the alt p value - return the expected one given the N - sigma value

Definition at line 803 of file AsymptoticCalculator.cxx.

## ◆ GetHypoTest()

 HypoTestResult * AsymptoticCalculator::GetHypoTest ( ) const
virtual

re-implement HypoTest computation using the asymptotic

It performs an hypothesis tests using the likelihood function and computes the p values for the null and the alternate using the asymptotic formulae for the profile likelihood ratio.

See G. Cowan, K. Cranmer, E. Gross and O. Vitells. Asymptotic formulae for likelihood- based tests of new physics. Eur. Phys. J., C71:1–19, 2011. The formulae are valid only for one POI. If more than one POI exists consider as POI only the first one

Reimplemented from RooStats::HypoTestCalculatorGeneric.

Definition at line 471 of file AsymptoticCalculator.cxx.

## ◆ GetMuHat()

 const RooRealVar* RooStats::AsymptoticCalculator::GetMuHat ( ) const
inline

return best fit parameter (firs of poi)

Definition at line 101 of file AsymptoticCalculator.h.

## ◆ Initialize()

 bool AsymptoticCalculator::Initialize ( ) const

initialize the calculator by performing a global fit and make the Asimov data set

Initialize the calculator The initialization will perform a global fit of the model to the data and build an Asimov data set.

It will then also fit the model to the Asimov data set to find the likelihood value of the Asimov data set nominalAsimov is an option for using Asimov data set obtained using nominal nuisance parameter values By default the nuisance parameters are fitted to the data NOTE: If a fit has been done before, one for speeding up could set all the initial parameters to the fit value and in addition set the null snapshot to the best fit

Definition at line 130 of file AsymptoticCalculator.cxx.

## ◆ IsOneSidedDiscovery()

 bool RooStats::AsymptoticCalculator::IsOneSidedDiscovery ( ) const
inline

Definition at line 92 of file AsymptoticCalculator.h.

## ◆ IsTwoSided()

 bool RooStats::AsymptoticCalculator::IsTwoSided ( ) const
inline

Definition at line 91 of file AsymptoticCalculator.h.

## ◆ MakeAsimovData() [1/2]

 RooAbsData * AsymptoticCalculator::MakeAsimovData ( RooAbsData & realData, const ModelConfig & model, const RooArgSet & paramValues, RooArgSet & asimovGlobObs, const RooArgSet * genPoiValues = 0 )
static

make the asimov data from the ModelConfig and list of poi - return data set and snapshot of global obs poiValues is the snapshot of POI used for finding the best nuisance parameter values (conditioned at these values) genPoiValues is optionally a different set of POI values used for generating.

static function to the an Asimov data set given an observed dat set, a model and a snapshot of poi.

By default the same POI are used for generating and for finding the nuisance parameters

Return the asimov data set + global observables set to values satisfying the constraints

Definition at line 1193 of file AsymptoticCalculator.cxx.

## ◆ MakeAsimovData() [2/2]

 RooAbsData * AsymptoticCalculator::MakeAsimovData ( const ModelConfig & model, const RooArgSet & allParamValues, RooArgSet & globObs )
static

make a nominal asimov data from the ModelConfig and parameter values The parameter values (including the nuisance) could be given from a fit to data or be at the nominal values

static function to the an Asimov data set given the model and the values of all parameters including the nuisance Return the asimov data set + global observables set to values satisfying the constraints

Definition at line 1299 of file AsymptoticCalculator.cxx.

## ◆ SetAlternateModel()

 virtual void RooStats::AsymptoticCalculator::SetAlternateModel ( const ModelConfig & altModel )
inlinevirtual

Reimplemented from RooStats::HypoTestCalculatorGeneric.

Definition at line 81 of file AsymptoticCalculator.h.

## ◆ SetData()

 virtual void RooStats::AsymptoticCalculator::SetData ( RooAbsData & data )
inlinevirtual

Reimplemented from RooStats::HypoTestCalculatorGeneric.

Definition at line 85 of file AsymptoticCalculator.h.

## ◆ SetNullModel()

 virtual void RooStats::AsymptoticCalculator::SetNullModel ( const ModelConfig & nullModel )
inlinevirtual

re-implementation of setters since they are needed to re-initialize the calculator

Reimplemented from RooStats::HypoTestCalculatorGeneric.

Definition at line 77 of file AsymptoticCalculator.h.

## ◆ SetObsToExpected() [1/2]

 bool AsymptoticCalculator::SetObsToExpected ( RooAbsPdf & pdf, const RooArgSet & obs )
staticprotected

set observed value to the expected one works for Gaussian, Poisson or LogNormal assumes mean parameter value is the argument not constant and not depending on observables (if more than two arguments are not constant will use first one but print a warning !) need to iterate on the components of the Poisson to get n and nu (nu can be a RooAbsReal) (code from G.

Petrucciani and extended by L.M.)

Definition at line 954 of file AsymptoticCalculator.cxx.

## ◆ SetObsToExpected() [2/2]

 bool AsymptoticCalculator::SetObsToExpected ( RooProdPdf & prod, const RooArgSet & obs )
staticprotected

iterate a Prod pdf to find all the Poisson or Gaussian part to set the observed value to expected one

Definition at line 917 of file AsymptoticCalculator.cxx.

## ◆ SetOneSided()

 void RooStats::AsymptoticCalculator::SetOneSided ( bool on )
inline

set test statistic for one sided (upper limits)

Definition at line 67 of file AsymptoticCalculator.h.

## ◆ SetOneSidedDiscovery()

 void RooStats::AsymptoticCalculator::SetOneSidedDiscovery ( bool on )
inline

set the test statistics for one-sided discovery

Definition at line 74 of file AsymptoticCalculator.h.

## ◆ SetPrintLevel()

 void AsymptoticCalculator::SetPrintLevel ( int level )
static

set print level (static function)

• 0 minimal,
• 1 normal,
• 2 debug

Definition at line 85 of file AsymptoticCalculator.cxx.

## ◆ SetQTilde()

 void RooStats::AsymptoticCalculator::SetQTilde ( bool on )
inline

set using of qtilde, by default is controlled if RoORealVar is limited or not

Definition at line 96 of file AsymptoticCalculator.h.

## ◆ SetTwoSided()

 void RooStats::AsymptoticCalculator::SetTwoSided ( )
inline

set the test statistics for two sided (in case of upper limits for discovery does not make really sense)

Definition at line 71 of file AsymptoticCalculator.h.

## ◆ fAsimovData

 RooAbsData* RooStats::AsymptoticCalculator::fAsimovData
mutableprivate

Definition at line 144 of file AsymptoticCalculator.h.

## ◆ fAsimovGlobObs

 RooArgSet RooStats::AsymptoticCalculator::fAsimovGlobObs
mutableprivate

Definition at line 145 of file AsymptoticCalculator.h.

## ◆ fBestFitParams

 RooArgSet RooStats::AsymptoticCalculator::fBestFitParams
mutableprivate

Definition at line 147 of file AsymptoticCalculator.h.

## ◆ fBestFitPoi

 RooArgSet RooStats::AsymptoticCalculator::fBestFitPoi
mutableprivate

Definition at line 146 of file AsymptoticCalculator.h.

## ◆ fgPrintLevel

 int AsymptoticCalculator::fgPrintLevel = 1
staticprivate

Definition at line 140 of file AsymptoticCalculator.h.

## ◆ fIsInitialized

 bool RooStats::AsymptoticCalculator::fIsInitialized
mutableprivate

Definition at line 138 of file AsymptoticCalculator.h.

## ◆ fNLLAsimov

 double RooStats::AsymptoticCalculator::fNLLAsimov
mutableprivate

Definition at line 142 of file AsymptoticCalculator.h.

## ◆ fNLLObs

 double RooStats::AsymptoticCalculator::fNLLObs
mutableprivate

Definition at line 141 of file AsymptoticCalculator.h.

## ◆ fNominalAsimov

 bool RooStats::AsymptoticCalculator::fNominalAsimov
private

Definition at line 137 of file AsymptoticCalculator.h.

## ◆ fOneSided

 bool RooStats::AsymptoticCalculator::fOneSided
private

Definition at line 135 of file AsymptoticCalculator.h.

## ◆ fOneSidedDiscovery

 bool RooStats::AsymptoticCalculator::fOneSidedDiscovery
mutableprivate

Definition at line 136 of file AsymptoticCalculator.h.

## ◆ fUseQTilde

 int RooStats::AsymptoticCalculator::fUseQTilde
mutableprivate

flag to check if calculator is initialized

Definition at line 139 of file AsymptoticCalculator.h.

Libraries for RooStats::AsymptoticCalculator:
[legend]

The documentation for this class was generated from the following files: