MaCh3  2.2.3
Reference Guide
Public Member Functions | Private Attributes | List of all members
adaptive_mcmc::AdaptiveMCMCHandler Class Reference

Contains information about adaptive covariance matrix [12]. More...

#include <Parameters/AdaptiveMCMCHandler.h>

Collaboration diagram for adaptive_mcmc::AdaptiveMCMCHandler:
[legend]

Public Member Functions

 AdaptiveMCMCHandler ()
 Constructor. More...
 
virtual ~AdaptiveMCMCHandler ()
 Destructor. More...
 
void Print () const
 Print all class members. More...
 
bool InitFromConfig (const YAML::Node &adapt_manager, const std::string &matrix_name_str, const std::vector< double > *parameters, const std::vector< double > *fixed)
 Read initial values from config file. More...
 
void CreateNewAdaptiveCovariance ()
 If we don't have a covariance matrix to start from for adaptive tune we need to make one! More...
 
void SetAdaptiveBlocks (const std::vector< std::vector< int >> &block_indices)
 HW: sets adaptive block matrix. More...
 
void SaveAdaptiveToFile (const std::string &outFileName, const std::string &systematicName, const bool is_final=false)
 HW: Save adaptive throw matrix to file. More...
 
void SetThrowMatrixFromFile (const std::string &matrix_file_name, const std::string &matrix_name, const std::string &means_name, bool &use_adaptive)
 sets throw matrix from a file More...
 
void UpdateAdaptiveCovariance ()
 Method to update adaptive MCMC [12]. More...
 
bool IndivStepScaleAdapt () const
 Tell whether we want reset step scale or not. More...
 
bool UpdateMatrixAdapt ()
 Tell whether matrix should be updated. More...
 
bool AdaptionUpdate () const
 To be fair not a clue... More...
 
bool SkipAdaption () const
 Tell if we are Skipping Adaption. More...
 
void SetParams (const std::vector< double > *params)
 Set the current values of the parameters. More...
 
void SetFixed (const std::vector< double > *fix)
 Set the fixed parameters. More...
 
int GetNumParams () const
 Get the current values of the parameters. More...
 
bool IsFixed (const int ipar) const
 Check if a parameter is fixed. More...
 
double CurrVal (const int par_index) const
 Get Current value of parameter. More...
 
int GetTotalSteps () const
 Get Total Number of Steps. More...
 
void SetTotalSteps (const int nsteps)
 Change Total Number of Steps to new value. More...
 
void IncrementNSteps ()
 Increase by one number of total steps. More...
 
TMatrixDSym * GetAdaptiveCovariance () const
 Increase by one number of total steps. More...
 
std::vector< double > GetParameterMeans () const
 Get the parameter means used in the adaptive handler. More...
 
std::string GetOutFileName () const
 Get Name of Output File. More...
 

Private Attributes

int start_adaptive_throw
 
int start_adaptive_update
 When do we stop update the adaptive matrix. More...
 
int end_adaptive_update
 Steps between changing throw matrix. More...
 
int adaptive_update_step
 Steps between changing throw matrix. More...
 
int adaptive_save_n_iterations
 
std::string output_file_name
 Name of the file to save the adaptive matrices into. More...
 
std::vector< int > adapt_block_matrix_indices
 Indices for block-matrix adaption. More...
 
std::vector< int > adapt_block_sizes
 Size of blocks for adaption. More...
 
std::vector< double > par_means
 Mean values for all parameters. More...
 
TMatrixDSym * adaptive_covariance
 Full adaptive covariance matrix. More...
 
int total_steps
 Total number of MCMC steps. More...
 
double adaption_scale
 Scaling factor. More...
 
const std::vector< double > * _fFixedPars
 Vector of fixed parameters. More...
 
const std::vector< double > * _fCurrVal
 Current values of parameters. More...
 

Detailed Description

Contains information about adaptive covariance matrix [12].

Author
Henry Wallace

struct encapsulating all adaptive MCMC information

Definition at line 13 of file AdaptiveMCMCHandler.h.

