BayesianAnalysisToolkit
0.9.3
|
A class for handling numerical operations for models. More...
#include <BCIntegrate.h>
Public Types | |
Enumerators | |
enum | BCOptimizationMethod { kOptEmpty, kOptSimAnn, kOptMetropolis, kOptMinuit, kOptDefault, NOptMethods } |
enum | BCIntegrationMethod { kIntEmpty, kIntMonteCarlo, kIntCuba, kIntGrid, kIntDefault, NIntMethods } |
enum | BCMarginalizationMethod { kMargEmpty, kMargMetropolis, kMargMonteCarlo, kMargGrid, kMargDefault, NMargMethods } |
enum | BCSASchedule { kSACauchy, kSABoltzmann, kSACustom, NSAMethods } |
enum | BCCubaMethod { kCubaVegas, kCubaSuave, kCubaDivonne, kCubaCuhre, NCubaMethods } |
Function pointer types | |
typedef void(BCIntegrate::* | tRandomizer )(std::vector< double > &) const |
typedef double(BCIntegrate::* | tEvaluator )(std::vector< double > &, const std::vector< double > &, bool &) |
typedef void(* | tIntegralUpdater )(const std::vector< double > &, const int &, double &, double &) |
![]() | |
enum | Precision { kLow, kMedium, kHigh, kVeryHigh } |
Public Member Functions | |
Constructors and destructors | |
BCIntegrate () | |
BCIntegrate (const BCIntegrate &bcintegrate) | |
virtual | ~BCIntegrate () |
Assignment operators | |
BCIntegrate & | operator= (const BCIntegrate &bcintegrate) |
Member functions (get) | |
int | ReadMarginalizedFromFile (const char *file) |
BCH1D * | GetMarginalized (const BCParameter *parameter) |
BCH1D * | GetMarginalized (const char *name) |
BCH1D * | GetMarginalized (unsigned index) |
BCH2D * | GetMarginalized (const BCParameter *parameter1, const BCParameter *parameter2) |
BCH2D * | GetMarginalized (const char *name1, const char *name2) |
BCH2D * | GetMarginalized (unsigned index1, unsigned index2) |
int | PrintAllMarginalized1D (const char *filebase) |
int | PrintAllMarginalized2D (const char *filebase) |
int | PrintAllMarginalized (const char *file, std::string options1d="BTsiB3CS1D0pdf0Lmeanmode", std::string options2d="BTfB3CS1meangmode", unsigned int hdiv=1, unsigned int ndiv=1) |
double | GetIntegral () const |
BCIntegrate::BCOptimizationMethod | GetOptimizationMethod () const |
BCIntegrate::BCIntegrationMethod | GetIntegrationMethod () const |
BCIntegrate::BCMarginalizationMethod | GetMarginalizationMethod () const |
BCIntegrate::BCSASchedule | GetSASchedule () const |
void | GetRandomVectorUnitHypercube (std::vector< double > &x) const |
void | GetRandomVectorInParameterSpace (std::vector< double > &x) const |
double | GetRandomPoint (std::vector< double > &x) |
int | GetNIterationsMin () const |
int | GetNIterationsMax () const |
int | GetNIterationsPrecisionCheck () const |
int | GetNIterationsOutput () const |
int | GetNIterations () const |
double | GetRelativePrecision () const |
double | GetAbsolutePrecision () const |
BCCubaMethod | GetCubaIntegrationMethod () const |
const BCCubaOptions::Vegas & | GetCubaVegasOptions () const |
const BCCubaOptions::Suave & | GetCubaSuaveOptions () const |
const BCCubaOptions::Divonne & | GetCubaDivonneOptions () const |
const BCCubaOptions::Cuhre & | GetCubaCuhreOptions () const |
BCH1D * | GetSlice (const BCParameter *parameter, const std::vector< double > parameters=std::vector< double >(0), int bins=0, bool flag_norm=true) |
BCH1D * | GetSlice (const char *name, const std::vector< double > parameters=std::vector< double >(0), int nbins=0, bool flag_norm=true) |
BCH2D * | GetSlice (const BCParameter *parameter1, const BCParameter *parameter2, const std::vector< double > parameters=std::vector< double >(0), int bins=0, bool flag_norm=true) |
BCH2D * | GetSlice (const char *name1, const char *name2, const std::vector< double > parameters=std::vector< double >(0), int nbins=0, bool flag_norm=true) |
BCH2D * | GetSlice (unsigned index1, unsigned index2, const std::vector< double > parameters=std::vector< double >(0), int nbins=0, bool flag_norm=true) |
double | GetError () const |
TMinuit * | GetMinuit () |
int | GetMinuitErrorFlag () const |
double | GetSAT0 () const |
double | GetSATmin () const |
double | GetBestFitParameter (unsigned index) const |
double | GetBestFitParameterError (unsigned index) const |
double | GetLogMaximum () |
const std::vector< double > & | GetBestFitParameters () const |
const std::vector< double > & | GetBestFitParameterErrors () const |
Member functions (set) | |
void | SetMinuitArlist (double *arglist) |
void | SetFlagIgnorePrevOptimization (bool flag) |
void | SetOptimizationMethod (BCIntegrate::BCOptimizationMethod method) |
void | SetIntegrationMethod (BCIntegrate::BCIntegrationMethod method) |
void | SetMarginalizationMethod (BCIntegrate::BCMarginalizationMethod method) |
void | SetSASchedule (BCIntegrate::BCSASchedule schedule) |
void | SetNIterationsMin (int niterations) |
void | SetNIterationsMax (int niterations) |
void | SetNIterationsPrecisionCheck (int niterations) |
void | SetNIterationsOutput (int niterations) |
void | SetRelativePrecision (double relprecision) |
void | SetAbsolutePrecision (double absprecision) |
void | SetCubaIntegrationMethod (BCCubaMethod type) |
void | SetCubaOptions (const BCCubaOptions::Vegas &options) |
void | SetCubaOptions (const BCCubaOptions::Suave &options) |
void | SetCubaOptions (const BCCubaOptions::Divonne &options) |
void | SetCubaOptions (const BCCubaOptions::Cuhre &options) |
void | SetSAT0 (double T0) |
void | SetSATmin (double Tmin) |
void | SetFlagWriteSAToFile (bool flag) |
TTree * | GetSATree () |
void | InitializeSATree () |
![]() | |
void | WriteMarkovChain (bool flag) |
BCEngineMCMC () | |
BCEngineMCMC (const BCEngineMCMC &enginemcmc) | |
virtual | ~BCEngineMCMC () |
BCEngineMCMC & | operator= (const BCEngineMCMC &engineMCMC) |
unsigned | MCMCGetNChains () const |
unsigned | MCMCGetNLag () const |
const std::vector< unsigned > & | MCMCGetNIterations () const |
unsigned | MCMCGetCurrentIteration () const |
unsigned | MCMCGetCurrentChain () const |
unsigned | MCMCGetNIterationsConvergenceGlobal () const |
bool | MCMCGetFlagConvergenceGlobal () const |
unsigned | MCMCGetNIterationsMax () const |
unsigned | MCMCGetNIterationsRun () const |
unsigned | MCMCGetNIterationsPreRunMin () const |
unsigned | MCMCGetNIterationsUpdate () const |
unsigned | MCMCGetNIterationsUpdateMax () const |
std::vector< int > | MCMCGetNTrialsTrue () const |
int | MCMCGetNTrials () const |
const std::vector< double > & | MCMCGetprobMean () const |
const std::vector< double > & | MCMCGetVariance () const |
const std::vector< double > & | MCMCGetTrialFunctionScaleFactor () const |
std::vector< double > | MCMCGetTrialFunctionScaleFactor (unsigned ichain) const |
double | MCMCGetTrialFunctionScaleFactor (unsigned ichain, unsigned ipar) |
const std::vector< double > & | MCMCGetx () const |
std::vector< double > | MCMCGetx (unsigned ichain) |
double | MCMCGetx (unsigned ichain, unsigned ipar) const |
const std::vector< double > & | MCMCGetLogProbx () const |
double | MCMCGetLogProbx (unsigned ichain) |
int | MCMCGetPhase () const |
const std::vector< double > & | MCMCGetMaximumPoints () const |
std::vector< double > | MCMCGetMaximumPoint (unsigned i) const |
const std::vector< double > & | MCMCGetMaximumLogProb () const |
int | MCMCGetFlagInitialPosition () const |
double | MCMCGetRValueCriterion () const |
double | MCMCGetRValueParametersCriterion () const |
double | MCMCGetRValue () const |
double | MCMCGetRValueParameters (unsigned i) |
bool | MCMCGetRValueStrict () const |
bool | MCMCGetFlagRun () const |
TTree * | MCMCGetMarkovChainTree (unsigned i) |
BCH1D * | MCMCGetH1Marginalized (unsigned i) |
BCH2D * | MCMCGetH2Marginalized (unsigned i, unsigned j) |
BCParameter * | GetParameter (int index) const |
BCParameter * | GetParameter (const char *name) const |
unsigned int | GetNParameters () const |
unsigned int | GetNFixedParameters () |
unsigned int | GetNFreeParameters () |
const std::vector< double > & | GetBestFitParametersMarginalized () const |
void | MCMCSetTrialFunctionScaleFactor (std::vector< double > scale) |
void | MCMCSetNChains (unsigned n) |
void | MCMCSetNLag (unsigned n) |
void | MCMCSetNIterationsMax (unsigned n) |
void | MCMCSetNIterationsRun (unsigned n) |
void | MCMCSetNIterationsPreRunMin (unsigned n) |
void | MCMCSetNIterationsUpdate (unsigned n) |
void | MCMCSetNIterationsUpdateMax (unsigned n) |
void | MCMCSetMinimumEfficiency (double efficiency) |
void | MCMCSetMaximumEfficiency (double efficiency) |
void | MCMCSetRandomSeed (unsigned seed) |
void | MCMCSetWriteChainToFile (bool flag) |
void | MCMCSetWritePreRunToFile (bool flag) |
void | MCMCSetInitialPositions (const std::vector< double > &x0s) |
void | MCMCSetInitialPositions (std::vector< std::vector< double > > x0s) |
void | MCMCSetFlagInitialPosition (int flag) |
void | MCMCSetFlagOrderParameters (bool flag) |
void | MCMCSetFlagFillHistograms (bool flag) |
void | MCMCSetFlagPreRun (bool flag) |
void | MCMCSetRValueCriterion (double r) |
void | MCMCSetRValueParametersCriterion (double r) |
void | MCMCSetRValueStrict (bool strict=true) |
void | MCMCSetMarkovChainTrees (const std::vector< TTree * > &trees) |
void | MCMCInitializeMarkovChainTrees () |
int | SetMarginalized (unsigned index, TH1D *h) |
int | SetMarginalized (unsigned index1, unsigned index2, TH2D *h) |
void | MCMCSetValuesDefault () |
void | MCMCSetValuesQuick () |
void | MCMCSetValuesDetail () |
void | MCMCSetPrecision (BCEngineMCMC::Precision precision) |
void | SetNbins (unsigned int nbins) |
void | Copy (const BCEngineMCMC &enginemcmc) |
virtual int | AddParameter (const char *name, double min, double max, const char *latexname="") |
virtual int | AddParameter (BCParameter *parameter) |
virtual void | MCMCTrialFunction (unsigned ichain, std::vector< double > &x) |
virtual double | MCMCTrialFunctionSingle (unsigned ichain, unsigned ipar) |
bool | MCMCGetProposalPointMetropolis (unsigned chain, std::vector< double > &x) |
bool | MCMCGetProposalPointMetropolis (unsigned chain, unsigned parameter, std::vector< double > &x) |
bool | MCMCGetNewPointMetropolis (unsigned chain=0) |
bool | MCMCGetNewPointMetropolis (unsigned chain, unsigned parameter) |
void | MCMCInChainCheckMaximum () |
void | MCMCInChainUpdateStatistics () |
void | MCMCInChainFillHistograms () |
void | MCMCInChainTestConvergenceAllChains () |
void | MCMCInChainWriteChains () |
int | MCMCMetropolis () |
int | MCMCMetropolisPreRun () |
void | MCMCResetRunStatistics () |
void | MCMCInitializeMarkovChains () |
int | MCMCInitialize () |
void | ClearParameters (bool hard=false) |
virtual void | MCMCIterationInterface () |
virtual void | MCMCUserIterationInterface () |
virtual void | MCMCCurrentPointInterface (std::vector< double > &, int, bool) |
Protected Member Functions | |
unsigned | IntegrationOutputFrequency () const |
void | LogOutputAtStartOfIntegration (BCIntegrationMethod type, BCCubaMethod cubatype) |
void | LogOutputAtIntegrationStatusUpdate (BCIntegrationMethod type, double integral, double absprecision, int nIterations) |
void | LogOutputAtEndOfIntegration (double integral, double absprecision, double relprecision, int nIterations) |
void | Copy (const BCIntegrate &bcintegrate) |
Private Member Functions | |
std::vector< double > | FindModeMinuit (std::vector< double > &mode, std::vector< double > &errors, std::vector< double > start=std::vector< double >(0), int printlevel=1) |
std::vector< double > | FindModeMCMC (std::vector< double > &mode, std::vector< double > &errors) |
std::vector< double > | FindModeSA (std::vector< double > &mode, std::vector< double > &errors, std::vector< double > start=std::vector< double >(0)) |
double | IntegrateCuba () |
double | IntegrateCuba (BCCubaMethod cubatype) |
double | IntegrateSlice () |
Member functions (miscellaneous methods) | |
virtual double | Eval (const std::vector< double > &x) |
virtual double | LogEval (const std::vector< double > &x) |
double | Normalize () |
double | Integrate (BCIntegrationMethod intmethod) |
double | Integrate () |
double | Integrate (BCIntegrationMethod type, tRandomizer randomizer, tEvaluator evaluator, tIntegralUpdater updater, std::vector< double > &sums) |
double | EvaluatorMC (std::vector< double > &sums, const std::vector< double > &point, bool &accepted) |
int | MarginalizeAll () |
int | MarginalizeAll (BCMarginalizationMethod margmethod) |
virtual void | MarginalizePreprocess () |
virtual void | MarginalizePostprocess () |
void | SAInitialize () |
std::vector< double > | FindMode (std::vector< double > start=std::vector< double >()) |
std::vector< double > | FindMode (BCIntegrate::BCOptimizationMethod optmethod, std::vector< double > start=std::vector< double >()) |
double | SATemperature (double t) |
double | SATemperatureBoltzmann (double t) |
double | SATemperatureCauchy (double t) |
virtual double | SATemperatureCustom (double t) |
std::vector< double > | GetProposalPointSA (const std::vector< double > &x, int t) |
std::vector< double > | GetProposalPointSABoltzmann (const std::vector< double > &x, int t) |
std::vector< double > | GetProposalPointSACauchy (const std::vector< double > &x, int t) |
virtual std::vector< double > | GetProposalPointSACustom (const std::vector< double > &x, int t) |
std::vector< double > | SAHelperGetRandomPointOnHypersphere () |
double | SAHelperGetRadialCauchy () |
double | SAHelperSinusToNIntegral (int dim, double theta) |
virtual void | ResetResults () |
std::string | DumpIntegrationMethod (BCIntegrationMethod type) |
std::string | DumpCurrentIntegrationMethod () |
std::string | DumpUsedIntegrationMethod () |
std::string | DumpMarginalizationMethod (BCMarginalizationMethod type) |
std::string | DumpCurrentMarginalizationMethod () |
std::string | DumpUsedMarginalizationMethod () |
std::string | DumpOptimizationMethod (BCOptimizationMethod type) |
std::string | DumpCurrentOptimizationMethod () |
std::string | DumpUsedOptimizationMethod () |
std::string | DumpCubaIntegrationMethod (BCCubaMethod type) |
std::string | DumpCubaIntegrationMethod () |
void | SetBestFitParameters (const std::vector< double > &x) |
void | SetBestFitParameters (const std::vector< double > &x, const double &new_value, double &old_value) |
unsigned | GetNIntegrationVariables () |
double | CalculateIntegrationVolume () |
bool | CheckMarginalizationAvailability (BCMarginalizationMethod type) |
bool | CheckMarginalizationIndices (TH1 *hist, const std::vector< unsigned > &index) |
static void | IntegralUpdaterMC (const std::vector< double > &sums, const int &nIterations, double &integral, double &absprecision) |
static int | CubaIntegrand (const int *ndim, const double xx[], const int *ncomp, double ff[], void *userdata) |
static void | FCNLikelihood (int &npar, double *grad, double &fval, double *par, int flag) |
A class for handling numerical operations for models.
Definition at line 84 of file BCIntegrate.h.
typedef double(BCIntegrate::* BCIntegrate::tEvaluator)(std::vector< double > &, const std::vector< double > &, bool &) |
A pointer for a function that evaluates at a point
Definition at line 141 of file BCIntegrate.h.
typedef void(* BCIntegrate::tIntegralUpdater)(const std::vector< double > &, const int &, double &, double &) |
A pointer for a function that updates the integral and absolute precision
Definition at line 145 of file BCIntegrate.h.
typedef void(BCIntegrate::* BCIntegrate::tRandomizer)(std::vector< double > &) const |
A pointer for a function that chooses a next random point
Definition at line 137 of file BCIntegrate.h.
An enumerator for Cuba integration methods
Enumerator | |
---|---|
kCubaVegas | |
kCubaSuave | |
kCubaDivonne | |
kCubaCuhre | |
NCubaMethods |
Definition at line 128 of file BCIntegrate.h.
An enumerator for integration algorithms
Enumerator | |
---|---|
kIntEmpty | |
kIntMonteCarlo | |
kIntCuba | |
kIntGrid | |
kIntDefault | |
NIntMethods |
Definition at line 104 of file BCIntegrate.h.
An enumerator for marginalization algorithms
Enumerator | |
---|---|
kMargEmpty | |
kMargMetropolis | |
kMargMonteCarlo | |
kMargGrid | |
kMargDefault | |
NMargMethods |
Definition at line 114 of file BCIntegrate.h.
An enumerator for the mode finding algorithm
Enumerator | |
---|---|
kOptEmpty | |
kOptSimAnn | |
kOptMetropolis | |
kOptMinuit | |
kOptDefault | |
NOptMethods |
Definition at line 94 of file BCIntegrate.h.
An enumerator for the Simulated Annealing schedule
Enumerator | |
---|---|
kSACauchy | |
kSABoltzmann | |
kSACustom | |
NSAMethods |
Definition at line 124 of file BCIntegrate.h.
BCIntegrate::BCIntegrate | ( | ) |
BCIntegrate::BCIntegrate | ( | const BCIntegrate & | bcintegrate) |
The copy constructor
Definition at line 109 of file BCIntegrate.cxx.
|
virtual |
The default destructor
Definition at line 170 of file BCIntegrate.cxx.
double BCIntegrate::CalculateIntegrationVolume | ( | ) |
Calculate the integration volume
Definition at line 248 of file BCIntegrate.cxx.
bool BCIntegrate::CheckMarginalizationAvailability | ( | BCMarginalizationMethod | type) |
Check availability of integration routine for marginalization
Definition at line 558 of file BCIntegrate.cxx.
bool BCIntegrate::CheckMarginalizationIndices | ( | TH1 * | hist, |
const std::vector< unsigned > & | index | ||
) |
Check that indices of parameters to marginalize w/r/t are correct
Definition at line 577 of file BCIntegrate.cxx.
|
protected |
Copy into object
bcintegrate | BCIntegrate object to copy values from |
Definition at line 122 of file BCIntegrate.cxx.
|
static |
Integrand for the Cuba library.
ndim | The number of dimensions to integrate over |
xx | The point in parameter space to integrate over (scaled to 0 - 1 per dimension) |
ncomp | The number of components of the integrand (usually 1) |
ff | The function value |
Definition at line 2194 of file BCIntegrate.cxx.
std::string BCIntegrate::DumpCubaIntegrationMethod | ( | BCIntegrate::BCCubaMethod | type) |
Return string with the name for a given Cuba integration type.
type | code for the Cuba integration type |
Definition at line 2494 of file BCIntegrate.cxx.
|
inline |
Return string with the name for the currently set Cuba integration type.
Definition at line 821 of file BCIntegrate.h.
|
inline |
Return string with the name for the currently set integration type.
Definition at line 767 of file BCIntegrate.h.
|
inline |
Return string with the name for the currently set marginalization type.
Definition at line 785 of file BCIntegrate.h.
|
inline |
Return string with the name for the currently set optimization type.
Definition at line 803 of file BCIntegrate.h.
std::string BCIntegrate::DumpIntegrationMethod | ( | BCIntegrate::BCIntegrationMethod | type) |
Return string with the name for a given integration type.
type | code for the integration type |
Definition at line 2439 of file BCIntegrate.cxx.
std::string BCIntegrate::DumpMarginalizationMethod | ( | BCIntegrate::BCMarginalizationMethod | type) |
Return string with the name for a given marginalization type.
type | code for the marginalization type |
Definition at line 2456 of file BCIntegrate.cxx.
std::string BCIntegrate::DumpOptimizationMethod | ( | BCIntegrate::BCOptimizationMethod | type) |
Return string with the name for a given optimization type.
type | code for the optimization type |
Definition at line 2475 of file BCIntegrate.cxx.
|
inline |
Return string with the name for the currently set integration type.
Definition at line 773 of file BCIntegrate.h.
|
inline |
Return string with the name for the marginalization type used.
Definition at line 791 of file BCIntegrate.h.
|
inline |
Return string with the name for the optimization type used to find the current mode.
Definition at line 809 of file BCIntegrate.h.
|
virtual |
Evaluate the unnormalized probability at a point in parameter space. Method needs to be overloaded by the user.
x | The point in parameter space |
Reimplemented in BCModel.
Definition at line 211 of file BCIntegrate.cxx.
double BCIntegrate::EvaluatorMC | ( | std::vector< double > & | sums, |
const std::vector< double > & | point, | ||
bool & | accepted | ||
) |
Definition at line 535 of file BCIntegrate.cxx.
|
static |
Definition at line 2115 of file BCIntegrate.cxx.
std::vector< double > BCIntegrate::FindMode | ( | std::vector< double > | start = std::vector<double>() ) |
Do the mode finding using a method set via SetOptimizationMethod. Default is Minuit. The mode can be extracted using the GetBestFitParameters() method.
A starting point for the mode finding can be specified for Minuit. If not specified, the previously found maximum (typically from marginalization) is used as an initial point. If that is not available, then the Minuit default will be used (center of the parameter space).
Definition at line 1542 of file BCIntegrate.cxx.
std::vector< double > BCIntegrate::FindMode | ( | BCIntegrate::BCOptimizationMethod | optmethod, |
std::vector< double > | start = std::vector<double>() |
||
) |
Find mode using a specific method. The original method will be reset.
optmethod | the optimization method |
start | the starting point for the optimization algorithm |
Definition at line 1639 of file BCIntegrate.cxx.
|
private |
Does the mode finding using Markov Chain Monte Carlo (prerun only!)
mode | a reference to a vector holding the mode |
errors | a reference to a vector holding the errors |
Definition at line 2136 of file BCIntegrate.cxx.
|
private |
Does the mode finding using Minuit. If starting point is not specified, finding will start from the center of the parameter space.
start | point in parameter space from which the mode finding is started. |
printlevel | The print level. |
mode | a reference to a vector holding the mode |
errors | a reference to a vector holding the errors |
Definition at line 1667 of file BCIntegrate.cxx.
|
private |
Does the mode finding using Simulated Annealing. If starting point is not specified, finding will start from the center of the parameter space.
mode | a reference to a vector holding the mode |
errors | a reference to a vector holding the errors |
start | point in parameter space from thich the mode finding is started. |
Definition at line 1777 of file BCIntegrate.cxx.
|
inline |
Definition at line 322 of file BCIntegrate.h.
double BCIntegrate::GetBestFitParameter | ( | unsigned | index) | const |
Returns the value of a parameter (defined by index) at the global mode of the posterior pdf.
index | index of the parameter. |
Definition at line 176 of file BCIntegrate.cxx.
double BCIntegrate::GetBestFitParameterError | ( | unsigned | index) | const |
Returns the error on the value of a parameter (defined by index) at the global mode of the posterior pdf.
index | index of the parameter. |
Definition at line 190 of file BCIntegrate.cxx.
|
inline |
Returns the set of errors on the values of the parameters at the global mode
Definition at line 447 of file BCIntegrate.h.
|
inline |
Returns the set of values of the parameters at the global mode of the posterior pdf.
Definition at line 442 of file BCIntegrate.h.
|
inline |
Definition at line 342 of file BCIntegrate.h.
|
inline |
Definition at line 339 of file BCIntegrate.h.
|
inline |
|
inline |
Definition at line 336 of file BCIntegrate.h.
|
inline |
|
inline |
Definition at line 396 of file BCIntegrate.h.
|
inline |
|
inline |
|
inline |
Returns the posterior at the mode.
Definition at line 435 of file BCIntegrate.h.
|
inline |
BCH1D * BCIntegrate::GetMarginalized | ( | const BCParameter * | parameter) |
Obtain the individual marginalized distributions with respect to one parameter.
parameter | Model parameter |
Definition at line 1200 of file BCIntegrate.cxx.
|
inline |
Obtain the individual marginalized distributions with respect to one parameter.
name | The parameter's name |
Definition at line 197 of file BCIntegrate.h.
BCH1D * BCIntegrate::GetMarginalized | ( | unsigned | index) |
Obtain the individual marginalized distributions with respect to one parameter.
index | The parameter index |
Definition at line 1208 of file BCIntegrate.cxx.
BCH2D * BCIntegrate::GetMarginalized | ( | const BCParameter * | parameter1, |
const BCParameter * | parameter2 | ||
) |
Obtain the individual marginalized distributions with respect to two parameters.
parameter1 | First parameter |
parameter2 | Second parameter |
Definition at line 1497 of file BCIntegrate.cxx.
|
inline |
Obtain the individual marginalized distributions with respect to two parameters.
name1 | Name of first parameter |
name2 | Name of second parameter |
Definition at line 228 of file BCIntegrate.h.
BCH2D * BCIntegrate::GetMarginalized | ( | unsigned | index1, |
unsigned | index2 | ||
) |
Obtain the individual marginalized distributions with respect to two parameters.
index1 | Index of first parameter |
index2 | Index of second parameter |
Definition at line 1506 of file BCIntegrate.cxx.
TMinuit * BCIntegrate::GetMinuit | ( | ) |
Definition at line 1658 of file BCIntegrate.cxx.
|
inline |
unsigned BCIntegrate::GetNIntegrationVariables | ( | ) |
Get number of variables that are varied in the integration
Definition at line 239 of file BCIntegrate.cxx.
|
inline |
Definition at line 312 of file BCIntegrate.h.
|
inline |
Definition at line 297 of file BCIntegrate.h.
|
inline |
Definition at line 292 of file BCIntegrate.h.
|
inline |
|
inline |
Definition at line 302 of file BCIntegrate.h.
|
inline |
std::vector< double > BCIntegrate::GetProposalPointSA | ( | const std::vector< double > & | x, |
int | t | ||
) |
Generates a new state in a neighbourhood around x that is to be accepted or rejected by the Simulated Annealing algorithm. Delegates the generation to the appropriate method according to fSASchedule.
x | last state. |
t | time iterator to determine current temperature. |
Definition at line 1914 of file BCIntegrate.cxx.
std::vector< double > BCIntegrate::GetProposalPointSABoltzmann | ( | const std::vector< double > & | x, |
int | t | ||
) |
Generates a new state in a neighbourhood around x that is to be accepted or rejected by the Simulated Annealing algorithm. This method is used for Boltzmann annealing schedule.
x | last state. |
t | time iterator to determine current temperature. |
Definition at line 1926 of file BCIntegrate.cxx.
std::vector< double > BCIntegrate::GetProposalPointSACauchy | ( | const std::vector< double > & | x, |
int | t | ||
) |
Generates a new state in a neighbourhood around x that is to be accepted or rejected by the Simulated Annealing algorithm. This method is used for Cauchy annealing schedule.
x | last state. |
t | time iterator to determine current temperature. |
Definition at line 1947 of file BCIntegrate.cxx.
|
virtual |
Generates a new state in a neighbourhood around x that is to be accepted or rejected by the Simulated Annealing algorithm. This is a virtual method to be overridden by a user-defined custom proposal function.
x | last state. |
t | time iterator to determine current temperature. |
Definition at line 1991 of file BCIntegrate.cxx.
double BCIntegrate::GetRandomPoint | ( | std::vector< double > & | x) |
Fills a vector of (flat) random numbers in the limits of the parameters and returns the probability at that point
x | A vector of doubles |
Definition at line 1174 of file BCIntegrate.cxx.
void BCIntegrate::GetRandomVectorInParameterSpace | ( | std::vector< double > & | x) | const |
Fills a vector of random numbers x[i] between fMin[i] and fMax[i] into a vector
A | vector of doubles |
Definition at line 1187 of file BCIntegrate.cxx.
void BCIntegrate::GetRandomVectorUnitHypercube | ( | std::vector< double > & | x) | const |
Fills a vector of random numbers between 0 and 1 into a vector
A | vector of doubles |
Definition at line 1181 of file BCIntegrate.cxx.
|
inline |
Definition at line 317 of file BCIntegrate.h.
|
inline |
|
inline |
|
inline |
Returns the Simulated Annealing threshhold temperature.
Definition at line 415 of file BCIntegrate.h.
|
inline |
Getter for the tree containing the Simulated Annealing chain.
Definition at line 550 of file BCIntegrate.h.
BCH1D * BCIntegrate::GetSlice | ( | const BCParameter * | parameter, |
const std::vector< double > | parameters = std::vector<double>(0) , |
||
int | bins = 0 , |
||
bool | flag_norm = true |
||
) |
Returns a one-dimensional slice of the pdf at the point and along a specific direction.
parameter | The model parameter along which the slice is calculated. |
parameters | The point at which the other parameters are fixed. |
nbins | The number of bins of the 1D-histogram. |
flag_norm,: | normalize histogram to unity or not |
Definition at line 1018 of file BCIntegrate.cxx.
|
inline |
Returns a one-dimensional slice of the pdf at the point and along a specific direction.
name | The name of the model parameter along which the slice is calculated. |
parameters | The point at which the other parameters are fixed. |
nbins | The number of bins of the 1D-histogram. |
flag_norm,: | normalize histogram to unity or not |
Definition at line 361 of file BCIntegrate.h.
BCH2D * BCIntegrate::GetSlice | ( | const BCParameter * | parameter1, |
const BCParameter * | parameter2, | ||
const std::vector< double > | parameters = std::vector<double>(0) , |
||
int | bins = 0 , |
||
bool | flag_norm = true |
||
) |
Returns a two-dimensional slice of the pdf at the point and along two specified directions.
parameter1 | The first model parameter along which the slice is calculated. |
parameter2 | The second model parameter along which the slice is calculated. |
parameters | The point at which the other parameters are fixed. |
nbins | The number of bins of the 2D-histogram. |
flag_norm,: | normalize histogram to unity or not |
Definition at line 1079 of file BCIntegrate.cxx.
BCH2D * BCIntegrate::GetSlice | ( | const char * | name1, |
const char * | name2, | ||
const std::vector< double > | parameters = std::vector<double>(0) , |
||
int | nbins = 0 , |
||
bool | flag_norm = true |
||
) |
Returns a two-dimensional slice of the pdf at the point and along two specified directions.
parameter1 | The name of the first model parameter along which the slice is calculated. |
parameter2 | The name of the second model parameter along which the slice is calculated. |
parameters | The point at which the other parameters are fixed. |
nbins | The number of bins of the 2D-histogram. |
flag_norm,: | normalize histogram to unity or not |
Definition at line 1085 of file BCIntegrate.cxx.
BCH2D * BCIntegrate::GetSlice | ( | unsigned | index1, |
unsigned | index2, | ||
const std::vector< double > | parameters = std::vector<double>(0) , |
||
int | nbins = 0 , |
||
bool | flag_norm = true |
||
) |
Returns a two-dimensional slice of the pdf at the point and along two specified directions.
parameter1 | The name of the first model parameter along which the slice is calculated. |
parameter2 | The name of the second model parameter along which the slice is calculated. |
parameters | The point at which the other parameters are fixed. |
nbins | The number of bins of the 2D-histogram. |
flag_norm,: | normalize histogram to unity or not |
Definition at line 1091 of file BCIntegrate.cxx.
void BCIntegrate::InitializeSATree | ( | ) |
Initialization of the tree for the Simulated Annealing
Definition at line 1759 of file BCIntegrate.cxx.
|
static |
Definition at line 549 of file BCIntegrate.cxx.
double BCIntegrate::Integrate | ( | BCIntegrationMethod | intmethod) |
Does the integration over the un-normalized probability.
intmethod | The integration method to used |
Definition at line 353 of file BCIntegrate.cxx.
double BCIntegrate::Integrate | ( | ) |
Perform the integration
Definition at line 265 of file BCIntegrate.cxx.
double BCIntegrate::Integrate | ( | BCIntegrationMethod | type, |
tRandomizer | randomizer, | ||
tEvaluator | evaluator, | ||
tIntegralUpdater | updater, | ||
std::vector< double > & | sums | ||
) |
Does the integration over the un-normalized probability.
type | The integration method to used (for printing out status updates by name) |
randomizer | Pointer to function to choose next random point |
evaluator | Pointer to function to evaluate point |
updater | Pointer to function to update integral and precision |
sums | Vector of doubles holding values used in integral calculation |
x | An initial point to start integration routine at |
Definition at line 467 of file BCIntegrate.cxx.
|
inlineprivate |
Calculate integral using the Cuba library. For details see documentation.
Definition at line 962 of file BCIntegrate.h.
|
private |
Calculate integral using the Cuba library. For details see documentation.
Cuba | integration method to use |
Definition at line 2242 of file BCIntegrate.cxx.
|
private |
Integrate using the slice method
Definition at line 2368 of file BCIntegrate.cxx.
|
protected |
|
virtual |
Evaluate the natural logarithm of the Eval function. For better numerical stability, this method should also be overloaded by the user.
x | The point in parameter space |
Reimplemented from BCEngineMCMC.
Reimplemented in BCModel.
Definition at line 218 of file BCIntegrate.cxx.
|
protected |
Definition at line 452 of file BCIntegrate.cxx.
|
protected |
Definition at line 461 of file BCIntegrate.cxx.
|
protected |
Helper methods to unify output for integration methods
type | |
cubatype |
Definition at line 396 of file BCIntegrate.cxx.
int BCIntegrate::MarginalizeAll | ( | ) |
Marginalize all probabilities wrt. single parameters and all combinations of two parameters. The individual distributions can be retrieved using the GetMarginalized method.
Definition at line 758 of file BCIntegrate.cxx.
int BCIntegrate::MarginalizeAll | ( | BCIntegrate::BCMarginalizationMethod | margmethod) |
Marginalize all probabilities wrt. single parameters and all combinations of two parameters. The individual distributions can be retrieved using the GetMarginalized method.
margmethod | the marginalization method. |
Definition at line 999 of file BCIntegrate.cxx.
|
inlinevirtual |
Method executed after marginalization. User's code should be provided via overloading in the derived class
Reimplemented in BCFitter.
Definition at line 647 of file BCIntegrate.h.
|
inlinevirtual |
Method executed for before marginalization. User's code should be provided via overloading in the derived class
Reimplemented in BCFitter.
Definition at line 641 of file BCIntegrate.h.
|
inline |
BCIntegrate & BCIntegrate::operator= | ( | const BCIntegrate & | bcintegrate) |
Defaut assignment operator
Definition at line 115 of file BCIntegrate.cxx.
int BCIntegrate::PrintAllMarginalized | ( | const char * | file, |
std::string | options1d = "BTsiB3CS1D0pdf0Lmeanmode" , |
||
std::string | options2d = "BTfB3CS1meangmode" , |
||
unsigned int | hdiv = 1 , |
||
unsigned int | ndiv = 1 |
||
) |
Definition at line 1346 of file BCIntegrate.cxx.
int BCIntegrate::PrintAllMarginalized1D | ( | const char * | filebase) |
Definition at line 1293 of file BCIntegrate.cxx.
int BCIntegrate::PrintAllMarginalized2D | ( | const char * | filebase) |
Definition at line 1311 of file BCIntegrate.cxx.
int BCIntegrate::ReadMarginalizedFromFile | ( | const char * | file) |
Read
Definition at line 1234 of file BCIntegrate.cxx.
|
virtual |
Reset all information on the best fit parameters.
Reimplemented from BCEngineMCMC.
Definition at line 225 of file BCIntegrate.cxx.
double BCIntegrate::SAHelperGetRadialCauchy | ( | ) |
Generates the radial part of a n-dimensional Cauchy distribution. Helper function for Cauchy annealing.
Definition at line 2042 of file BCIntegrate.cxx.
std::vector< double > BCIntegrate::SAHelperGetRandomPointOnHypersphere | ( | ) |
Generates a uniform distributed random point on the surface of a fNvar-dimensional Hypersphere. Used as a helper to generate proposal points for Cauchy annealing.
Definition at line 1998 of file BCIntegrate.cxx.
double BCIntegrate::SAHelperSinusToNIntegral | ( | int | dim, |
double | theta | ||
) |
Returns the Integral of sin^dim from 0 to theta. Helper function needed for generating Cauchy distributions.
Definition at line 2098 of file BCIntegrate.cxx.
void BCIntegrate::SAInitialize | ( | ) |
Initializes the Simulated Annealing algorithm (for details see manual)
Definition at line 2432 of file BCIntegrate.cxx.
double BCIntegrate::SATemperature | ( | double | t) |
Temperature annealing schedule for use with Simulated Annealing. Delegates to the appropriate method according to fSASchedule.
t | iterator for lowering the temperature over time. |
Definition at line 1883 of file BCIntegrate.cxx.
double BCIntegrate::SATemperatureBoltzmann | ( | double | t) |
Temperature annealing schedule for use with Simulated Annealing. This method is used for Boltzmann annealing schedule.
t | iterator for lowering the temperature over time. |
Definition at line 1895 of file BCIntegrate.cxx.
double BCIntegrate::SATemperatureCauchy | ( | double | t) |
Temperature annealing schedule for use with Simulated Annealing. This method is used for Cauchy annealing schedule.
t | iterator for lowering the temperature over time. |
Definition at line 1901 of file BCIntegrate.cxx.
|
virtual |
Temperature annealing schedule for use with Simulated Annealing. This is a virtual method to be overridden by a user-defined custom temperature schedule.
t | iterator for lowering the temperature over time. |
Definition at line 1907 of file BCIntegrate.cxx.
|
inline |
|
inline |
void BCIntegrate::SetBestFitParameters | ( | const std::vector< double > & | x, |
const double & | new_value, | ||
double & | old_value | ||
) |
Set best fit parameters if best fit
new_value | is the value of the function at x |
old_value | is the old best fit value, updated to new_value, if it is larger |
Definition at line 373 of file BCIntegrate.cxx.
void BCIntegrate::SetCubaIntegrationMethod | ( | BCIntegrate::BCCubaMethod | type) |
Set Cuba integration method
Definition at line 2173 of file BCIntegrate.cxx.
|
inline |
|
inline |
Definition at line 526 of file BCIntegrate.h.
|
inline |
Definition at line 529 of file BCIntegrate.h.
|
inline |
Definition at line 532 of file BCIntegrate.h.
|
inline |
Flag whether or not to ignore result of previous mode finding
Definition at line 463 of file BCIntegrate.h.
|
inline |
Definition at line 545 of file BCIntegrate.h.
void BCIntegrate::SetIntegrationMethod | ( | BCIntegrate::BCIntegrationMethod | method) |
|
inline |
|
inline |
pointer to list of doubles to be passed as arguments to Minuit
Definition at line 457 of file BCIntegrate.h.
|
inline |
niterations | The maximum number of iterations for integration |
Definition at line 492 of file BCIntegrate.h.
|
inline |
niterations | The maximum number of iterations for integration |
Definition at line 487 of file BCIntegrate.h.
|
inline |
niterations | interval for outputting during integration. If negative, frequency is autogenerated. |
Definition at line 502 of file BCIntegrate.h.
|
inline |
niterations | interval for checking precision in integration routines |
Definition at line 497 of file BCIntegrate.h.
|
inline |
|
inline |
relprecision | The relative precision envisioned for Monte Carlo integration |
Definition at line 508 of file BCIntegrate.h.
|
inline |
|
inline |
T0 | new value for Simulated Annealing starting temperature. |
Definition at line 537 of file BCIntegrate.h.
|
inline |
Tmin | new value for Simulated Annealing threshold temperature. |
Definition at line 542 of file BCIntegrate.h.
|
private |
Requested relative precision of the integration
Definition at line 1045 of file BCIntegrate.h.
|
private |
A vector of estimates on the uncertainties
Definition at line 1031 of file BCIntegrate.h.
|
private |
A vector of best fit parameters found by MCMC
Definition at line 1027 of file BCIntegrate.h.
|
private |
Definition at line 1056 of file BCIntegrate.h.
|
private |
Definition at line 1055 of file BCIntegrate.h.
|
private |
Cuba integration method
Definition at line 1052 of file BCIntegrate.h.
|
private |
Definition at line 1054 of file BCIntegrate.h.
|
private |
Definition at line 1053 of file BCIntegrate.h.
|
private |
The uncertainty in the most recent Monte Carlo integration
Definition at line 1049 of file BCIntegrate.h.
|
protected |
Flag for ignoring older results of optimization
Definition at line 870 of file BCIntegrate.h.
|
protected |
flag indicating if the model was marginalized
Definition at line 922 of file BCIntegrate.h.
|
protected |
Flag deciding whether to write SA to file or not.
Definition at line 886 of file BCIntegrate.h.
|
protected |
An identification number in case several models exist .
Definition at line 859 of file BCIntegrate.h.
|
private |
The integral.
Definition at line 1039 of file BCIntegrate.h.
|
private |
Current integration method
Definition at line 987 of file BCIntegrate.h.
|
private |
Integration method used for the current results
Definition at line 991 of file BCIntegrate.h.
|
private |
The function value at the mode on the log scale
Definition at line 1035 of file BCIntegrate.h.
|
private |
Current marginalization method
Definition at line 995 of file BCIntegrate.h.
|
private |
Marginalization method used for the current results
Definition at line 999 of file BCIntegrate.h.
|
protected |
Set of marginalized distributions.
Definition at line 895 of file BCIntegrate.h.
|
protected |
Set of marginalized distributions.
Definition at line 899 of file BCIntegrate.h.
|
protected |
Minuit
Definition at line 863 of file BCIntegrate.h.
|
protected |
Definition at line 865 of file BCIntegrate.h.
|
protected |
Definition at line 866 of file BCIntegrate.h.
|
private |
Number of iterations in the most recent Monte Carlo integration
Definition at line 1023 of file BCIntegrate.h.
|
private |
Maximum number of iterations
Definition at line 1011 of file BCIntegrate.h.
|
private |
Maximum number of iterations
Definition at line 1007 of file BCIntegrate.h.
|
private |
Output frequency during integration
Definition at line 1019 of file BCIntegrate.h.
|
private |
Maximum number of iterations
Definition at line 1015 of file BCIntegrate.h.
|
private |
Current mode finding method
Definition at line 978 of file BCIntegrate.h.
|
private |
Method with which the global mode was found (can differ from fOptimization method in case more than one algorithm is used).
Definition at line 983 of file BCIntegrate.h.
|
private |
Requested relative precision of the integration
Definition at line 1042 of file BCIntegrate.h.
|
protected |
Definition at line 890 of file BCIntegrate.h.
|
protected |
Definition at line 888 of file BCIntegrate.h.
|
private |
Current Simulated Annealing schedule
Definition at line 1003 of file BCIntegrate.h.
|
protected |
Starting temperature for Simulated Annealing
Definition at line 874 of file BCIntegrate.h.
|
protected |
Definition at line 889 of file BCIntegrate.h.
|
protected |
Minimal/Threshold temperature for Simulated Annealing
Definition at line 878 of file BCIntegrate.h.
|
protected |
Definition at line 891 of file BCIntegrate.h.
|
protected |
Tree for the Simulated Annealing
Definition at line 882 of file BCIntegrate.h.