![]() |
MaCh3
2.6.1
Reference Guide
|
Module for processing MCMC chains and producing various diagnostic plots. More...
#include <CLI/Modules/ProcessMCMCModule.hpp>
Public Member Functions | |
| virtual | ~ProcessMCMCModule () |
| Destructor. More... | |
| MaCh3ArgumentParser * | get_parser () override |
| Get the argument parser for this module. More... | |
| int | Run () override |
| Execute the MCMC processing. More... | |
Public Member Functions inherited from M3::PluginBase | |
| virtual | ~PluginBase ()=default |
Public Member Functions inherited from M3::IPlugin | |
| virtual | ~IPlugin ()=default |
Private Member Functions | |
| std::map< std::string, std::pair< double, double > > | GetCustomBinning (const YAML::Node &Settings) |
| Parse custom binning edges from YAML configuration. More... | |
| void | ProcessMCMC (const std::string &inputFile) |
| Process a single MCMC chain. More... | |
| void | MultipleProcessMCMC () |
| Compare and process multiple MCMC chains. More... | |
| void | CalcBayesFactor (MCMCProcessor *Processor) |
| Calculate Bayes factors for hypothesis testing. More... | |
| void | CalcSavageDickey (MCMCProcessor *Processor) |
| Calculate Savage-Dickey ratios for Bayes factor estimation. More... | |
| void | CalcParameterEvolution (MCMCProcessor *Processor) |
| Calculate parameter evolution over MCMC steps. More... | |
| void | CalcBipolarPlot (MCMCProcessor *Processor) |
| Create bipolar plots for parameter visualization. More... | |
| void | GetTrianglePlot (MCMCProcessor *Processor) |
| Generate triangle plots showing parameter correlations. More... | |
| void | DiagnoseCovarianceMatrix (MCMCProcessor *Processor, const std::string &inputFile) |
| Diagnose covariance matrix stability across burn-in cuts. More... | |
| TH2D * | TMatrixIntoTH2D (TMatrixDSym *Matrix, const std::string &title) |
| Convert TMatrixDSym to TH2D histogram for plotting. More... | |
| void | KolmogorovSmirnovTest (const std::vector< std::unique_ptr< MCMCProcessor >> &Processor, const std::unique_ptr< TCanvas > &Posterior, const TString &canvasname) |
| Perform Kolmogorov-Smirnov test between posterior distributions. More... | |
Private Attributes | |
| int | nFiles |
| Number of MCMC files being processed. More... | |
| std::vector< std::string > | FileNames |
| List of MCMC chain file paths. More... | |
| std::vector< std::string > | TitleNames |
| List of titles for each chain. More... | |
| std::string | config |
| Path to the configuration file. More... | |
Additional Inherited Members | |
Protected Attributes inherited from M3::PluginBase | |
| std::unique_ptr< MaCh3ArgumentParser > | m_parser |
| Argument parser for this plugin. More... | |
Module for processing MCMC chains and producing various diagnostic plots.
This module provides functionality for:
Definition at line 29 of file ProcessMCMCModule.hpp.
|
virtualdefault |
Destructor.
|
private |
Calculate Bayes factors for hypothesis testing.
| Processor | Pointer to the MCMCProcessor instance |
Computes Bayes factors to compare different models or hypotheses, particularly useful for oscillation parameters and switch parameters. Configuration is read from the YAML file under BayesFactor section.
| Processor | Pointer to the MCMCProcessor instance |
Definition at line 483 of file ProcessMCMCModule.cpp.
|
private |
Create bipolar plots for parameter visualization.
| Processor | Pointer to the MCMCProcessor instance |
Generates bipolar plots to visualize parameter distributions in a circular representation. Configuration is read from the YAML file under BipolarPlot section.
| Processor | Pointer to the MCMCProcessor instance |
Definition at line 557 of file ProcessMCMCModule.cpp.
|
private |
Calculate parameter evolution over MCMC steps.
| Processor | Pointer to the MCMCProcessor instance |
Tracks how parameters evolve during the MCMC chain, useful for diagnosing convergence and burn-in. Configuration is read from the YAML file under ParameterEvolution section.
| Processor | Pointer to the MCMCProcessor instance |
Definition at line 535 of file ProcessMCMCModule.cpp.
|
private |
Calculate Savage-Dickey ratios for Bayes factor estimation.
Calculate Savage-Dickey ratios.
| Processor | Pointer to the MCMCProcessor instance |
Computes Savage-Dickey ratios for Bayes factor estimation at specific parameter values. Configuration is read from the YAML file under SavageDickey section.
| Processor | Pointer to the MCMCProcessor instance |
Definition at line 510 of file ProcessMCMCModule.cpp.
|
private |
Diagnose covariance matrix stability across burn-in cuts.
Diagnose covariance matrix stability.
| Processor | Pointer to the MCMCProcessor instance |
| inputFile | Path to the input file for naming output |
Validates the stability of the posterior covariance matrix by computing it at different burn-in cuts and comparing successive matrices. This helps determine when the matrix becomes stable and the appropriate burn-in length.
| Processor | Pointer to the MCMCProcessor instance |
| inputFile | Path to the input file for naming output files |
Definition at line 604 of file ProcessMCMCModule.cpp.
|
overridevirtual |
Get the argument parser for this module.
Implements M3::IPlugin.
Definition at line 14 of file ProcessMCMCModule.cpp.
|
private |
Parse custom binning edges from YAML configuration.
Parse custom binning edges from a YAML configuration node.
| Settings | YAML node containing CustomBinEdges section |
This function reads the CustomBinEdges section of the YAML config and returns a mapping of parameter names to their lower and upper edges.
The expected YAML syntax is:
| Settings | YAML configuration node containing the optional CustomBinEdges section. |
Definition at line 129 of file ProcessMCMCModule.cpp.
|
private |
Generate triangle plots showing parameter correlations.
| Processor | Pointer to the MCMCProcessor instance |
Creates triangle plots displaying 1D and 2D posterior distributions for sets of correlated parameters. Configuration is read from the YAML file under TrianglePlot section.
| Processor | Pointer to the MCMCProcessor instance |
Definition at line 577 of file ProcessMCMCModule.cpp.
|
private |
Perform Kolmogorov-Smirnov test between posterior distributions.
| Processor | Vector of MCMCProcessor instances |
| Posterior | Canvas for drawing results |
| canvasname | Name for the output PDF |
Tests whether posterior distributions from different MCMC chains are consistent by computing the KS test statistic for each parameter. Results are visualized showing cumulative distributions and D-statistic.
| Processor | Vector of MCMCProcessor instances (one per chain) |
| Posterior | Canvas for drawing the comparison plots |
| canvasname | Name for the output PDF file |
Definition at line 810 of file ProcessMCMCModule.cpp.
|
private |
Compare and process multiple MCMC chains.
Compare multiple MCMC chains.
Processes multiple MCMC chains simultaneously, compares their posterior distributions, and performs Kolmogorov-Smirnov tests to check if posteriors are consistent across chains.
Definition at line 265 of file ProcessMCMCModule.cpp.
|
private |
Process a single MCMC chain.
Process a single MCMC chain file.
| inputFile | Path to the MCMC chain ROOT file |
Loads the MCMC chain, applies configuration settings, and produces various diagnostic plots and analyses including posteriors, correlations, credible intervals, and Bayes factors.
| inputFile | Path to the MCMC chain ROOT file |
Definition at line 158 of file ProcessMCMCModule.cpp.
|
overridevirtual |
Execute the MCMC processing.
Implements M3::IPlugin.
Definition at line 63 of file ProcessMCMCModule.cpp.
|
private |
Convert TMatrixDSym to TH2D histogram for plotting.
Convert TMatrixDSym to TH2D histogram.
| Matrix | Pointer to the symmetric matrix |
| title | Title for the resulting histogram |
Converts a ROOT symmetric matrix to a 2D histogram for visualization and easier manipulation with ROOT plotting tools.
| Matrix | Pointer to the symmetric matrix |
| title | Title for the resulting histogram |
Definition at line 787 of file ProcessMCMCModule.cpp.
|
private |
Path to the configuration file.
Definition at line 99 of file ProcessMCMCModule.hpp.
|
private |
List of MCMC chain file paths.
Definition at line 97 of file ProcessMCMCModule.hpp.
|
private |
Number of MCMC files being processed.
Definition at line 96 of file ProcessMCMCModule.hpp.
|
private |
List of titles for each chain.
Definition at line 98 of file ProcessMCMCModule.hpp.