This class uses the Metropolis-Hastings algorithm to construct a Markov Chain of data points using Monte Carlo. In the main algorithm, new points in the parameter space are proposed and then visited based on their relative likelihoods. This class can use any implementation of the ProposalFunction, including non-symmetric proposal functions, to propose parameter points and still maintain detailed balance when constructing the chain.
The "Likelihood" function that is sampled when deciding what steps to take in the chain has been given a very generic implementation. The user can create any RooAbsReal based on the parameters and pass it to a MetropolisHastings object with the method SetFunction(RooAbsReal&). Be sure to tell MetropolisHastings whether your RooAbsReal is on a (+/-) regular or log scale, so that it knows what logic to use when sampling your RooAbsReal. For example, a common use is to sample from a -log(Likelihood) distribution (NLL), for which the appropriate configuration calls are SetType(MetropolisHastings::kLog); SetSign(MetropolisHastings::kNegative); If you're using a traditional likelihood function: SetType(MetropolisHastings::kRegular); SetSign(MetropolisHastings::kPositive); You must set these type and sign flags or MetropolisHastings will not construct a MarkovChain.
Also note that in ConstructChain(), the values of the variables are randomized uniformly over their intervals before construction of the MarkovChain begins.
virtual | ~MetropolisHastings() |
void | TObject::AbstractMethod(const char* method) const |
virtual void | TObject::AppendPad(Option_t* option = "") |
virtual void | TObject::Browse(TBrowser* b) |
static TClass* | Class() |
virtual const char* | TObject::ClassName() const |
virtual void | TObject::Clear(Option_t* = "") |
virtual TObject* | TObject::Clone(const char* newname = "") const |
virtual Int_t | TObject::Compare(const TObject* obj) const |
virtual RooStats::MarkovChain* | ConstructChain() |
virtual void | TObject::Copy(TObject& object) const |
virtual void | TObject::Delete(Option_t* option = "")MENU |
virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
virtual void | TObject::Draw(Option_t* option = "") |
virtual void | TObject::DrawClass() constMENU |
virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
virtual void | TObject::Dump() constMENU |
virtual void | TObject::Error(const char* method, const char* msgfmt) const |
virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
virtual TObject* | TObject::FindObject(const char* name) const |
virtual TObject* | TObject::FindObject(const TObject* obj) const |
virtual Option_t* | TObject::GetDrawOption() const |
static Long_t | TObject::GetDtorOnly() |
virtual const char* | TObject::GetIconName() const |
virtual const char* | TObject::GetName() const |
virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
static Bool_t | TObject::GetObjectStat() |
virtual Option_t* | TObject::GetOption() const |
virtual const char* | TObject::GetTitle() const |
virtual UInt_t | TObject::GetUniqueID() const |
virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
virtual ULong_t | TObject::Hash() const |
virtual void | TObject::Info(const char* method, const char* msgfmt) const |
virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
virtual void | TObject::Inspect() constMENU |
void | TObject::InvertBit(UInt_t f) |
virtual TClass* | IsA() const |
virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
virtual Bool_t | TObject::IsFolder() const |
Bool_t | TObject::IsOnHeap() const |
virtual Bool_t | TObject::IsSortable() const |
Bool_t | TObject::IsZombie() const |
virtual void | TObject::ls(Option_t* option = "") const |
void | TObject::MayNotUse(const char* method) const |
RooStats::MetropolisHastings | MetropolisHastings() |
RooStats::MetropolisHastings | MetropolisHastings(const RooStats::MetropolisHastings&) |
RooStats::MetropolisHastings | MetropolisHastings(RooAbsReal& function, const RooArgSet& paramsOfInterest, RooStats::ProposalFunction& proposalFunction, Int_t numIters) |
virtual Bool_t | TObject::Notify() |
void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
void | TObject::operator delete(void* ptr) |
void | TObject::operator delete(void* ptr, void* vp) |
void | TObject::operator delete[](void* ptr) |
void | TObject::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::MetropolisHastings& | operator=(const RooStats::MetropolisHastings&) |
virtual void | TObject::Paint(Option_t* option = "") |
virtual void | TObject::Pop() |
virtual void | TObject::Print(Option_t* option = "") const |
virtual Int_t | TObject::Read(const char* name) |
virtual void | TObject::RecursiveRemove(TObject* obj) |
void | TObject::ResetBit(UInt_t f) |
virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
void | TObject::SetBit(UInt_t f) |
void | TObject::SetBit(UInt_t f, Bool_t set) |
virtual void | SetChainParameters(const RooArgSet& set) |
virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
static void | TObject::SetDtorOnly(void* obj) |
virtual void | SetFunction(RooAbsReal& function) |
virtual void | SetNumBurnInSteps(Int_t numBurnInSteps) |
virtual void | SetNumIters(Int_t numIters) |
static void | TObject::SetObjectStat(Bool_t stat) |
virtual void | SetParameters(const RooArgSet& set) |
virtual void | SetProposalFunction(RooStats::ProposalFunction& proposalFunction) |
virtual void | SetSign(enum FunctionSign sign) |
virtual void | SetType(enum FunctionType type) |
virtual void | TObject::SetUniqueID(UInt_t uid) |
virtual void | ShowMembers(TMemberInspector& insp) const |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
Bool_t | TObject::TestBit(UInt_t f) const |
Int_t | TObject::TestBits(UInt_t f) const |
virtual void | TObject::UseCurrentStyle() |
virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
virtual Double_t | CalcNLL(Double_t xL) |
virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
void | TObject::MakeZombie() |
virtual Bool_t | ShouldTakeStep(Double_t d) |
RooArgSet | fChainParams | RooRealVars that are stored in the chain |
RooAbsReal* | fFunction | function that will generate likelihood values |
Int_t | fNumBurnInSteps | number of iterations to discard as burn-in, starting from the first |
Int_t | fNumIters | number of iterations to run metropolis algorithm |
RooArgSet | fParameters | RooRealVars that define all parameter space |
RooStats::ProposalFunction* | fPropFunc | Proposal function for MCMC integration |
enum FunctionSign | fSign | whether the likelihood is negative (like NLL) or positive |
enum FunctionType | fType | whether the likelihood is on a regular, log, (or other) scale |
specify the parameters to store in the chain if not specified all of them will be stored
{ fChainParams.removeAll(); fChainParams.add(set); RemoveConstantParameters(&fChainParams); }
specify all the parameters of interest in the interval
{ fParameters.removeAll(); fParameters.add(set); RemoveConstantParameters(&fParameters); }
set the proposal function for suggesting new points for the MCMC
{ fPropFunc = &proposalFunction; }
set the number of iterations to run the metropolis algorithm
{ fNumIters = numIters; }
set the number of steps in the chain to discard as burn-in, starting from the first
{ fNumBurnInSteps = numBurnInSteps; }