ROOT logo
ROOT » ROOFIT » ROOSTATS » RooStats::MCMCInterval

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)

public:
virtual~MCMCInterval()
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 RooStats::MCMCInterval::IntervalTypeGetIntervalType()
Double_tGetKeysMax()
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 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 Double_tLowerLimitShortest(RooRealVar& param)
virtual Double_tLowerLimitTailFraction(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()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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(ostream& 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 voidSetDelta(Double_t delta)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetEpsilon(Double_t epsilon)
virtual voidSetHistStrict(Bool_t isHistStrict)
virtual voidSetIntervalType(RooStats::MCMCInterval::IntervalType intervalType)
virtual voidSetLeftSideTailFraction(Double_t a)
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)
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 Double_tUpperLimitShortest(RooRealVar& param)
virtual Double_tUpperLimitTailFraction(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
protected:
virtual Double_tCalcConfLevel(Double_t cutoff, Double_t full)
virtual voidCreateDataHist()
virtual voidCreateHist()
virtual voidCreateKeysDataHist()
virtual voidCreateKeysPdf()
virtual voidCreateSparseHist()
virtual voidCreateVector(RooRealVar* param)
virtual voidDetermineByDataHist()
virtual voidDetermineByHist()
virtual voidDetermineByKeys()
virtual voidDetermineBySparseHist()
virtual voidDetermineInterval()
virtual voidDetermineShortestInterval()
virtual voidDetermineTailFractionInterval()
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum { DEFAULT_NUM_BINS
};
enum IntervalType { kShortest
kTailFraction
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
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
Double_tfDeltatopCutoff (a) considered == bottomCutoff (b) iff
Int_tfDimensionnumber of variables
Double_tfEpsilonacceptable error for Keys interval determination
Double_tfFullValue of intergral of fProduct
RooStats::Heaviside*fHeavisidethe Heaviside function
TH1*fHistthe binned Markov Chain data
Double_tfHistConfLevelthe actual conf level determined by hist
Double_tfHistCutoffcutoff bin size to be in interval
RooStats::MCMCInterval::IntervalTypefIntervalType
Bool_tfIsHistStrictwhether the specified confidence level is a
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
Double_tfLeftSideTFleft side tail-fraction for interval
TStringTNamed::fNameobject identifier
Int_tfNumBurnInStepsnumber of steps to discard as burn in, starting
RooArgSetfParametersparameters of interest for this interval
RooProduct*fProductthe (keysPdf * heaviside) product
THnSparse*fSparseHistthe binned Markov Chain data
Double_tfTFConfLevelthe actual conf level of tail-fraction interval
Double_tfTFLowerlower limit of the tail-fraction interval
Double_tfTFUpperupper limit of the tail-fraction interval
TStringTNamed::fTitleobject title
Bool_tfUseKeyswhether to use kernel estimation
Bool_tfUseSparseHistwhether to use sparse hist (vs. RooDataHist)
Double_tfVecWeightsum of weights of all entries in fVector
vector<Int_t>fVectorvector containing the Markov chain data

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

MCMCInterval(const char* name = 0)
MCMCInterval(const char* name, const RooArgSet& parameters, RooStats::MarkovChain& chain)
~MCMCInterval()
 destructor
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 CreateVector(RooRealVar* param)
void SetParameters(const RooArgSet& parameters)
void DetermineInterval()
void DetermineShortestInterval()
void DetermineTailFractionInterval()
void DetermineByKeys()
void DetermineByHist()
void DetermineBySparseHist()
void DetermineByDataHist()
Double_t GetActualConfidenceLevel()
Double_t LowerLimit(RooRealVar& param)
Double_t UpperLimit(RooRealVar& param)
Double_t LowerLimitTailFraction(RooRealVar& param)
Double_t UpperLimitTailFraction(RooRealVar& param)
Double_t LowerLimitShortest(RooRealVar& param)
Double_t UpperLimitShortest(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 GetKeysMax()
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)
Bool_t WithinDeltaFraction(Double_t a, Double_t b)
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
void SetIntervalType(RooStats::MCMCInterval::IntervalType intervalType)
 Set the type of interval to find.  This will only have an effect for
 1-D intervals.  If is more than 1 parameter of interest, then a
 "shortest" interval will always be used, since it generalizes directly
 to N dimensions
{ fIntervalType = intervalType; }
enum IntervalType GetIntervalType()
 Return the type of this interval
{ return fIntervalType; }
void SetLeftSideTailFraction(Double_t a)
 set the left-side tail fraction for a tail-fraction interval
{ fLeftSideTF = a; }
void SetDelta(Double_t delta)
 kbelasco: The inner-workings of the class really should not be exposed
 like this in a comment, but it seems to be the only way to give
 the user any control over this process, if he desires it

 Set the fraction delta such that
 topCutoff (a) is considered == bottomCutoff (b) iff
 (TMath::Abs(a - b) < TMath::Abs(fDelta * (a + b)/2))
 when determining the confidence interval by Keys