ROOT logo

class RooStats::MCMCInterval: public RooStats::ConfInterval

MCMCInterval is a concrete implementation of the RooStats::ConfInterval interface. It takes as input Markov Chain of data points in the parameter space generated by Monte Carlo using the Metropolis algorithm. From the Markov Chain, the confidence interval can be determined in two ways:

Using a Kernel-Estimated PDF: (not the default method)

A RooNDKeysPdf is constructed from the data set using adaptive kernel width. With this RooNDKeysPdf F, we then integrate over the most likely domain in the parameter space (tallest points in the posterior RooNDKeysPdf) until the target confidence level is reached within an acceptable neighborhood as defined by SetEpsilon(). More specifically: we calculate the following for different cutoff values C until we reach the target confidence level: \int_{ F >= C } F d{normset}. Important note: this is not the default method because of a bug in constructing the RooNDKeysPdf from a weighted data set. Configure to use this method by calling SetUseKeys(true), and the data set will be interpreted without weights.

Using a binned data set: (the default method)

This is the binned analog of the continuous integrative method that uses the kernel-estimated PDF. The points in the Markov Chain are put into a binned data set and the interval is then calculated by adding the heights of the bins in decreasing order until the desired level of confidence has been reached. Note that this means the actual confidence level is >= the confidence level prescribed by the client (unless the user calls SetHistStrict(kFALSE)). This method is the default but may not remain as such in future releases, so you may wish to explicitly configure to use this method by calling SetUseKeys(false)

These are not the only ways for the confidence interval to be determined, and other possibilities are being considered being added, especially for the 1-dimensional case.

One can ask an MCMCInterval for the lower and upper limits on a specific parameter of interest in the interval. Note that this works better for some distributions (ones with exactly one local maximum) than others, and sometimes has little value.

Function Members (Methods)

voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
virtual Bool_tCheckParameters(const RooArgSet& point) const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual Double_tConfidenceLevel() const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Double_tGetActualConfidenceLevel()
virtual RooArgList*GetAxes()
virtual const RooStats::MarkovChain*GetChain()
virtual const RooDataSet*GetChainAsConstDataSet()
virtual RooDataHist*GetChainAsDataHist(RooArgSet* whichVars = NULL)
virtual RooDataSet*GetChainAsDataSet(RooArgSet* whichVars = NULL)
virtual THnSparse*GetChainAsSparseHist(RooArgSet* whichVars = NULL)
virtual Int_tGetDimension() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Double_tGetHistCutoff()
virtual const char*TObject::GetIconName() const
virtual Double_tGetKeysPdfCutoff()
virtual const char*TNamed::GetName() const
virtual RooRealVar*GetNLLVar() const
virtual Int_tGetNumBurnInSteps()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual RooArgSet*GetParameters() const
virtual TH1*GetPosteriorHist()
virtual RooNDKeysPdf*GetPosteriorKeysPdf()
virtual RooProduct*GetPosteriorKeysProduct()
virtual Double_tGetSumOfWeights() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tGetUseKeys()
virtual RooRealVar*GetWeightVar() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
virtual Bool_tIsInInterval(const RooArgSet& point) const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual Double_tLowerLimit(RooRealVar& param)
virtual Double_tLowerLimitByDataHist(RooRealVar& param)
virtual Double_tLowerLimitByHist(RooRealVar& param)
virtual Double_tLowerLimitByKeys(RooRealVar& param)
virtual Double_tLowerLimitBySparseHist(RooRealVar& param)
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
RooStats::MCMCIntervalMCMCInterval(const char* name = 0)
RooStats::MCMCIntervalMCMCInterval(const RooStats::MCMCInterval&)
RooStats::MCMCIntervalMCMCInterval(const char* name, const RooArgSet& parameters, RooStats::MarkovChain& chain)
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
RooStats::MCMCInterval&operator=(const RooStats::MCMCInterval&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
virtual voidSetAxes(RooArgList& axes)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidSetChain(RooStats::MarkovChain& chain)
virtual voidSetConfidenceLevel(Double_t cl)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetEpsilon(Double_t epsilon)
virtual voidSetHistStrict(Bool_t isHistStrict)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
virtual voidSetNumBurnInSteps(Int_t numBurnInSteps)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetParameters(const RooArgSet& parameters)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetUseKeys(Bool_t useKeys)
virtual voidSetUseSparseHist(Bool_t useSparseHist)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual Double_tUpperLimit(RooRealVar& param)
virtual Double_tUpperLimitByDataHist(RooRealVar& param)
virtual Double_tUpperLimitByHist(RooRealVar& param)
virtual Double_tUpperLimitByKeys(RooRealVar& param)
virtual Double_tUpperLimitBySparseHist(RooRealVar& param)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual Double_tCalcConfLevel(Double_t cutoff, Double_t full)
virtual voidCreateDataHist()
virtual voidCreateHist()
virtual voidCreateKeysDataHist()
virtual voidCreateKeysPdf()
virtual voidCreateSparseHist()
virtual voidDetermineByDataHist()
virtual voidDetermineByHist()
virtual voidDetermineByKeys()
virtual voidDetermineBySparseHist()
virtual voidDetermineInterval()
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
Bool_tAcceptableConfLevel(Double_t confLevel)

Data Members

enum TObject::EStatusBits { kCanDelete
enum TObject::[unnamed] { kIsOnHeap
RooRealVar**fAxesarray of pointers to RooRealVars representing
RooStats::MarkovChain*fChainthe markov chain
Double_tfConfidenceLevelRequested confidence level (eg. 0.95 for 95% CL)
RooRealVar*fCutoffVarcutoff variable to use for integrating keys pdf
RooDataHist*fDataHistthe binned Markov Chain data
Int_tfDimensionnumber of variables
Double_tfEpsilonacceptable error for Keys interval determination
Double_tfFullValue of intergral of fProduct
RooStats::Heavyside*fHeavysidethe Heavyside function
TH1*fHistthe binned Markov Chain data
Double_tfHistConfLevelthe actual conf level determined by hist
Double_tfHistCutoffcutoff bin size to be in interval
Double_tfIntervalSumsum of heights of bins in the interval
Bool_tfIsHistStrictwhether the specified confidence level is a floor
Double_tfKeysConfLevelthe actual conf level determined by keys
Double_tfKeysCutoffcutoff keys pdf value to be in interval
RooDataHist*fKeysDataHistdata hist representing product
RooNDKeysPdf*fKeysPdfthe kernel estimation pdf
TStringTNamed::fNameobject identifier
Int_tfNumBurnInStepsnumber of steps to discard as burn in, starting from the first
RooArgSetfParametersparameters of interest for this interval
RooProduct*fProductthe (keysPdf * heavyside) product
THnSparse*fSparseHistthe binned Markov Chain data
TStringTNamed::fTitleobject title
Bool_tfUseKeyswhether to use kernel estimation
Bool_tfUseSparseHistwhether to use sparse hist (vs. RooDataHist)

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

MCMCInterval(const char* name)
MCMCInterval(const char* name, const RooArgSet& parameters, RooStats::MarkovChain& chain)
Bool_t IsInInterval(const RooArgSet& point) const
void SetConfidenceLevel(Double_t cl)
void SetAxes(RooArgList& axes)
void CreateKeysPdf()
 kbelasco: check here for memory leak.  does RooNDKeysPdf use
 the RooArgList passed to it or does it make a clone?
 also check for memory leak from chain, does RooNDKeysPdf clone that?
void CreateHist()
void CreateSparseHist()
void CreateDataHist()
void SetParameters(const RooArgSet& parameters)
void DetermineInterval()
void DetermineByKeys()
void DetermineByHist()
void DetermineBySparseHist()
void DetermineByDataHist()
Double_t GetActualConfidenceLevel()
Double_t GetSumOfWeights() const
Double_t LowerLimit(RooRealVar& param)
Double_t UpperLimit(RooRealVar& param)
Double_t LowerLimitByHist(RooRealVar& param)
Double_t UpperLimitByHist(RooRealVar& param)
Double_t LowerLimitBySparseHist(RooRealVar& param)
Double_t LowerLimitByDataHist(RooRealVar& param)
Double_t UpperLimitBySparseHist(RooRealVar& param)
Double_t UpperLimitByDataHist(RooRealVar& param)
Double_t LowerLimitByKeys(RooRealVar& param)
Double_t UpperLimitByKeys(RooRealVar& param)
Double_t GetHistCutoff()
Double_t GetKeysPdfCutoff()
Double_t CalcConfLevel(Double_t cutoff, Double_t full)
TH1* GetPosteriorHist()
RooNDKeysPdf* GetPosteriorKeysPdf()
RooProduct* GetPosteriorKeysProduct()
RooArgSet* GetParameters() const
 returns list of parameters
Bool_t AcceptableConfLevel(Double_t confLevel)
void CreateKeysDataHist()
Bool_t CheckParameters(const RooArgSet& point) const
 check that the parameters are correct
explicit MCMCInterval(const char* name = 0)
 default constructor
Double_t ConfidenceLevel() const
 get the desired confidence level (see GetActualConfidenceLevel())
void SetHistStrict(Bool_t isHistStrict)
 whether the specified confidence level is a floor for the actual
 confidence level (strict), or a ceiling (not strict)
{ fIsHistStrict = isHistStrict; }
void SetChain(RooStats::MarkovChain& chain)
 Set the MarkovChain that this interval is based on
{ fChain = &chain; }
RooArgList* GetAxes()
 return a list of RooRealVars representing the axes
 you own the returned RooArgList
void SetNumBurnInSteps(Int_t numBurnInSteps)
 set the number of steps in the chain to discard as burn-in,
 starting from the first
{ fNumBurnInSteps = numBurnInSteps; }
void SetUseKeys(Bool_t useKeys)
 set whether to use kernel estimation to determine the interval
{ fUseKeys = useKeys; }
void SetUseSparseHist(Bool_t useSparseHist)
 set whether to use a sparse histogram.  you MUST also call
 SetUseKeys(kFALSE) to use a histogram.
{ fUseSparseHist = useSparseHist; }
Bool_t GetUseKeys()
 get whether we used kernel estimation to determine the interval
{ return fUseKeys; }
Int_t GetNumBurnInSteps()
 get the number of steps in the chain to disard as burn-in,
 get the number of steps in the chain to disard as burn-in,
 starting from the first
{ return fNumBurnInSteps; }
Int_t GetDimension() const
 Get the number of parameters of interest in this interval
{ return fDimension; }
const MarkovChain* GetChain()
 Get the markov chain on which this interval is based
 You do not own the returned MarkovChain*
{ return fChain; }
RooDataSet* GetChainAsDataSet(RooArgSet* whichVars = NULL)
 Get a clone of the markov chain on which this interval is based
 as a RooDataSet.  You own the returned RooDataSet*
{ return fChain->GetAsDataSet(whichVars); }
const RooDataSet* GetChainAsConstDataSet()
 Get the markov chain on which this interval is based
 as a RooDataSet.  You do not own the returned RooDataSet*
{ return fChain->GetAsConstDataSet(); }
RooDataHist* GetChainAsDataHist(RooArgSet* whichVars = NULL)
 Get a clone of the markov chain on which this interval is based
 as a RooDataHist.  You own the returned RooDataHist*
{ return fChain->GetAsDataHist(whichVars); }
THnSparse* GetChainAsSparseHist(RooArgSet* whichVars = NULL)
 Get a clone of the markov chain on which this interval is based
 as a THnSparse.  You own the returned THnSparse*
{ return fChain->GetAsSparseHist(whichVars); }
RooRealVar* GetNLLVar() const
 Get a clone of the NLL variable from the markov chain
{ return fChain->GetNLLVar(); }
RooRealVar* GetWeightVar() const
 Get a clone of the weight variable from the markov chain
{ return fChain->GetWeightVar(); }
void SetEpsilon(Double_t epsilon)
 set the acceptable level or error for Keys interval determination