Constructor & Destructor Documentation

◆ AdaptiveMCMCHandler()

adaptive_mcmc::AdaptiveMCMCHandler::AdaptiveMCMCHandler ( )

Constructor.

Definition at line 6 of file AdaptiveMCMCHandler.cpp.

6  {
7 // ********************************************
11  adaptive_update_step = 1000;
12  total_steps = 0;
13 
14  par_means = {};
15  adaptive_covariance = nullptr;
16 }
std::vector< double > par_means
Mean values for all parameters.
int start_adaptive_update
When do we stop update the adaptive matrix.
int end_adaptive_update
Steps between changing throw matrix.
int total_steps
Total number of MCMC steps.
int adaptive_update_step
Steps between changing throw matrix.
TMatrixDSym * adaptive_covariance
Full adaptive covariance matrix.

◆ ~AdaptiveMCMCHandler()

adaptive_mcmc::AdaptiveMCMCHandler::~AdaptiveMCMCHandler ( )
virtual

Destructor.

Definition at line 19 of file AdaptiveMCMCHandler.cpp.

19  {
20 // ********************************************
21  if(adaptive_covariance != nullptr) {
22  delete adaptive_covariance;
23  }
24 }

Member Function Documentation

◆ AdaptionUpdate()

bool adaptive_mcmc::AdaptiveMCMCHandler::AdaptionUpdate ( ) const

To be fair not a clue...

Definition at line 318 of file AdaptiveMCMCHandler.cpp.

318  {
319 // ********************************************
320  if(total_steps <= start_adaptive_throw) return true;
321  else return false;
322 }

◆ CreateNewAdaptiveCovariance()

void adaptive_mcmc::AdaptiveMCMCHandler::CreateNewAdaptiveCovariance ( )

If we don't have a covariance matrix to start from for adaptive tune we need to make one!

Definition at line 91 of file AdaptiveMCMCHandler.cpp.

91  {
92 // ********************************************
93  adaptive_covariance = new TMatrixDSym(GetNumParams());
94  adaptive_covariance->Zero();
95  par_means = std::vector<double>(GetNumParams(), 0);
96 }
int GetNumParams() const
Get the current values of the parameters.

◆ CurrVal()

double adaptive_mcmc::AdaptiveMCMCHandler::CurrVal ( const int  par_index) const

Get Current value of parameter.

HW Implemented as its own method to allow for different behaviour in the future

Definition at line 336 of file AdaptiveMCMCHandler.cpp.

336  {
339  return (*_fCurrVal)[par_index];
340 }
const std::vector< double > * _fCurrVal
Current values of parameters.

◆ IncrementNSteps()

void adaptive_mcmc::AdaptiveMCMCHandler::IncrementNSteps ( )
inline

Increase by one number of total steps.

Definition at line 109 of file AdaptiveMCMCHandler.h.

109  {
110  total_steps++;
111  }

◆ IndivStepScaleAdapt()

bool adaptive_mcmc::AdaptiveMCMCHandler::IndivStepScaleAdapt ( ) const

Tell whether we want reset step scale or not.

Definition at line 291 of file AdaptiveMCMCHandler.cpp.

291  {
292 // ********************************************
293  if(total_steps == start_adaptive_throw) return true;
294  else return false;
295 }

◆ InitFromConfig()

bool adaptive_mcmc::AdaptiveMCMCHandler::InitFromConfig ( const YAML::Node &  adapt_manager,
const std::string &  matrix_name_str,
const std::vector< double > *  parameters,
const std::vector< double > *  fixed 
)

Read initial values from config file.

Parameters
adapt_managerYAML node containing the configuration (AdaptionOptions).
matrix_name_strName of the covariance matrix block to configure.
parametersPointer to a vector of parameter values (nominal values).
fixedPointer to a vector of fixed parameter values.
Returns
True if adaptive MCMC configuration was successfully initialized, false otherwise.

HW: This is technically wrong, should be across all systematics but will be addressed in a later PR

Definition at line 27 of file AdaptiveMCMCHandler.cpp.

