![]() |
MaCh3
2.6.0
Reference Guide
|
Helper class for configuring and evaluating multicanonical umbrella weights. More...
#include <Fitters/MulticanonicalMCMCHandler.h>
Public Member Functions | |
| MulticanonicalMCMCHandler () | |
| Constructor. More... | |
| virtual | ~MulticanonicalMCMCHandler () |
| Destructor. More... | |
| void | FindOscCovParams (const std::vector< ParameterHandlerBase * > &systematics) |
| Locate the systematic object which contains the parameters used by the handler. Stores the parameter indices. More... | |
| void | AdjustUmbrellaStepScale (const std::vector< ParameterHandlerBase * > &systematics) |
| Adjust the parameter-of-interest's step scale according to the width of the umbrella bias function. More... | |
| void | InitializeMulticanonicalHandlerConfig (Manager *fitMan, std::vector< ParameterHandlerBase * > &systematics) |
| Read multicanonical configuration from the yaml via manager and initialise handler state. More... | |
| void | InitializeMulticanonicalParams (std::vector< ParameterHandlerBase * > &systematics) |
| Initialise the starting values used by the multicanonical parameter handling. More... | |
| double | GetMulticanonicalWeight (double deltacp, double delm23_value) |
| Compute the multicanonical penalty for the configured bias mode. More... | |
| double | GetMulticanonicalWeightSpline (double deltacp, double delm23_value) |
| Compute the multicanonical penalty using a spline. More... | |
| double | GetMulticanonicalWeightGaussian (double deltacp) |
| Compute a Gaussian multicanonical penalty. More... | |
| double | GetMulticanonicalWeightTripleGaussian (double deltacp) |
| Compute a triple-Gaussian multicanonical penalty. More... | |
| double | GetMulticanonicalWeightVonMises (double deltacp) |
| Compute a von Mises multicanonical penalty. More... | |
| double | GetMulticanonicalWeightGenGaussian (double deltacp) |
| Compute a generalised-Gaussian multicanonical penalty. More... | |
| double | circularDistance (double x, double mean) |
| Compute the circular distance between two angles. More... | |
| double | generalisedGaussian2 (double x, double mean, double width) |
| Wraps the generalised gaussian function for a given x, mean, and width. Required to handle the wrappipng of the parameter space at 2pi. More... | |
Public Attributes | |
| int | oscCovVar |
| Index of the oscillation-covariance systematic in the current fit. More... | |
| int | multicanonicalVar |
| Parameter index used for the multicanonical delta_cp weight. More... | |
| int | multicanonicalVar_dm23 |
| Parameter index used for the multicanonical delm2_23 weight. More... | |
| M3::BiasFunction | umbrellaBiasFunction |
| Selected bias function for multicanonical weights. More... | |
| std::string | umbrellaBiasFunctionName |
| Configured bias function name for logging. More... | |
| bool | multicanonicalSpline |
| Toggle for spline-based multicanonical weights. More... | |
Protected Attributes | |
| double | multicanonicalBeta |
| Global scale factor applied to the multicanonical penalty. 1 is full strength, 0 is no penalty. More... | |
| double | delta_cp_value |
| delta_cp value used during proposal evaluation. More... | |
| double | delm23_value |
| delm2_23 value used during proposal evaluation. More... | |
| TSpline3 * | dcp_spline_IO |
| Spline for the IO branch, if spline mode is enabled. More... | |
| TSpline3 * | dcp_spline_NO |
| Spline for the NO branch, if spline mode is enabled. More... | |
| double | umbrellaMean |
| Umbrella centre used for the current configuration. More... | |
| double | umbrellaWidth |
| Umbrella width used for the current configuration. More... | |
| int | umbrellaNumber |
| Number of total umbrellas used for the current configuration. More... | |
| bool | umbrellaOverlapMode |
| Toggle for deriving umbrella widths from a desired # of sigma overlaps between umbrellas. More... | |
| double | umbrellaSigmaOverlap |
| Requested overlap for evenly spaced umbrellas. More... | |
| bool | umbrellaAdjustStepScale |
| Toggle for rescaling the step size based on the umbrella width. More... | |
| double | umbrellaStepScaleFactor |
| Additional scale factor applied when rescaling the step size. This is for fine tuning. More... | |
| bool | flipWindow |
| Optional flip-window control. More... | |
| double | vonMises_kappa |
| Von Mises kappa parameter. Analogue of sigma for a gaussian. More... | |
| double | vonMises_I0_kappa |
| Cached I0(kappa) value for the von Mises form. More... | |
Helper class for configuring and evaluating multicanonical umbrella weights.
this method is used to bias the MCMC sampling of chains to particular regions of the parameter space The method relies on a bias function defined via a yaml configuration file in experimental specific code With a bias function defined chains run as normal and are combined after the fact using the information stored in the chains saved yaml configuration file.
Definition at line 31 of file MulticanonicalMCMCHandler.h.
| MulticanonicalMCMCHandler::MulticanonicalMCMCHandler | ( | ) |
Constructor.
Definition at line 25 of file MulticanonicalMCMCHandler.cpp.
|
virtual |
| void MulticanonicalMCMCHandler::AdjustUmbrellaStepScale | ( | const std::vector< ParameterHandlerBase * > & | systematics | ) |
Adjust the parameter-of-interest's step scale according to the width of the umbrella bias function.
This is used to adjust the step scale of the parameter to keep the size of the step scale relative to the new biased space the chain sees the same. Current assumes that your are sampling delta cp (ie cirular on 2pi)
Definition at line 210 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::circularDistance | ( | double | x, |
| double | mean | ||
| ) |
Compute the circular distance between two angles.
This is used to calculate the distance between two angles in a circular space, such as delta_cp. It returns the shortest distance between the two angles, taking into account the wrapping at 2pi.
Definition at line 298 of file MulticanonicalMCMCHandler.cpp.
| void MulticanonicalMCMCHandler::FindOscCovParams | ( | const std::vector< ParameterHandlerBase * > & | systematics | ) |
Locate the systematic object which contains the parameters used by the handler. Stores the parameter indices.
Definition at line 62 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::generalisedGaussian2 | ( | double | x, |
| double | mean, | ||
| double | width | ||
| ) |
Wraps the generalised gaussian function for a given x, mean, and width. Required to handle the wrappipng of the parameter space at 2pi.
Definition at line 290 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::GetMulticanonicalWeight | ( | double | deltacp, |
| double | delm23_value | ||
| ) |
Compute the multicanonical penalty for the configured bias mode.
This wraps the various bias function implementations and returns the appropriate penalty
Definition at line 251 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::GetMulticanonicalWeightGaussian | ( | double | deltacp | ) |
Compute a Gaussian multicanonical penalty.
Definition at line 283 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::GetMulticanonicalWeightGenGaussian | ( | double | deltacp | ) |
Compute a generalised-Gaussian multicanonical penalty.
the generalised gaussian is like a gaussian with an extra factor of n on the exponent of the gaussian. This allows for a stronger constraint in the tails of the distribution, more like a tophat function. The normalisation is a little ugly and uses gamma functions, so for now it is hardcoded to n=2. This is the current recommended configuration for umbrella sampling.
implememnt the wrapping with circular distance function to avoid the need to calculate the weight multiple times for each parameter to ensure it recieves a bias even when it jumps the boundary
implement the normalisation for n != 2, and allow n to be set in the yaml configuration file
Definition at line 300 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::GetMulticanonicalWeightSpline | ( | double | deltacp, |
| double | delm23_value | ||
| ) |
Compute the multicanonical penalty using a spline.
Definition at line 268 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::GetMulticanonicalWeightTripleGaussian | ( | double | deltacp | ) |
Compute a triple-Gaussian multicanonical penalty.
This was mostsly for testing the first implementation, probably not used anymore.
delta_cp_log_likelihood = -TMath::Log(TMath::Gaus(deltacp,TMath::Pi(),1,kTRUE)+TMath::Gaus(deltacp,0,1,kTRUE)+TMath::Gaus(deltacp,-TMath::Pi(),1,kTRUE));
Definition at line 312 of file MulticanonicalMCMCHandler.cpp.
| double MulticanonicalMCMCHandler::GetMulticanonicalWeightVonMises | ( | double | deltacp | ) |
Compute a von Mises multicanonical penalty.
This is the circular analogue of a gaussian, meaning it handles the wrapping of the parameter space at 2pi automatically this avoids the need to calculate the weight multiple times for each parameter to ensure it recieves a bias even when it jumps the boundary the normalisation grows extremely quickly, widths of less that 0.05 should not be used until properly tested.
Definition at line 242 of file MulticanonicalMCMCHandler.cpp.
| void MulticanonicalMCMCHandler::InitializeMulticanonicalHandlerConfig | ( | Manager * | fitMan, |
| std::vector< ParameterHandlerBase * > & | systematics | ||
| ) |
Read multicanonical configuration from the yaml via manager and initialise handler state.
Definition at line 99 of file MulticanonicalMCMCHandler.cpp.
| void MulticanonicalMCMCHandler::InitializeMulticanonicalParams | ( | std::vector< ParameterHandlerBase * > & | systematics | ) |
Initialise the starting values used by the multicanonical parameter handling.
This moves the starting point of the chain to the centre of the umbrella bias function. Only affects the parameter of interest.
Definition at line 223 of file MulticanonicalMCMCHandler.cpp.
|
protected |
Spline for the IO branch, if spline mode is enabled.
Definition at line 121 of file MulticanonicalMCMCHandler.h.
|
protected |
Spline for the NO branch, if spline mode is enabled.
Definition at line 123 of file MulticanonicalMCMCHandler.h.
|
protected |
delm2_23 value used during proposal evaluation.
Definition at line 118 of file MulticanonicalMCMCHandler.h.
|
protected |
delta_cp value used during proposal evaluation.
Definition at line 116 of file MulticanonicalMCMCHandler.h.
|
protected |
Optional flip-window control.
briefly tested feature to mirrow windows about their centres. Not tested but may be useful in the future. Currently disabled and not used.
Definition at line 142 of file MulticanonicalMCMCHandler.h.
|
protected |
Global scale factor applied to the multicanonical penalty. 1 is full strength, 0 is no penalty.
Definition at line 113 of file MulticanonicalMCMCHandler.h.
| bool MulticanonicalMCMCHandler::multicanonicalSpline |
Toggle for spline-based multicanonical weights.
Definition at line 109 of file MulticanonicalMCMCHandler.h.
| int MulticanonicalMCMCHandler::multicanonicalVar |
Parameter index used for the multicanonical delta_cp weight.
Definition at line 98 of file MulticanonicalMCMCHandler.h.
| int MulticanonicalMCMCHandler::multicanonicalVar_dm23 |
Parameter index used for the multicanonical delm2_23 weight.
Definition at line 100 of file MulticanonicalMCMCHandler.h.
| int MulticanonicalMCMCHandler::oscCovVar |
Index of the oscillation-covariance systematic in the current fit.
Definition at line 96 of file MulticanonicalMCMCHandler.h.
|
protected |
Toggle for rescaling the step size based on the umbrella width.
Definition at line 137 of file MulticanonicalMCMCHandler.h.
| M3::BiasFunction MulticanonicalMCMCHandler::umbrellaBiasFunction |
Selected bias function for multicanonical weights.
Definition at line 103 of file MulticanonicalMCMCHandler.h.
| std::string MulticanonicalMCMCHandler::umbrellaBiasFunctionName |
Configured bias function name for logging.
Definition at line 106 of file MulticanonicalMCMCHandler.h.
|
protected |
Umbrella centre used for the current configuration.
Definition at line 126 of file MulticanonicalMCMCHandler.h.
|
protected |
Number of total umbrellas used for the current configuration.
Currently only used when auto-overlap mode is enabled. This is not fully tested.
Definition at line 131 of file MulticanonicalMCMCHandler.h.
|
protected |
Toggle for deriving umbrella widths from a desired # of sigma overlaps between umbrellas.
Definition at line 133 of file MulticanonicalMCMCHandler.h.
|
protected |
Requested overlap for evenly spaced umbrellas.
Definition at line 135 of file MulticanonicalMCMCHandler.h.
|
protected |
Additional scale factor applied when rescaling the step size. This is for fine tuning.
Definition at line 139 of file MulticanonicalMCMCHandler.h.
|
protected |
Umbrella width used for the current configuration.
Definition at line 128 of file MulticanonicalMCMCHandler.h.
|
protected |
Cached I0(kappa) value for the von Mises form.
Definition at line 147 of file MulticanonicalMCMCHandler.h.
|
protected |
Von Mises kappa parameter. Analogue of sigma for a gaussian.
Definition at line 145 of file MulticanonicalMCMCHandler.h.