Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
MCEngine.cpp File Reference
#include "MCEngine.h"
#include "StatisticProgress.h"
#include "ParameterRuntimeContext.h"
#include <algorithm>
#include <atomic>
#include <exception>
#include <fstream>
#include <iomanip>
#include <limits>
#include <mutex>
#include <sstream>
#include <thread>
Include dependency graph for MCEngine.cpp:

Go to the source code of this file.

Functions

RealMatrix symmetrize_covariance_matrix2 (RealMatrix cov)
 
RealMatrix inverse_covariance_with_ridge2 (RealMatrix cov, double ridge_rel, double ridge_abs)
 
MCObservableCovariance covariance_from_obs_samples (const ObsSamples &S, const std::vector< BinnedObservableId > &ids, double ridge_rel, double ridge_abs)
 Builds a regularized empirical covariance matrix from observable samples.
 
std::vector< BinnedObservableIdcovariance_ids_from_first_sample (const ObsSamples &S)
 Extracts the observable ordering from the first Monte Carlo sample.
 

Function Documentation

◆ covariance_from_obs_samples()

MCObservableCovariance covariance_from_obs_samples ( const ObsSamples S,
const std::vector< BinnedObservableId > &  ids,
double  ridge_rel = 1e-8,
double  ridge_abs = 1e-12 
)

Builds a regularized empirical covariance matrix from observable samples.

The samples are read in the order specified by ids. The empirical covariance is converted to a dimensionless correlation matrix, a ridge of max(ridge_rel, ridge_abs) is added to its diagonal, and the inverse is transformed back to covariance units. The returned covariance itself remains the raw empirical estimate.

Parameters
SMonte Carlo observable samples.
idsObservable identifiers defining the covariance ordering.
ridge_relRelative ridge factor.
ridge_absMinimum dimensionless ridge floor.
Returns
Empirical covariance, inverse covariance and column means.
Exceptions
std::invalid_argumentif the sample set is empty, if ids is empty, or if fewer than two samples are provided.

Definition at line 102 of file MCEngine.cpp.

◆ covariance_ids_from_first_sample()

std::vector< BinnedObservableId > covariance_ids_from_first_sample ( const ObsSamples S)

Extracts the observable ordering from the first Monte Carlo sample.

Parameters
SMonte Carlo observable samples.
Returns
Observable identifiers present in the first sample.
Exceptions
std::invalid_argumentif S is empty.

Definition at line 164 of file MCEngine.cpp.

◆ inverse_covariance_with_ridge2()

RealMatrix inverse_covariance_with_ridge2 ( RealMatrix  cov,
double  ridge_rel,
double  ridge_abs 
)

Definition at line 43 of file MCEngine.cpp.

◆ symmetrize_covariance_matrix2()

RealMatrix symmetrize_covariance_matrix2 ( RealMatrix  cov)

Definition at line 15 of file MCEngine.cpp.