28  {
29 // ********************************************
30  /*
31  * HW: Idea is that adaption can simply read the YAML config
32  * Options :
33  * External Info:
34  * UseExternalMatrix [bool] : Use an external matrix
35  * ExternalMatrixFileName [str] : Name of file containing external info
36  * ExternalMatrixName [str] : Name of external Matrix
37  * ExternalMeansName [str] : Name of external means vector [for updates]
38  *
39  * General Info:
40  * DoAdaption [bool] : Do we want to do adaption?
41  * AdaptionStartThrow [int] : Step we start throwing adaptive matrix from
42  * AdaptionEndUpdate [int] : Step we stop updating adaptive matrix
43  * AdaptionStartUpdate [int] : Do we skip the first N steps?
44  * AdaptionUpdateStep [int] : Number of steps between matrix updates
45  * AdaptionSaveNIterations [int]: You don't have to save every adaptive stage so decide how often you want to save
46  * Adaption blocks [vector<vector<int>>] : Splits the throw matrix into several block matrices
47  * OuputFileName [std::string] : Name of the file that the adaptive matrices will be saved into
48  */
49 
50  // setAdaptionDefaults();
51  if(!adapt_manager["AdaptionOptions"]["Covariance"][matrix_name_str]) {
52  MACH3LOG_WARN("Adaptive Settings not found for {}, this is fine if you don't want adaptive MCMC", matrix_name_str);
53  return false;
54  }
55 
56  // We"re going to grab this info from the YAML manager
57  if(!GetFromManager<bool>(adapt_manager["AdaptionOptions"]["Covariance"][matrix_name_str]["DoAdaption"], false)) {
58  MACH3LOG_WARN("Not using adaption for {}", matrix_name_str);
59  return false;
60  }
61 
62  if(!CheckNodeExists(adapt_manager, "AdaptionOptions", "Settings", "OutputFileName")) {
63  MACH3LOG_ERROR("No OutputFileName specified in AdaptionOptions::Settings into your config file");
64  MACH3LOG_ERROR("This is required if you are using adaptive MCMC");
65  throw MaCh3Exception(__FILE__, __LINE__);
66  }
67 
68  start_adaptive_throw = GetFromManager<int>(adapt_manager["AdaptionOptions"]["Settings"]["StartThrow"], 10);
69  start_adaptive_update = GetFromManager<int>(adapt_manager["AdaptionOptions"]["Settings"]["StartUpdate"], 0);
70  end_adaptive_update = GetFromManager<int>(adapt_manager["AdaptionOptions"]["Settings"]["EndUpdate"], 10000);
71  adaptive_update_step = GetFromManager<int>(adapt_manager["AdaptionOptions"]["Settings"]["UpdateStep"], 100);
72  adaptive_save_n_iterations = GetFromManager<int>(adapt_manager["AdaptionOptions"]["Settings"]["SaveNIterations"], -1);
73  output_file_name = GetFromManager<std::string>(adapt_manager["AdaptionOptions"]["Settings"]["OutputFileName"], "");
74 
75  // We also want to check for "blocks" by default all parameters "know" about each other
76  // but we can split the matrix into independent block matrices
77  SetParams(parameters);
78  SetFixed(fixed);
79 
81  adaption_scale = 2.38*2.38/GetNumParams();
82 
83  // We"ll set a dummy variable here
84  auto matrix_blocks = GetFromManager<std::vector<std::vector<int>>>(adapt_manager["AdaptionOptions"]["Covariance"][matrix_name_str]["MatrixBlocks"], {{}});
85 
86  SetAdaptiveBlocks(matrix_blocks);
87  return true;
88 }
#define MACH3LOG_ERROR
Definition: MaCh3Logger.h:27
#define MACH3LOG_WARN
Definition: MaCh3Logger.h:26
bool CheckNodeExists(const YAML::Node &node, Args... args)
KS: Wrapper function to call the recursive helper.
Definition: YamlHelper.h:55
Custom exception class for MaCh3 errors.
std::string output_file_name
Name of the file to save the adaptive matrices into.
void SetFixed(const std::vector< double > *fix)
Set the fixed parameters.
void SetParams(const std::vector< double > *params)
Set the current values of the parameters.
void SetAdaptiveBlocks(const std::vector< std::vector< int >> &block_indices)
HW: sets adaptive block matrix.

