![]() |
MaCh3 2.2.1
Reference Guide
|
This executable calculates the \( \hat{R} \) estimator for Markov Chain Monte Carlo (MCMC) convergence. More...
#include "Manager/Manager.h"
#include "Samples/SampleStructs.h"
#include "TObjArray.h"
#include "TChain.h"
#include "TFile.h"
#include "TBranch.h"
#include "TCanvas.h"
#include "TLine.h"
#include "TLegend.h"
#include "TString.h"
#include "TH1.h"
#include "TRandom3.h"
#include "TStopwatch.h"
#include "TColor.h"
#include "TStyle.h"
#include "TROOT.h"
Go to the source code of this file.
Functions | |
void | PrepareChains () |
void | InitialiseArrays () |
void | RunDiagnostic () |
void | CalcRhat () |
void | SaveResults () |
void | DestroyArrays () |
double | CalcMedian (double arr[], int size) |
void | CapVariable (double var, double cap) |
int | main (int argc, char *argv[]) |
Variables | |
int * | Ntoys_requested |
int * | Ntoys_filled |
int | TotToys |
int | NThin |
int | Nchains |
int | nDraw |
std::vector< TString > | BranchNames |
std::vector< std::string > | MCMCFile |
std::vector< bool > | ValidPar |
double * | S1_global |
double * | S2_global |
double ** | S1_chain |
double ** | S2_chain |
double ** | Mean |
double ** | StandardDeviation |
double * | MeanGlobal |
double * | StandardDeviationGlobal |
double * | BetweenChainVariance |
double * | MarginalPosteriorVariance |
double * | RHat |
double * | EffectiveSampleSize |
This executable calculates the \( \hat{R} \) estimator for Markov Chain Monte Carlo (MCMC) convergence.
KS: This exe is meant to calculate the \( \hat{R} \) estimator. For a well-converged chain, this distribution should be centered at one. The \( \hat{R} \) statistic is used to assess the convergence of MCMC simulations and helps determine whether the chains have reached a stable distribution.
[29].
MJR: Update – Improved memory usage so that whole chains can be quickly loaded without requiring copious amounts of RAM. This comes at the cost of not being able to calculate the Folded RHat since finding the median requires the loading of full chains at a time. The method has been validated to give identical results to the "High Memory" (original) version at a fraction of the runtime and resources.
The input format is also slightly altered; since we can now load entire chains, there's less need to specify how many toys are desired for a sub-sample, so the Ntoys input has been removed.
KS: This exe is meant to calculate the \( \hat{R} \) estimator. For a well-converged chain, this distribution should be centered at one. The \( \hat{R} \) statistic is used to assess the convergence of MCMC simulations and helps determine whether the chains have reached a stable distribution.
[29].
Definition in file RHat.cpp.
double CalcMedian | ( | double | arr[], |
int | size | ||
) |
void CalcRhat | ( | ) |
Definition at line 383 of file RHat.cpp.
void CapVariable | ( | double | var, |
double | cap | ||
) |
void DestroyArrays | ( | ) |
void InitialiseArrays | ( | ) |
Definition at line 335 of file RHat.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 83 of file RHat.cpp.
void PrepareChains | ( | ) |
Definition at line 142 of file RHat.cpp.
void RunDiagnostic | ( | ) |
void SaveResults | ( | ) |
Definition at line 487 of file RHat.cpp.