|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Facade exposing statistical workflows for an ObservableInterface. More...
#include <StatisticInterface.h>
Public Member Functions | |
| StatisticInterface (StatisticConfig config, std::shared_ptr< ObservableInterface > oi_) | |
| Constructs the statistical interface around an observable backend. | |
| void | select_experiment (const std::string &experiment) |
| Restricts the analysis to a single experiment. | |
| void | select_experiments (const std::vector< std::string > &experiments) |
| Restricts the analysis to a set of experiments. | |
| void | select_experiments_all () |
| Clears any experiment restriction and uses all experiments. | |
| bool | has_experiment_selection () const noexcept |
| Tests whether an experiment selection is active. | |
| std::set< std::string > | selected_experiments () const |
| Returns the currently selected experiments. | |
| void | select_experiment_observables (const std::vector< ExperimentObs > &observables) |
| Restricts the analysis to exact experiment/observable/bin entries. | |
| void | select_experiment_observables_all () |
| Clears any exact experimental-observable restriction. | |
| bool | has_experiment_observable_selection () const noexcept |
| Tests whether an exact experimental-observable selection is active. | |
| std::set< ExperimentObs > | selected_experiment_observables () const |
| Returns the active exact experimental-observable selection. | |
| std::map< BinnedObservableId, GaussianSummary > | compute_uncertainties () |
| Computes Gaussian uncertainty summaries for all active observables. | |
| std::map< ParamId, double > | get_active_observable_dependencies () |
| Returns the nuisance/input parameters currently seen by the statistical manager. | |
| MCResult | compute_uncertainties_and_sampling () |
| Runs uncertainty propagation and returns both samples and summaries. | |
| FitResultWithMaps | compute_MLE (const std::vector< ParamId > &p_specs) |
| Runs a maximum-likelihood fit for the requested fit parameters. | |
| Contour | compute_confidence_contour (ParamId p1, ParamId p2, double z, std::array< double, 4 > bounds, ContourOptions options) |
| Computes a two-dimensional confidence contour. | |
| void | reload_nuisance_specs () |
| Reloads default and user nuisance specifications. | |
| void | set_nuisance_user_file (const std::string &user_yaml_path) |
| Uses a specific user nuisance configuration file. | |
| void | clear_nuisance_user_file () |
| Restores the default user nuisance file lookup. | |
| void | prepare_likelihood_for_scan (const std::vector< ParamId > &p_specs) |
| Builds and stores the likelihood objects required for scan calls. | |
| void | set_manual_scan_point (const std::map< ParamId, double > &p_hat, const std::map< ParamId, double > &eta_hat) |
| Manually sets the central point used by likelihood scans. | |
| LikelihoodScanGrid | scan_likelihood_around_current_point (ParamId p1, ParamId p2, double x_half_width, double y_half_width, std::size_t nx, std::size_t ny) const |
| Evaluates a rectangular likelihood scan around the current point. | |
| void | save_likelihood_scan_csv (const std::string &path, const LikelihoodScanGrid &grid) const |
| Saves a likelihood scan grid as a CSV file. | |
| void | update_cache (const std::vector< ParamId > &p_specs=std::vector< ParamId >()) |
| Refreshes the cached statistical inputs. | |
| std::map< ParamId, double > | get_all_obss_deps () |
| Selects all nuisance dependencies relevant to the current observable set. | |
| std::map< ParamId, double > | get_p_specs (const std::vector< ParamId > &p_specs) |
| std::map< ParamId, std::map< ParamId, double > > | get_all_correlations () |
| std::map< ExperimentObs, std::map< ExperimentObs, double > > | get_all_obs_correlations () |
| std::map< ExperimentObs, double > | get_obs_exp () |
| void | print_cache () |
| Prints the current manager cache for diagnostics. | |
Public Attributes | |
| ProfileBackend = ProfilerMode | |
Facade exposing statistical workflows for an ObservableInterface.
The class owns a configured StatisticManager and forwards high-level operations such as uncertainty propagation, maximum-likelihood fits, confidence contours and likelihood scans.
Definition at line 29 of file StatisticInterface.h.
| StatisticInterface::StatisticInterface | ( | StatisticConfig | config, |
| std::shared_ptr< ObservableInterface > | oi_ | ||
| ) |
Constructs the statistical interface around an observable backend.
The constructor creates the default proxy stack, initializes the underlying StatisticManager, selects all experiments and builds the initial cache.
| config | Statistic configuration. |
| oi_ | Observable interface to use for predictions. |
Definition at line 5 of file StatisticInterface.cpp.
| void StatisticInterface::clear_nuisance_user_file | ( | ) |
Restores the default user nuisance file lookup.
Definition at line 96 of file StatisticInterface.cpp.
| Contour StatisticInterface::compute_confidence_contour | ( | ParamId | p1, |
| ParamId | p2, | ||
| double | z, | ||
| std::array< double, 4 > | bounds, | ||
| ContourOptions | options | ||
| ) |
Computes a two-dimensional confidence contour.
| p1 | First fit parameter. |
| p2 | Second fit parameter. |
| z | Gaussian-equivalent confidence level in standard deviations. |
| bounds | Contour bounds as {xmin, xmax, ymin, ymax}. |
| options | Contour and profiling options. |
Definition at line 82 of file StatisticInterface.cpp.
| FitResultWithMaps StatisticInterface::compute_MLE | ( | const std::vector< ParamId > & | p_specs | ) |
Runs a maximum-likelihood fit for the requested fit parameters.
| p_specs | Fit parameters to float. |
Definition at line 78 of file StatisticInterface.cpp.
| std::map< BinnedObservableId, GaussianSummary > StatisticInterface::compute_uncertainties | ( | ) |
Computes Gaussian uncertainty summaries for all active observables.
Definition at line 66 of file StatisticInterface.cpp.
| MCResult StatisticInterface::compute_uncertainties_and_sampling | ( | ) |
Runs uncertainty propagation and returns both samples and summaries.
Definition at line 74 of file StatisticInterface.cpp.
| std::map< ParamId, double > StatisticInterface::get_active_observable_dependencies | ( | ) |
Returns the nuisance/input parameters currently seen by the statistical manager.
This is mostly useful for dev/debug workflows. It runs the same observable dependency path as the cache builder: IModel::get_obs_deps(), leaf-source expansion through the source proxy, and the manager's sensitivity filtering. Runtime/lambda observables are therefore included as long as their dependencies were declared on the ObservableInterface side.
Definition at line 70 of file StatisticInterface.cpp.
Definition at line 140 of file StatisticInterface.cpp.
| std::map< ExperimentObs, std::map< ExperimentObs, double > > StatisticInterface::get_all_obs_correlations | ( | ) |
Definition at line 144 of file StatisticInterface.cpp.
| std::map< ParamId, double > StatisticInterface::get_all_obss_deps | ( | ) |
Selects all nuisance dependencies relevant to the current observable set.
Definition at line 132 of file StatisticInterface.cpp.
| std::map< ExperimentObs, double > StatisticInterface::get_obs_exp | ( | ) |
Definition at line 148 of file StatisticInterface.cpp.
| std::map< ParamId, double > StatisticInterface::get_p_specs | ( | const std::vector< ParamId > & | p_specs | ) |
Definition at line 136 of file StatisticInterface.cpp.
|
noexcept |
Tests whether an exact experimental-observable selection is active.
Definition at line 58 of file StatisticInterface.cpp.
|
noexcept |
Tests whether an experiment selection is active.
Definition at line 38 of file StatisticInterface.cpp.
| void StatisticInterface::prepare_likelihood_for_scan | ( | const std::vector< ParamId > & | p_specs | ) |
Builds and stores the likelihood objects required for scan calls.
The current central values are also stored as the default scan center, so lightweight scans can run without computing a full MLE first. Calling compute_MLE(...) or set_manual_scan_point(...) later replaces that reference point.
| p_specs | Fit parameters defining the scan parameter space. |
Definition at line 101 of file StatisticInterface.cpp.
| void StatisticInterface::print_cache | ( | ) |
Prints the current manager cache for diagnostics.
Definition at line 152 of file StatisticInterface.cpp.
| void StatisticInterface::reload_nuisance_specs | ( | ) |
Reloads default and user nuisance specifications.
Definition at line 86 of file StatisticInterface.cpp.
| void StatisticInterface::save_likelihood_scan_csv | ( | const std::string & | path, |
| const LikelihoodScanGrid & | grid | ||
| ) | const |
Saves a likelihood scan grid as a CSV file.
| path | Output CSV path. |
| grid | Grid to serialize. |
Definition at line 123 of file StatisticInterface.cpp.
| LikelihoodScanGrid StatisticInterface::scan_likelihood_around_current_point | ( | ParamId | p1, |
| ParamId | p2, | ||
| double | x_half_width, | ||
| double | y_half_width, | ||
| std::size_t | nx, | ||
| std::size_t | ny | ||
| ) | const |
Evaluates a rectangular likelihood scan around the current point.
| p1 | First scan parameter. |
| p2 | Second scan parameter. |
| x_half_width | Half-width along the first parameter axis. |
| y_half_width | Half-width along the second parameter axis. |
| nx | Number of grid points along x. |
| ny | Number of grid points along y. |
Definition at line 110 of file StatisticInterface.cpp.
| void StatisticInterface::select_experiment | ( | const std::string & | experiment | ) |
Restricts the analysis to a single experiment.
| experiment | Experiment name to select. |
Definition at line 23 of file StatisticInterface.cpp.
| void StatisticInterface::select_experiment_observables | ( | const std::vector< ExperimentObs > & | observables | ) |
Restricts the analysis to exact experiment/observable/bin entries.
| observables | Exact experimental measurements to keep. |
Definition at line 46 of file StatisticInterface.cpp.
| void StatisticInterface::select_experiment_observables_all | ( | ) |
Clears any exact experimental-observable restriction.
Definition at line 53 of file StatisticInterface.cpp.
| void StatisticInterface::select_experiments | ( | const std::vector< std::string > & | experiments | ) |
Restricts the analysis to a set of experiments.
| experiments | Experiment names to select. |
Definition at line 28 of file StatisticInterface.cpp.
| void StatisticInterface::select_experiments_all | ( | ) |
Clears any experiment restriction and uses all experiments.
Definition at line 33 of file StatisticInterface.cpp.
| std::set< ExperimentObs > StatisticInterface::selected_experiment_observables | ( | ) | const |
Returns the active exact experimental-observable selection.
Definition at line 62 of file StatisticInterface.cpp.
| std::set< std::string > StatisticInterface::selected_experiments | ( | ) | const |
Returns the currently selected experiments.
Definition at line 42 of file StatisticInterface.cpp.
| void StatisticInterface::set_manual_scan_point | ( | const std::map< ParamId, double > & | p_hat, |
| const std::map< ParamId, double > & | eta_hat | ||
| ) |
Manually sets the central point used by likelihood scans.
| p_hat | Fit-parameter values at the scan center. |
| eta_hat | Nuisance-parameter values at the scan center. |
Definition at line 105 of file StatisticInterface.cpp.
| void StatisticInterface::set_nuisance_user_file | ( | const std::string & | user_yaml_path | ) |
Uses a specific user nuisance configuration file.
| user_yaml_path | Path to the user YAML file. |
Definition at line 91 of file StatisticInterface.cpp.
| void StatisticInterface::update_cache | ( | const std::vector< ParamId > & | p_specs = std::vector<ParamId>() | ) |
Refreshes the cached statistical inputs.
| p_specs | Optional fit-parameter list used to define nuisance pruning and dependency handling. |
Definition at line 128 of file StatisticInterface.cpp.
| StatisticInterface.ProfileBackend = ProfilerMode |
Definition at line 69 of file StatisticInterface.py.