◆ IsFixed()

bool adaptive_mcmc::AdaptiveMCMCHandler::IsFixed ( const int  ipar) const
inline

Check if a parameter is fixed.

Definition at line 87 of file AdaptiveMCMCHandler.h.

87  {
88  if(!_fFixedPars){
89  return false;
90  }
91  return ((*_fFixedPars)[ipar] < 0);
92  }
const std::vector< double > * _fFixedPars
Vector of fixed parameters.

◆ Print()

void adaptive_mcmc::AdaptiveMCMCHandler::Print ( ) const

Print all class members.

Definition at line 325 of file AdaptiveMCMCHandler.cpp.

325  {
326 // ********************************************
327  MACH3LOG_INFO("Adaptive MCMC Info:");
328  MACH3LOG_INFO("Throwing from New Matrix from Step : {}", start_adaptive_throw);
329  MACH3LOG_INFO("Adaption Matrix Start Update : {}", start_adaptive_update);
330  MACH3LOG_INFO("Adaption Matrix Ending Updates : {}", end_adaptive_update);
331  MACH3LOG_INFO("Steps Between Updates : {}", adaptive_update_step);
332  MACH3LOG_INFO("Saving matrices to file : {}", output_file_name);
333  MACH3LOG_INFO("Will only save every {} iterations" , adaptive_save_n_iterations);
334 }
#define MACH3LOG_INFO
Definition: MaCh3Logger.h:25

◆ SaveAdaptiveToFile()

void adaptive_mcmc::AdaptiveMCMCHandler::SaveAdaptiveToFile ( const std::string &  outFileName,
const std::string &  systematicName,
const bool  is_final = false 
)

HW: Save adaptive throw matrix to file.

Definition at line 141 of file AdaptiveMCMCHandler.cpp.

142  {
143 // ********************************************
144  // Skip saving if adaptive_save_n_iterations is negative,
145  // unless this is the final iteration (is_final overrides the condition)
146  if (adaptive_save_n_iterations < 0 && !is_final) return;
147  if (is_final ||
150 
151  TFile *outFile = new TFile(outFileName.c_str(), "UPDATE");
152  if (outFile->IsZombie()) {
153  MACH3LOG_ERROR("Couldn't find {}", outFileName);
154  throw MaCh3Exception(__FILE__, __LINE__);
155  }
156 
157  TVectorD *outMeanVec = new TVectorD(int(par_means.size()));
158  for (int i = 0; i < int(par_means.size()); i++) {
159  (*outMeanVec)(i) = par_means[i];
160  }
161 
162  std::string adaptive_cov_name = systematicName + "_posfit_matrix";
163  std::string mean_vec_name = systematicName + "_mean_vec";
164  if (!is_final) {
165  // Some string to make the name of the saved adaptive matrix clear
166  std::string total_steps_str =
167  std::to_string(total_steps);
168  std::string syst_name_str = systematicName;
169  adaptive_cov_name =
170  total_steps_str + '_' + syst_name_str + std::string("_throw_matrix");
171  mean_vec_name =
172  total_steps_str + '_' + syst_name_str + std::string("_mean_vec");
173  }
174 
175  outFile->cd();
176  adaptive_covariance->Write(adaptive_cov_name.c_str());
177  outMeanVec->Write(mean_vec_name.c_str());
178  outFile->Close();
179  delete outMeanVec;
180  delete outFile;
181  }
182 }

◆ SetAdaptiveBlocks()

void adaptive_mcmc::AdaptiveMCMCHandler::SetAdaptiveBlocks ( const std::vector< std::vector< int >> &  block_indices)

HW: sets adaptive block matrix.

Parameters
block_indicesValues for sub-matrix blocks

