BCEngineMCMC.h
254 BCEngineMCMC(const std::string& filename, const std::string& name, bool loadObservables = true);
519 { return index1 < fH2Marginalized.size() and index2 < fH2Marginalized[index1].size() and fH2Marginalized[index1][index2]; }
593 { return (observables) ? std::max(fParameters.MaxNameLength(), fObservables.MaxNameLength()) : fParameters.MaxNameLength(); }
601 { return (index < GetNParameters()) ? static_cast<BCVariable&>(fParameters[index]) : static_cast<BCVariable&>(fObservables.At(index - GetNParameters())); }
609 { return (index < GetNParameters()) ? static_cast<const BCVariable&>(fParameters[index]) : static_cast<const BCVariable&>(fObservables.At(index - GetNParameters())); }
862 BCLog::OutWarning("You have changed the proposal function flag, but not required the prerun be rerun.");
907 { fParameters.FillHistograms(flag_1d, flag_2d); fObservables.FillHistograms(flag_1d, flag_2d); }
1037 void WriteMarkovChain(const std::string& filename, const std::string& option, bool flag_run = true, bool flag_prerun = true);
1127 void SetPriorGauss(const std::string& name, double mode, double sigma_below, double sigma_above)
1163 void WriteMarginalizedDistributions(const std::string& filename, const std::string& option, bool closeExistingFile = false);
1173 void PrintParameters(const std::vector<double>& P, void (*output)(const std::string&) = BCLog::OutSummary) const;
1181 unsigned PrintAllMarginalized(const std::string& filename, unsigned hdiv = 1, unsigned vdiv = 1) const;
1191 unsigned PrintParameterPlot(const std::string& filename, int npar = 10, double interval_content = 68e-2, std::vector<double> quantile_values = std::vector<double>(0), bool rescale_ranges = true) const;
1201 bool DrawParameterPlot(unsigned i0, unsigned npar = 0, double interval_content = 68e-2, std::vector<double> quantile_values = std::vector<double>(0), bool rescale_ranges = true) const;
1214 bool PrintCorrelationPlot(const std::string& filename = "correlation.pdf", bool include_observables = true) const;
1246 virtual bool AddParameter(const std::string& name, double min, double max, const std::string& latexname = "", const std::string& unitstring = "")
1266 virtual bool AddObservable(const std::string& name, double min, double max, const std::string& latexname = "", const std::string& unitstring = "")
1386 static double RValue(const std::vector<double>& means, const std::vector<double>& variances, unsigned n, bool correctForSamplingVariability = true);
1441 virtual void MCMCCurrentPointInterface(const std::vector<double>& point, int ichain, bool accepted)
1472 void LoadMCMC(const std::string& filename, std::string mcmcTreeName = "", std::string parameterTreeName = "", bool loadObservables = true);
1505 void PrepareToContinueMarginalization(const std::string& filename, const std::string& mcmcTreeName = "", const std::string& parameterTreeName = "", bool loadObservables = true, bool autorange = true);
void SetProposeMultivariate(bool flag)
Set flag to true to turn on the multivariate proposal for MCMC based on (Haario et al...
Definition: BCEngineMCMC.h:859
const BCParameterSet & GetParameters() const
Definition: BCEngineMCMC.h:623
BCEngineMCMC & operator=(const BCEngineMCMC &)
Copy-assignment operator.
Definition: BCEngineMCMC.cxx:191
BCH2D fBCH2DdrawingOptions
A BCH2D (with no histogram) for storing BCH2D drawing options.
Definition: BCEngineMCMC.h:1821
InitialPositionScheme
An enumerator for markov-chain position initialization.
Definition: BCEngineMCMC.h:82
void SetNIterationsPreRunCheck(unsigned n)
Sets the number of iterations between scale adjustments and convergence checks in the pre-run...
Definition: BCEngineMCMC.h:800
double GetMinimumEfficiency() const
Definition: BCEngineMCMC.h:338
void SetPrior(const std::string &name, TH1 &h, bool interpolate=false)
Definition: BCEngineMCMC.h:1145
void SetMinimumEfficiency(double efficiency)
Sets the minimum efficiency required for a chain.
Definition: BCEngineMCMC.h:810
bool GetRescaleHistogramRangesAfterPreRun() const
Definition: BCEngineMCMC.h:492
std::vector< TMatrixDSym > fMultivariateProposalFunctionCovariance
Covariance matrices used in multivariate proposal functions.
Definition: BCEngineMCMC.h:1686
void SetPrecision(const BCEngineMCMC *other)
Copy precision for the MCMC run from other model.
Definition: BCEngineMCMC.h:984
void SetNIterationsPreRunMax(unsigned n)
Sets the maximum number of iterations in the pre-run.
Definition: BCEngineMCMC.h:784
bool MetropolisPreRun()
Runs a pre run for the Metropolis algorithm.
Definition: BCEngineMCMC.cxx:1762
bool MarginalizedHistogramExists(unsigned index) const
Definition: BCEngineMCMC.h:511
std::vector< std::vector< double > > fMCMCInitialPosition
The intial position of each Markov chain.
Definition: BCEngineMCMC.h:1714
double GetScaleFactorUpperLimit() const
Definition: BCEngineMCMC.h:353
void SetFillHistogramParObs(const std::string &x, const std::string &y, bool flag=true)
Sets whether to fill particular H2 histogram: obs(y) vs.
Definition: BCEngineMCMC.h:934
BCObservable & GetObservable(unsigned index)
Definition: BCEngineMCMC.h:685
virtual unsigned Index(const std::string &name) const
Find index of parameter identified by name; return Size() if name not found.
Definition: BCVariableSet.h:157
const std::vector< BCEngineMCMC::Statistics > & GetStatisticsVector() const
Get vector of MCMC statistics for each chain separately.
Definition: BCEngineMCMC.h:487
void SetFillHistogramObsPar(const std::string &x, const std::string &y, bool flag=true)
Sets whether to fill particular H2 histogram: par(y) vs.
Definition: BCEngineMCMC.h:962
virtual void Remarginalize(bool autorange=true)
Marginalize from TTree.
Definition: BCEngineMCMC.cxx:1253
bool fCorrectRValueForSamplingVariability
flag for correcting R value for initial sampling variability.
Definition: BCEngineMCMC.h:1760
void SetProposalFunctionDof(double dof=1)
Set the degree of freedom of the proposal function for MCMC.
Definition: BCEngineMCMC.h:878
const BCObservable & GetObservable(const std::string &name) const
Definition: BCEngineMCMC.h:706
virtual bool Fix(double value)
Fix parameter to value (set prior to delta).
Definition: BCParameter.h:141
virtual void CalculateObservables(const std::vector< double > &pars)
Evaluates user-defined observables.
Definition: BCEngineMCMC.h:1292
TTree * GetMarkovChainTree() const
Retrieve the tree containing the Markov chain.
Definition: BCEngineMCMC.h:461
virtual unsigned int GetNFixedParameters() const
Definition: BCParameterSet.cxx:23
virtual bool AddParameter(const std::string &name, double min, double max, const std::string &latexname="", const std::string &unitstring="")
Definition: BCEngineMCMC.h:1246
void UpdateChainIndex(int chain)
Keep track of which chain is currently computed (within a thread).
Definition: BCEngineMCMC.cxx:3750
TTree * fParameterTree
The tree containing the parameter information.
Definition: BCEngineMCMC.h:1809
void LoadMCMC(const std::string &filename, std::string mcmcTreeName="", std::string parameterTreeName="", bool loadObservables=true)
Load previous MCMC run.
Definition: BCEngineMCMC.cxx:1138
unsigned n_samples_efficiency
number of samples used to calculate efficiencies
Definition: BCEngineMCMC.h:207
virtual void MCMCUserIterationInterface()
Interface allowing to execute arbitrary code for each iteration of the MCMC while running the chains ...
Definition: BCEngineMCMC.h:1428
bool GetNewPointMetropolis()
Generate a new point using the Metropolis algorithm for all chains.
Definition: BCEngineMCMC.cxx:1647
std::string fMCMCOutputFileOption
Output file open option for for writing MCMC Tree.
Definition: BCEngineMCMC.h:1664
static double RValue(const std::vector< double > &means, const std::vector< double > &variances, unsigned n, bool correctForSamplingVariability=true)
Calculate R value of set of batches of samples—represented by their means and variances, all batches containing the same number of samples—according to Brooks & Gelman, "General Methods for Monitoring Convergence of Iterative Simulations," (1988)
Definition: BCEngineMCMC.cxx:2106
const BCParameter & GetParameter(const std::string &name) const
Definition: BCEngineMCMC.h:651
const BCParameter & GetParameter(unsigned index) const
Definition: BCEngineMCMC.h:637
Wrapper to allow access by name into list of BCParameter.
Definition: BCParameterSet.h:30
virtual std::vector< std::pair< unsigned, unsigned > > GetH2DPrintOrder() const
Definition: BCEngineMCMC.cxx:2902
void SetMultivariateCovarianceUpdateLambda(double l)
Set weighting for multivariate proposal function covariance update.
Definition: BCEngineMCMC.h:886
std::vector< std::vector< double > > fMCMCProposalFunctionScaleFactor
Scale factors for proposal functions.
Definition: BCEngineMCMC.h:1678
std::string fMCMCOutputFilename
Output filename for for writing MCMC Tree.
Definition: BCEngineMCMC.h:1660
double GetMultivariateScaleMultiplier() const
Definition: BCEngineMCMC.h:431
const std::vector< double > & GetLocalModes(bool force_recalculation=false)
Definition: BCEngineMCMC.cxx:648
void SetInitialPositions(const std::vector< std::vector< double > > &x0s)
Sets the initial positions for all chains.
Definition: BCEngineMCMC.h:830
void WriteMarginalizedDistributions(const std::string &filename, const std::string &option, bool closeExistingFile=false)
Write marginalization histograms to file.
Definition: BCEngineMCMC.cxx:464
double GetRValueParameters(unsigned index) const
Definition: BCEngineMCMC.h:447
Definition: libBAT_rdict.cxx:16
unsigned fMultivariateCovarianceUpdates
Number of multivariate-proposal-function covariance updates performed.
Definition: BCEngineMCMC.h:1695
unsigned GetInitialPositionAttemptLimit() const
Definition: BCEngineMCMC.h:398
const BCObservable & GetObservable(unsigned index) const
Definition: BCEngineMCMC.h:692
unsigned GetNIterationsPreRunCheck() const
Definition: BCEngineMCMC.h:328
unsigned PrintParameterPlot(const std::string &filename, int npar=10, double interval_content=68e-2, std::vector< double > quantile_values=std::vector< double >(0), bool rescale_ranges=true) const
Print a summary plot for the parameters and user-defined observables.
Definition: BCEngineMCMC.cxx:2986
TTree * GetParameterTree() const
Retrieve the tree containing the parameter information.
Definition: BCEngineMCMC.h:466
void WriteMarkovChain(bool flag)
Turn on/off writing of Markov chain to root file.
Definition: BCEngineMCMC.h:1016
const BCEngineMCMC::Statistics & GetStatistics() const
Get combined statistics for all chains.
Definition: BCEngineMCMC.h:476
void CalculateCholeskyDecompositions()
Calculate Cholesky decompositions needed for multivariate proposal function.
Definition: BCEngineMCMC.cxx:1471
void PrintParameters(const std::vector< double > &P, void(*output)(const std::string &)=BCLog::OutSummary) const
Print parameters.
Definition: BCEngineMCMC.cxx:2881
BCH1D fBCH1DdrawingOptions
A BCH1D (with no histogram) for storing BCH1D drawing options.
Definition: BCEngineMCMC.h:1817
std::vector< std::pair< int, int > > fRequestedH2
Vector of pairs of indices for which 2D histograms should be stored.
Definition: BCEngineMCMC.h:1785
unsigned GetNIterationsPreRunMax() const
Definition: BCEngineMCMC.h:318
bool PrintCorrelationPlot(const std::string &filename="correlation.pdf", bool include_observables=true) const
Print a correlation plot for the parameters.
Definition: BCEngineMCMC.cxx:3397
void SetFlagPreRun(bool flag)
Set if a (new) prerun should be performed.
Definition: BCEngineMCMC.h:966
virtual bool Add(const T &var)
Add a variable if no variable of same name exists yet.
Definition: BCVariableSet.h:56
virtual void CreateHistograms(bool rescale_ranges=false)
Create histograms from parameter and observable sets.
Definition: BCEngineMCMC.cxx:2596
const std::vector< double > & GetRValueParameters() const
Definition: BCEngineMCMC.h:441
void SetFillHistogramObsPar(unsigned x, unsigned y, bool flag=true)
Sets whether to fill particular H2 histogram: par(y) vs.
Definition: BCEngineMCMC.h:955
virtual void FillHistograms(bool flag)
Set fill-histograms flag for 1D and 2D histograms for all parameters.
Definition: BCVariableSet.h:197
randomly distribute according to factorized priors
Definition: BCEngineMCMC.h:86
bool GetProposalPointMetropolis(unsigned chain, std::vector< double > &x)
Return a proposal point for the Metropolis algorithm.
Definition: BCEngineMCMC.cxx:1528
std::vector< double > efficiency
efficiencies for each parameter (NB: not stored for observables)
Definition: BCEngineMCMC.h:208
virtual bool ParameterTreeMatchesModel(TTree *partree, bool checkObservables=true)
Check parameter tree against model.
Definition: BCEngineMCMC.cxx:1065
bool PrintParameterLatex(const std::string &filename) const
Print a LaTeX table of the parameters.
Definition: BCEngineMCMC.cxx:3533
void SetRescaleHistogramRangesAfterPreRun(bool flag=true)
Set flag for rescaling histogram ranges after pre-run.
Definition: BCEngineMCMC.h:1004
TH2 * GetMarginalizedHistogram(const std::string &name1, const std::string &name2) const
Obtain the individual marginalized distributions with respect to two parameters as a ROOT TH2...
Definition: BCEngineMCMC.h:544
bool GetCorrectRValueForSamplingVariability() const
Flag for correcting convergence checking for initial sampling variability.
Definition: BCEngineMCMC.h:451
unsigned fInitialPositionAttemptLimit
Maximum number of attempts to make to set the initial position.
Definition: BCEngineMCMC.h:1731
void SetPrior(unsigned index, TF1 &f, bool logL=true)
Definition: BCEngineMCMC.cxx:315
const BCEngineMCMC::Statistics & GetStatistics(unsigned c) const
Get MCMC statistics for one chain.
Definition: BCEngineMCMC.h:482
double GetHistogramRescalePadding() const
Definition: BCEngineMCMC.h:497
void SetPrior(const std::string &name, TF1 &f, bool logL=true)
Definition: BCEngineMCMC.h:1075
unsigned GetMaximumParameterNameLength(bool observables=true) const
Definition: BCEngineMCMC.h:592
virtual void MCMCCurrentPointInterface(const std::vector< double > &point, int ichain, bool accepted)
Interface allowing to execute arbitrary code for each new point of the MCMC whether it is accepted or...
Definition: BCEngineMCMC.h:1441
double fMCMCProposalFunctionDof
Degree of freedom of Student's t proposal.
Definition: BCEngineMCMC.h:1740
bool DrawParameterPlot(unsigned i0, unsigned npar=0, double interval_content=68e-2, std::vector< double > quantile_values=std::vector< double >(0), bool rescale_ranges=true) const
Draw a summary plot for the parameters in the range provided to current pad.
Definition: BCEngineMCMC.cxx:3026
unsigned GetMultivariateCovarianceUpdates() const
Definition: BCEngineMCMC.h:416
virtual void MCMCUserInitialize()
User hook called from MCMCInitialize().
Definition: BCEngineMCMC.h:1404
unsigned fMCMCNIterationsPreRunMin
Minimum number of iterations for the pre-run.
Definition: BCEngineMCMC.h:1644
void SetInitialPositionScheme(BCEngineMCMC::InitialPositionScheme scheme)
Sets flag which defines initial position.
Definition: BCEngineMCMC.h:835
void UpdateParameterTree()
Update Paramater TTree with scales and efficiencies.
Definition: BCEngineMCMC.cxx:817
virtual unsigned int GetNFreeParameters() const
Definition: BCParameterSet.h:48
int fMCMCNIterationsConvergenceGlobal
Number of iterations needed for all chains to convergence simultaneously.
Definition: BCEngineMCMC.h:1632
void SetPrecision(BCEngineMCMC::Precision precision)
Set the precision for the MCMC run.
Definition: BCEngineMCMC.cxx:353
std::vector< double > fMCMCInitialScaleFactors
User-provided initial values of the scale factors of the factorized proposal function.
Definition: BCEngineMCMC.h:1682
virtual std::vector< unsigned > GetH1DPrintOrder() const
Definition: BCEngineMCMC.cxx:2891
BCAux::BCTrash< TObject > fObjectTrash
Storage for plot objects with proper clean-up.
Definition: BCEngineMCMC.h:1832
bool fMCMCProposeMultivariate
Flag for using multivariate proposal function.
Definition: BCEngineMCMC.h:1735
BCObservable & GetObservable(const std::string &name)
Definition: BCEngineMCMC.h:699
virtual void InitializeMarkovChainTree(bool replacetree=false, bool replacefile=false)
Initialize the trees containing the Markov chains and parameter info.
Definition: BCEngineMCMC.cxx:703
double fHistogramRescalePadding
factor for enlarging range of histograms when rescaling.
Definition: BCEngineMCMC.h:1829
double fMultivariateEpsilon
multivariate-proposal-function cholesky-decomposition nudge.
Definition: BCEngineMCMC.h:1703
virtual const std::vector< double > & GetBestFitParameterErrors() const
Definition: BCEngineMCMC.cxx:639
A struct for holding statistical information about samples.
Definition: BCEngineMCMC.h:187
std::vector< TMatrixD > fMultivariateProposalFunctionCholeskyDecomposition
Cholesky decompositions for multivariate proposal function.
Definition: BCEngineMCMC.h:1691
void SetNbins(unsigned int nbins)
Set the number of bins for the marginalized distribution of all parameters.
Definition: BCEngineMCMC.h:994
int GetNIterationsConvergenceGlobal() const
Definition: BCEngineMCMC.h:301
virtual bool AddObservable(const std::string &name, double min, double max, const std::string &latexname="", const std::string &unitstring="")
Definition: BCEngineMCMC.h:1266
void SetRValueParametersCriterion(double r)
Sets the parameter R-value criterion for convergence of all chains.
Definition: BCEngineMCMC.h:971
virtual void PrintModelSummary() const
Print model summary to log.
Definition: BCEngineMCMC.cxx:2746
BCEngineMCMC::Statistics fMCMCStatistics_AllChains
Statistics across all Markov chains.
Definition: BCEngineMCMC.h:1756
void SetNChains(unsigned n)
Sets the number of Markov chains which are run in parallel.
Definition: BCEngineMCMC.h:775
unsigned fMCMCPreRunCheckClear
Number of iterations between clearing of convergence stats in pre-run.
Definition: BCEngineMCMC.h:1627
unsigned fMCMCNIterationsRun
Number of iterations for a Markov chain run.
Definition: BCEngineMCMC.h:1640
const std::vector< std::vector< double > > & GetScaleFactors() const
Definition: BCEngineMCMC.h:358
unsigned PrintAllMarginalized(const std::string &filename, unsigned hdiv=1, unsigned vdiv=1) const
Print all marginalizations.
Definition: BCEngineMCMC.cxx:2932
bool MarginalizedHistogramExists(unsigned index1, unsigned index2) const
Definition: BCEngineMCMC.h:518
virtual void PrintMarginalizationSummary() const
Print marginalization to log.
Definition: BCEngineMCMC.cxx:2809
std::vector< std::vector< TH2 * > > fH2Marginalized
Vector of 2D marginalized distributions.
Definition: BCEngineMCMC.h:1779
std::string fSafeName
Safe name of the engine for use in naming ROOT objects.
Definition: BCEngineMCMC.h:1597
std::vector< BCEngineMCMC::Statistics > fMCMCStatistics
Statistics for each Markov chain.
Definition: BCEngineMCMC.h:1752
virtual double LogEval(const std::vector< double > ¶meters)=0
Needs to be overloaded in the derived class.
std::vector< TH1 * > fH1Marginalized
Vector of 1D marginalized distributions.
Definition: BCEngineMCMC.h:1775
void SetFillHistogramObsObs(const std::string &x, const std::string &y, bool flag=true)
Sets whether to fill particular H2 histogram: obs(y) vs.
Definition: BCEngineMCMC.h:948
void SetMultivariateEpsilon(double epsilon)
Sets multivariate-proposal-function cholesky-decomposition nudge.
Definition: BCEngineMCMC.h:891
bool fMCMCTreeReuseObservables
flag for whether to reuse MCMC Tree's observables.
Definition: BCEngineMCMC.h:1797
virtual bool UpdateMultivariateProposalFunctionCovariances()
Update multivariate proposal function covariances.
Definition: BCEngineMCMC.cxx:1459
bool ValidParameterTree(TTree *tree) const
Check tree structure for parameter tree.
Definition: BCEngineMCMC.cxx:894
double GetRValueParametersCriterion() const
Definition: BCEngineMCMC.h:436
bool GetProposeMultivariate() const
Definition: BCEngineMCMC.h:403
void LoadMCMCParameters(TTree &partree)
Load MCMC parameters from parameter tree: nchains, proposal function type, scales.
Definition: BCEngineMCMC.cxx:999
void WriteMarkovChainRun(bool flag)
Turn on/off writing of Markov chain to root file during run.
Definition: BCEngineMCMC.cxx:430
const ChainState & GetChainState(unsigned c) const
Definition: BCEngineMCMC.h:364
const std::vector< double > & Getx(unsigned c) const
Definition: BCEngineMCMC.h:370
void SetFillHistogramObsObs(unsigned x, unsigned y, bool flag=true)
Sets whether to fill particular H2 histogram: obs(y) vs.
Definition: BCEngineMCMC.h:941
void SetFillHistogramParObs(unsigned x, unsigned y, bool flag=true)
Sets whether to fill particular H2 histogram: obs(y) vs.
Definition: BCEngineMCMC.h:927
std::vector< ChainState > fMCMCStates
The current states of each Markov chain.
Definition: BCEngineMCMC.h:1748
void SetFlagFillHistograms(bool flag_1d, bool flag_2d)
Sets the whether to fill histograms.
Definition: BCEngineMCMC.h:906
void SetPriorGauss(unsigned index, double mean, double sigma)
Definition: BCEngineMCMC.cxx:330
void LoadParametersFromTree(TTree *partree, bool loadObservables=true)
Load parameters and observables from tree.
Definition: BCEngineMCMC.cxx:918
BCEngineMCMC::InitialPositionScheme GetInitialPositionScheme() const
Definition: BCEngineMCMC.h:393
double GetProposalFunctionDof() const
Definition: BCEngineMCMC.h:411
bool PrintCorrelationMatrix(const std::string &filename="matrix.pdf") const
Print a correlation matrix for the parameters.
Definition: BCEngineMCMC.cxx:3278
void SetInitialPositionAttemptLimit(unsigned n)
Sets maximum number of attempts to find a valid initial position.
Definition: BCEngineMCMC.h:840
BCEngineMCMC::InitialPositionScheme fInitialPositionScheme
Variable which defines the initial position.
Definition: BCEngineMCMC.h:1727
void MCMCInitialize()
Resets all containers used in MCMC and initializes starting points.
Definition: BCEngineMCMC.cxx:2393
unsigned GetNIterationsPreRun() const
Definition: BCEngineMCMC.cxx:622
const BCVariable & GetVariable(unsigned index) const
Definition: BCEngineMCMC.h:608
virtual const std::vector< double > & GetBestFitParameters() const
Definition: BCEngineMCMC.cxx:633
unsigned GetNFixedParameters() const
Definition: BCEngineMCMC.h:662
void SetPriorGauss(const std::string &name, double mean, double sigma)
Definition: BCEngineMCMC.h:1108
virtual bool AddObservable(BCObservable &obs)
Definition: BCEngineMCMC.h:1274
void SetFillHistogram(int x, int y, bool flag)
Set whether to fill 2D histogram y vs x: positive indices for parameters; negative for observables...
Definition: BCEngineMCMC.cxx:2574
virtual std::string GetBestFitSummary(unsigned i) const
Get string summarizing best fit for single variable.
Definition: BCEngineMCMC.cxx:2792
void SetPriorConstant(const std::string &name)
Definition: BCEngineMCMC.h:1058
double fMultivariateScaleMultiplier
factor to multiply or divide scale factors by in adjusting multivariate-proposal-function scales...
Definition: BCEngineMCMC.h:1707
TH1 * GetMarginalizedHistogram(const std::string &name) const
Obtain the individual marginalized distributions with respect to one parameter as a ROOT TH1...
Definition: BCEngineMCMC.h:527
unsigned fMCMCNIterationsPreRunCheck
Number of iterations between scale adjustments and convergence checks in pre-run. ...
Definition: BCEngineMCMC.h:1623
unsigned GetNIterationsPreRunMin() const
Definition: BCEngineMCMC.h:313
double GetScaleFactorLowerLimit() const
Definition: BCEngineMCMC.h:348
BCH2D GetMarginalized(const std::string &name1, const std::string &name2) const
Obtain the individual marginalized distributions with respect to two parameters.
Definition: BCEngineMCMC.h:578
void SetMultivariateScaleMultiplier(double s)
Sets multivariate-proposal-function scale multiplier.
Definition: BCEngineMCMC.h:896
virtual void EvaluateObservables()
Evaluates user-defined observables at current state of all chains and stores results in fMCMCState...
Definition: BCEngineMCMC.cxx:2344
virtual void SetNBins(unsigned nbins)
Set number of bins for all parameters.
Definition: BCVariableSet.h:179
void SetPreRunCheckClear(unsigned n)
Sets the number of prerun checks to make inbetween statistics clearing.
Definition: BCEngineMCMC.h:805
bool fRescaleHistogramRangesAfterPreRun
flag for rescaling of histograms after pre-run.
Definition: BCEngineMCMC.h:1825
void SetFillHistogramParPar(unsigned x, unsigned y, bool flag=true)
Sets whether to fill particular H2 histogram: par(y) vs.
Definition: BCEngineMCMC.h:913
virtual bool AddParameter(BCParameter ¶meter)
Definition: BCEngineMCMC.h:1254
void WriteMarkovChainPreRun(bool flag)
Turn on/off writing of Markov chain to root file during prerun.
Definition: BCEngineMCMC.cxx:438
double GetMultivariateEpsilon() const
Definition: BCEngineMCMC.h:426
void SetCorrectRValueForSamplingVariability(bool flag=true)
Set flag to correct convergence checking for initial sampling variability.
Definition: BCEngineMCMC.h:975
double fMCMCRValueParametersCriterion
The R-value criterion for convergence of parameters.
Definition: BCEngineMCMC.h:1764
double fMultivariateCovarianceUpdateLambda
weighting parameter for multivariate-proposal-function covariance update.
Definition: BCEngineMCMC.h:1699
const BCObservableSet & GetObservables() const
Definition: BCEngineMCMC.h:678
void SetMaximumEfficiency(double efficiency)
Sets the maximum efficiency required for a chain.
Definition: BCEngineMCMC.h:815
virtual double ProposalFunction(unsigned ichain, unsigned ipar)
The default proposal function is a Breit-Wigner random walk.
Definition: BCEngineMCMC.cxx:1519
double GetMaximumEfficiency() const
Definition: BCEngineMCMC.h:343
BCParameter & GetParameter(const std::string &name)
Definition: BCEngineMCMC.h:644
unsigned fMCMCNIterationsPreRunMax
Maximum number of iterations for a Markov chain prerun.
Definition: BCEngineMCMC.h:1636
void SetHistogramRescalingPadding(double factor)
Set enlargement factor of range for when rescaling.
Definition: BCEngineMCMC.h:1009
void InChainFillHistograms()
Fill marginalized distributions from all chain states.
Definition: BCEngineMCMC.cxx:1718
std::vector< double > fMCMCRValueParameters
The R-values for each parameter.
Definition: BCEngineMCMC.h:1767
void PrepareToContinueMarginalization(const std::string &filename, const std::string &mcmcTreeName="", const std::string ¶meterTreeName="", bool loadObservables=true, bool autorange=true)
Continue the marginalization already stored in another file.
Definition: BCEngineMCMC.cxx:1419
bool AcceptOrRejectPoint(unsigned chain, unsigned parameter)
Accept or rejects a point for a chain and updates efficiency.
Definition: BCEngineMCMC.cxx:1580
void SetPriorDelta(unsigned index, double value)
Definition: BCEngineMCMC.h:1083
void SetNIterationsPreRunMin(unsigned n)
Sets the minimum number of iterations in the pre-run.
Definition: BCEngineMCMC.h:794
virtual T & Get(const std::string &name)
Safe access, but slightly less efficient access to parameter.
Definition: BCVariableSet.h:134
BCH1D GetMarginalized(const std::string &name) const
Obtain the individual marginalized distributions with respect to one parameter.
Definition: BCEngineMCMC.h:561
void SetFillHistogramParPar(const std::string &x, const std::string &y, bool flag=true)
Sets whether to fill particular H2 histogram: par(y) vs.
Definition: BCEngineMCMC.h:920
virtual T & At(unsigned index)
Safe access, but slightly less efficient access to parameter.
Definition: BCVariableSet.h:120
void SetPriorDelta(const std::string &name, double value)
Definition: BCEngineMCMC.h:1091
void SetInitialScaleFactors(const std::vector< double > &scale)
Set the initial scale factors for the factorized proposal function.
Definition: BCEngineMCMC.h:770
bool ValidMCMCTree(TTree *tree, bool checkObservables=true) const
Check tree structure for MCMC tree.
Definition: BCEngineMCMC.cxx:874
A struct for holding a state in a Markov chain.
Definition: BCEngineMCMC.h:159
std::vector< std::vector< double > > covariance
covariances of all pairs of variables
Definition: BCEngineMCMC.h:199
randomly distribute uniformly over parameter ranges
Definition: BCEngineMCMC.h:84
unsigned UpdateFrequency(unsigned N) const
return appropriate update interval
Definition: BCEngineMCMC.cxx:3639
void SetFlagFillHistograms(bool flag)
Sets whether to fill histograms.
Definition: BCEngineMCMC.h:901
void SetInitialPositions(const std::vector< double > &x0s)
Sets the initial positions for all chains.
Definition: BCEngineMCMC.cxx:673
void SetPriorGauss(const std::string &name, double mode, double sigma_below, double sigma_above)
Definition: BCEngineMCMC.h:1127