22 MACH3LOG_WARN(
"Probability of delaying steps > 1, setting to 1");
26 MACH3LOG_CRITICAL(
"Probability of delaying steps <= 0, setting to 0, delay will no longer have an impact!");
40 syst->SetStepScale(scale*syst->GetGlobalStepScale(),
false);
47 for (
int i = 0; i < static_cast<int>(
systematics.size()); ++i)
73 for(
int i=0; i<static_cast<int>(
systematics.size()); ++i){
85 if (denominator <= 0.0)
return 1.0;
88 if(std::isinf(numerator) or std::isinf(denominator) ){
92 return std::min(numerator / denominator, 1.0);
104 bool accepted =
false;
162 for(
int i=0; i<static_cast<int>(
systematics.size()); ++i){
163 for(
int j=0; j<static_cast<int>(
systematics[i]->GetParCurrVec().
size()); ++j){
#define MACH3LOG_CRITICAL
bool accepted_delayed
Was the step we just accepted delayed?
void PrepareOutput()
override to add in rejection information to output
int max_rejections
How many rejections allowed?
bool ProbabilisticDelay() const
if delay has a chance of occurring
void StoreCurrentStep()
Store information about the current proposed step.
double delay_probability
Can delay with probability instead.
DelayedMR2T2(manager *const fitMan)
Constructor.
std::vector< double > start_step_scale
Stores the initial scale for all parameters.
double AcceptanceProbability() override
Step acceptance probability.
bool delay_on_oob_only
Delay only if we go out of bounds.
double MinLogLikelihood
Minimum (negative) log-likelihood of proposed steps.
void ResetSystScale()
Reset scale after delay process.
double decay_rate
How much to decrease the step scale each step.
void DoStep() override
The MCMC step proposal.
void ScaleSystematics(const double scale)
Set parameter scale to be original_scale* scale.
double initial_scale
Scale for (non-delayed) step is initial_scale * start_step_scale.
std::vector< std::vector< double > > current_step_vals
Store information about the current proposed step.
std::unique_ptr< TRandom3 > random
Random number.
double logLProp
proposed likelihood
manager * fitMan
The manager.
void PrepareOutput()
Prepare the output file.
double accProb
current acceptance prob
std::string AlgorithmName
Name of fitting algorithm that is being used.
double logLCurr
current likelihood
TTree * outTree
Output tree with posteriors.
std::vector< ParameterHandlerBase * > systematics
Systematic holder.
void AcceptStep()
Accept a step.
bool out_of_bounds
Do we reject based on hitting boundaries in systs.
bool IsStepAccepted(const double acc_prob)
Is step accepted?
MCMC algorithm implementing the Metropolis–Rosenbluth–Rosenbluth–Teller–Teller (MR T ) method.
void ProposeStep() override
Propose a step.
double AcceptanceProbability() override
Step acceptance probability.
The manager class is responsible for managing configurations and settings.
YAML::Node const & raw()
Return config.
constexpr static const double _LARGE_LOGL_
Large Likelihood is used it parameter go out of physical boundary, this indicates in MCMC that such s...