Definition at line 99 of file AdaptiveMCMCHandler.cpp.

99  {
100 // ********************************************
101  /*
102  * In order to adapt efficient we want to setup our throw matrix to be a serious of block-diagonal (ish) matrices
103  *
104  * To do this we set sub-block in the config by parameter index. For example having
105  * [[0,4],[4, 6]] in your config will set up two blocks one with all indices 0<=i<4 and the other with 4<=i<6
106  */
107  // Set up block regions
108  adapt_block_matrix_indices = std::vector<int>(GetNumParams(), 0);
109 
110  // Should also make a matrix of block sizes
111  adapt_block_sizes = std::vector<int>(block_indices.size()+1, 0);
113 
114  if(block_indices.size()==0 || block_indices[0].size()==0) return;
115 
116  int block_size = static_cast<int>(block_indices.size());
117  // Now we loop over our blocks
118  for(int iblock=0; iblock < block_size; iblock++){
119  // Loop over blocks in the block
120  int sub_block_size = static_cast<int>(block_indices.size()-1);
121  for(int isubblock=0; isubblock < sub_block_size ; isubblock+=2){
122  int block_lb = block_indices[iblock][isubblock];
123  int block_ub = block_indices[iblock][isubblock+1];
124 
125  if(block_lb > GetNumParams() || block_ub > GetNumParams()){
126  MACH3LOG_ERROR("Cannot set matrix block with edges {}, {} for matrix of size {}",
127  block_lb, block_ub, GetNumParams());
128  throw MaCh3Exception(__FILE__, __LINE__);;
129  }
130  for(int ipar = block_lb; ipar < block_ub; ipar++){
131  adapt_block_matrix_indices[ipar] = iblock+1;
132  adapt_block_sizes[iblock+1] += 1;
133  adapt_block_sizes[0] -= 1;
134  }
135  }
136  }
137 }
std::vector< int > adapt_block_matrix_indices
Indices for block-matrix adaption.
std::vector< int > adapt_block_sizes
Size of blocks for adaption.

◆ SetFixed()

void adaptive_mcmc::AdaptiveMCMCHandler::SetFixed ( const std::vector< double > *  fix)
inline

Set the fixed parameters.

Definition at line 76 of file AdaptiveMCMCHandler.h.

76  {
77  _fFixedPars = fix;
78  }

◆ SetParams()

void adaptive_mcmc::AdaptiveMCMCHandler::SetParams ( const std::vector< double > *  params)
inline

Set the current values of the parameters.

Definition at line 71 of file AdaptiveMCMCHandler.h.

71  {
72  _fCurrVal = params;
73  }

◆ SetThrowMatrixFromFile()

void adaptive_mcmc::AdaptiveMCMCHandler::SetThrowMatrixFromFile ( const std::string &  matrix_file_name,
const std::string &  matrix_name,
const std::string &  means_name,
bool &  use_adaptive 
)

sets throw matrix from a file

Parameters
matrix_file_namename of file matrix lives in
matrix_namename of matrix in file
means_namename of means vec in file

Definition at line 187 of file AdaptiveMCMCHandler.cpp.

