|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Global chi-square likelihood with no explicit nuisance parameters. More...
#include <ChiSquaredLikelihood.h>


Public Member Functions | |
| ChiSquaredLikelihood (const ModelFn &model, std::shared_ptr< LikelihoodContext > ctx, std::size_t p_dim, RealMatrix covariance_inv) | |
| Constructs a chi-square likelihood. | |
| double | nll (const std::vector< double > &theta) const override |
| Evaluates the chi-square negative log-likelihood. | |
| std::size_t | dim () const override |
| Returns the total optimization dimension. | |
| RealMatrix | observable_curvature (const std::vector< double > &r) const override |
| Returns the observable-space curvature matrix. | |
| RealMatrix | nuisance_curvature (const std::vector< double > &eta) const override |
| Returns the nuisance-space curvature matrix. | |
Public Member Functions inherited from BaseLikelihood | |
| BaseLikelihood (const ModelFn &model, std::shared_ptr< LikelihoodContext > ctx, size_t p_dim) | |
| Constructs a likelihood from a model and statistical context. | |
| std::vector< fit_app::ParameterDefinition > | get_param_defs () const override |
| Returns all parameter definitions in likelihood-vector order. | |
| void | enable_debug_trace (std::size_t max_evals=25) |
| Enables debug tracing for likelihood evaluations. | |
| void | disable_debug_trace () |
| Disables debug tracing of likelihood evaluations. | |
| std::size_t | p_dimension () const override |
| Returns the dimension of the fitted-parameter block. | |
| std::size_t | eta_dimension () const override |
| Returns the dimension of the nuisance-parameter block. | |
| std::vector< double > | central_p () const override |
| Returns the central values of the fitted parameters. | |
| std::vector< double > | central_eta () const override |
| Returns the central values of the nuisance parameters. | |
| std::vector< double > | predict (const std::vector< double > &p, const std::vector< double > &eta) const override |
| std::vector< double > | residuals (const std::vector< double > &p, const std::vector< double > &eta) const override |
| double | nll_from_split (const std::vector< double > &p, const std::vector< double > &eta) const override |
Public Member Functions inherited from ILikelihood | |
| virtual | ~ILikelihood ()=default |
| Virtual destructor for safe polymorphic deletion. | |
Additional Inherited Members | |
Protected Attributes inherited from BaseLikelihood | |
| std::shared_ptr< LikelihoodContext > | ctx |
| Shared statistical context used by the likelihood. | |
| ModelFn | model |
| Model function evaluated by the likelihood. | |
| std::size_t | p_dim |
| Dimension of the fitted-parameter block. | |
| bool | debug_trace_enabled_ = false |
| Whether evaluation debug tracing is enabled. | |
| std::size_t | debug_trace_max_evals_ = 0 |
| Maximum number of traced evaluations. | |
| std::size_t | debug_eval_count_ = 0 |
| Number of evaluations already traced. | |
| bool | debug_have_ref_theta_ = false |
| Whether the debug reference parameter vector is set. | |
| bool | debug_have_ref_res_ = false |
| Whether the debug reference residual vector is set. | |
| std::vector< double > | debug_ref_theta_ |
| First traced parameter vector used as debug reference. | |
| std::vector< double > | debug_ref_res_ |
| First traced residual vector used as debug reference. | |
Global chi-square likelihood with no explicit nuisance parameters.
The optimization vector is interpreted as the parameter vector 

![\[
\mathrm{NLL}(p)
= \frac{1}{2}
\left(f(p, \emptyset) - O_{\mathrm{exp}}\right)^\top
C^{-1}
\left(f(p, \emptyset) - O_{\mathrm{exp}}\right),
\]](form_51.png)
where 


Definition at line 48 of file ChiSquaredLikelihood.h.
| ChiSquaredLikelihood::ChiSquaredLikelihood | ( | const ModelFn & | model, |
| std::shared_ptr< LikelihoodContext > | ctx, | ||
| std::size_t | p_dim, | ||
| RealMatrix | covariance_inv | ||
| ) |
Constructs a chi-square likelihood.
| model | Model function mapping ![]() eta is expected to be empty. |
| ctx | Shared likelihood context containing observations and parameter definitions. |
| p_dim | Number of parameters of interest. |
| covariance_inv | Inverse covariance matrix used in the quadratic form. |
Definition at line 5 of file ChiSquaredLikelihood.cpp.
|
overridevirtual |
Returns the total optimization dimension.
For this class, the dimension is equal to the number of parameters of interest because no nuisance parameters are explicitly represented.
Reimplemented from BaseLikelihood.
Definition at line 63 of file ChiSquaredLikelihood.cpp.
|
overridevirtual |
Evaluates the chi-square negative log-likelihood.
| std::invalid_argument | if theta does not have dimension p_dim. |
Reimplemented from BaseLikelihood.
Definition at line 15 of file ChiSquaredLikelihood.cpp.
|
overridevirtual |
Returns the nuisance-space curvature matrix.
| eta | Nuisance vector. Must be empty for this likelihood. |

| std::invalid_argument | if eta is not empty. |
Reimplemented from BaseLikelihood.
Definition at line 73 of file ChiSquaredLikelihood.cpp.
|
overridevirtual |
Returns the observable-space curvature matrix.
| r | Residual vector. The argument is accepted for interface compatibility and is not used because the curvature is constant. |
Reimplemented from BaseLikelihood.
Definition at line 67 of file ChiSquaredLikelihood.cpp.