Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
Statistics.h File Reference

Statistical helpers for Monte Carlo observable samples. More...

#include <vector>
#include <cmath>
#include <stdexcept>
#include <map>
#include <algorithm>
#include "Include.h"
#include "Math.h"
Include dependency graph for Statistics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ColumnStats
 Summary statistics for one sampled observable column. More...
 

Typedefs

using Vec = std::vector< double >
 
using ObsSamples = std::vector< std::map< BinnedObservableId, double > >
 
using NuisanceSamples = std::vector< std::map< ParamId, double > >
 

Functions

std::pair< std::vector< double >, std::vector< double > > split_vector (const std::vector< double > &x, double mu)
 Splits a vector around a reference value.
 
std::map< BinnedObservableId, ColumnStatssummarize_columns_obs (const ObsSamples &S)
 Computes per-observable summary statistics from Monte Carlo samples.
 

Detailed Description

Statistical helpers for Monte Carlo observable samples.

This header provides lightweight containers and inline utilities used to summarize samples of binned observables and nuisance parameters.

Definition in file Statistics.h.

Typedef Documentation

◆ NuisanceSamples

using NuisanceSamples = std::vector<std::map<ParamId, double> >

Nuisance samples stored as one parameter-value map per Monte Carlo draw.

Definition at line 28 of file Statistics.h.

◆ ObsSamples

using ObsSamples = std::vector<std::map<BinnedObservableId, double> >

Observable samples stored as one observable-value map per Monte Carlo draw.

Definition at line 25 of file Statistics.h.

◆ Vec

using Vec = std::vector<double>

Convenient alias for a one-dimensional numeric vector.

Definition at line 22 of file Statistics.h.

Function Documentation

◆ split_vector()

std::pair< std::vector< double >, std::vector< double > > split_vector ( const std::vector< double > &  x,
double  mu 
)
inline

Splits a vector around a reference value.

Values lower than or equal to mu are returned in the first vector; values above mu are returned in the second vector.

Parameters
xInput values.
muSplit threshold.
Returns
Pair {below_or_equal, above}.

Definition at line 54 of file Statistics.h.

◆ summarize_columns_obs()

std::map< BinnedObservableId, ColumnStats > summarize_columns_obs ( const ObsSamples S)
inline

Computes per-observable summary statistics from Monte Carlo samples.

All sample maps must contain the same number of observables. The observable ordering is taken from the first sample. For each observable, the function computes the mean, unbiased standard deviation, skewness, a discrete mode-like estimator, and split standard deviations around that central value.

Parameters
SObservable samples with shape conceptually equal to N x D.
Returns
Map from observable id to summary statistics.
Exceptions
std::invalid_argumentif S is empty or if the sample maps are jagged.

Definition at line 86 of file Statistics.h.