190  {
191 // ********************************************
192  // Lets you set the throw matrix externally
193  // Open file
194  auto matrix_file = std::make_unique<TFile>(matrix_file_name.c_str());
195  use_adaptive = true;
196 
197  if(matrix_file->IsZombie()){
198  MACH3LOG_ERROR("Couldn't find {}", matrix_file_name);
199  throw MaCh3Exception(__FILE__ , __LINE__ );
200  }
201 
202  // Next we grab our matrix
203  adaptive_covariance = static_cast<TMatrixDSym*>(matrix_file->Get(matrix_name.c_str()));
204  if(!adaptive_covariance){
205  MACH3LOG_ERROR("Couldn't find {} in {}", matrix_name, matrix_file_name);
206  throw MaCh3Exception(__FILE__ , __LINE__ );
207  }
208 
209  // Finally we grab the means vector
210  TVectorD* means_vector = static_cast<TVectorD*>(matrix_file->Get(means_name.c_str()));
211 
212  // This is fine to not exist!
213  if(means_vector){
214  // Yay our vector exists! Let's loop and fill it
215  // Should check this is done
216  if(means_vector->GetNrows()){
217  MACH3LOG_ERROR("External means vec size ({}) != matrix size ({})", means_vector->GetNrows(), GetNumParams());
218  throw MaCh3Exception(__FILE__, __LINE__);
219  }
220 
221  par_means = std::vector<double>(GetNumParams());
222  for(int i = 0; i < GetNumParams(); i++){
223  par_means[i] = (*means_vector)(i);
224  }
225  MACH3LOG_INFO("Found Means in External File, Will be able to adapt");
226  }
227  // Totally fine if it doesn't exist, we just can't do adaption
228  else{
229  // We don't need a means vector, set the adaption=false
230  MACH3LOG_WARN("Cannot find means vector in {}, therefore I will not be able to adapt!", matrix_file_name);
231  use_adaptive = false;
232  }
233 
234  matrix_file->Close();
235  MACH3LOG_INFO("Set up matrix from external file");
236 }

◆ SetTotalSteps()

void adaptive_mcmc::AdaptiveMCMCHandler::SetTotalSteps ( const int  nsteps)
inline

Change Total Number of Steps to new value.

Definition at line 104 of file AdaptiveMCMCHandler.h.

104  {
105  total_steps = nsteps;
106  }

◆ SkipAdaption()

bool adaptive_mcmc::AdaptiveMCMCHandler::SkipAdaption ( ) const

Tell if we are Skipping Adaption.

Definition at line 310 of file AdaptiveMCMCHandler.cpp.

310  {
311 // ********************************************
313  total_steps< start_adaptive_update) return true;
314  else return false;
315 }

◆ UpdateAdaptiveCovariance()

void adaptive_mcmc::AdaptiveMCMCHandler::UpdateAdaptiveCovariance ( )

Method to update adaptive MCMC [12].

Parameters
_fCurrValValue of each parameter necessary for updating throw matrix

Definition at line 239 of file AdaptiveMCMCHandler.cpp.

239  {
240 // ********************************************
241  std::vector<double> par_means_prev = par_means;
242  int steps_post_burn = total_steps - start_adaptive_update;
243 
244  // Step 1: Update means and compute deviations
245  for (int i = 0; i < GetNumParams(); ++i) {
246  if (IsFixed(i)) continue;
247 
248  par_means[i] = (CurrVal(i) + par_means_prev[i]*steps_post_burn)/(steps_post_burn+1);
249  // Left over from cyclic means
250  }
251 
252  // Step 2: Update covariance
253  #ifdef MULTITHREAD
254  #pragma omp parallel for
255  #endif
256  for (int i = 0; i < GetNumParams(); ++i) {
257  if (IsFixed(i)) {
258  (*adaptive_covariance)(i, i) = 1.0;
259  continue;
260  }
261 
262  int block_i = adapt_block_matrix_indices[i];
263 
264  for (int j = 0; j <= i; ++j) {
265  if (IsFixed(j) || adapt_block_matrix_indices[j] != block_i) {
266  (*adaptive_covariance)(i, j) = 0.0;
267  (*adaptive_covariance)(j, i) = 0.0;
268  continue;
269  }
270 
271  double cov_prev = (*adaptive_covariance)(i, j);
272  double cov_updated = 0.0;
273 
274  if (steps_post_burn > 0) {
275  // Haario-style update
276  double cov_t = cov_prev * (steps_post_burn - 1) / steps_post_burn;
277  double prev_means_t = steps_post_burn * par_means_prev[i] * par_means_prev[j];
278  double curr_means_t = (steps_post_burn + 1) * par_means[i] * par_means[j];
279  double curr_step_t = CurrVal(i) * CurrVal(j);
280 
281  cov_updated = cov_t + adaption_scale * (prev_means_t - curr_means_t + curr_step_t) / steps_post_burn;
282  }
283 
284  (*adaptive_covariance)(i, j) = cov_updated;
285  (*adaptive_covariance)(j, i) = cov_updated;
286  }
287  }
288 }
bool IsFixed(const int ipar) const
Check if a parameter is fixed.
double CurrVal(const int par_index) const
Get Current value of parameter.

◆ UpdateMatrixAdapt()

bool adaptive_mcmc::AdaptiveMCMCHandler::UpdateMatrixAdapt ( )

Tell whether matrix should be updated.

Definition at line 298 of file AdaptiveMCMCHandler.cpp.

298  {
299 // ********************************************
301  // Check whether the number of steps is divisible by the adaptive update step
302  // e.g. if adaptive_update_step = 1000 and (total_step - start_adpative_throw) is 5000 then this is true
304  return true;
305  }
306  else return false;
307 }

Member Data Documentation

◆ _fCurrVal

const std::vector<double>* adaptive_mcmc::AdaptiveMCMCHandler::_fCurrVal
private

Current values of parameters.

Definition at line 175 of file AdaptiveMCMCHandler.h.

◆ _fFixedPars

const std::vector<double>* adaptive_mcmc::AdaptiveMCMCHandler::_fFixedPars
private

Vector of fixed parameters.

Definition at line 172 of file AdaptiveMCMCHandler.h.

◆ adapt_block_matrix_indices

std::vector<int> adaptive_mcmc::AdaptiveMCMCHandler::adapt_block_matrix_indices
private

Indices for block-matrix adaption.

Definition at line 153 of file AdaptiveMCMCHandler.h.

◆ adapt_block_sizes

std::vector<int> adaptive_mcmc::AdaptiveMCMCHandler::adapt_block_sizes
private

Size of blocks for adaption.

Definition at line 156 of file AdaptiveMCMCHandler.h.

◆ adaption_scale

double adaptive_mcmc::AdaptiveMCMCHandler::adaption_scale
private

Scaling factor.

Definition at line 169 of file AdaptiveMCMCHandler.h.

◆ adaptive_covariance

TMatrixDSym* adaptive_mcmc::AdaptiveMCMCHandler::adaptive_covariance
private

Full adaptive covariance matrix.

Definition at line 163 of file AdaptiveMCMCHandler.h.

◆ adaptive_save_n_iterations

int adaptive_mcmc::AdaptiveMCMCHandler::adaptive_save_n_iterations
private

If you don't want to save every adaption then you can specify this here

Definition at line 147 of file AdaptiveMCMCHandler.h.

◆ adaptive_update_step

int adaptive_mcmc::AdaptiveMCMCHandler::adaptive_update_step
private

Steps between changing throw matrix.

Definition at line 143 of file AdaptiveMCMCHandler.h.

◆ end_adaptive_update

int adaptive_mcmc::AdaptiveMCMCHandler::end_adaptive_update
private

Steps between changing throw matrix.

Definition at line 140 of file AdaptiveMCMCHandler.h.

◆ output_file_name

std::string adaptive_mcmc::AdaptiveMCMCHandler::output_file_name
private

Name of the file to save the adaptive matrices into.

Definition at line 150 of file AdaptiveMCMCHandler.h.

◆ par_means

std::vector<double> adaptive_mcmc::AdaptiveMCMCHandler::par_means
private

Mean values for all parameters.

Definition at line 160 of file AdaptiveMCMCHandler.h.

◆ start_adaptive_throw

int adaptive_mcmc::AdaptiveMCMCHandler::start_adaptive_throw
private

Meta variables related to adaption run time When do we start throwing

Definition at line 134 of file AdaptiveMCMCHandler.h.

◆ start_adaptive_update

int adaptive_mcmc::AdaptiveMCMCHandler::start_adaptive_update
private

When do we stop update the adaptive matrix.

Definition at line 137 of file AdaptiveMCMCHandler.h.

◆ total_steps

int adaptive_mcmc::AdaptiveMCMCHandler::total_steps
private

Total number of MCMC steps.

Definition at line 166 of file AdaptiveMCMCHandler.h.


The documentation for this class was generated from the following files: