|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
High-level driver for likelihood minimization and 2D contour extraction. More...
#include <Fit.h>
Public Member Functions | |
| MLFitter (std::shared_ptr< LikelihoodContext > ctx, const ModelFn &model, MLFitOptions options={}) | |
| Constructs a fitter from a likelihood context and model function. | |
| MLFitter (std::shared_ptr< BaseLikelihood > like, MLFitOptions options={}) | |
| Constructs a fitter from an already configured base likelihood. | |
| FitResult | maximum_likelihood_fit (const std::vector< double > &p0) |
| Runs the global maximum-likelihood fit. | |
| Contour | contour (std::size_t x_id, std::size_t y_id, double z, std::array< double, 4 > bounds, ContourOptions options) const |
| Computes a 2D confidence contour after the global fit. | |
High-level driver for likelihood minimization and 2D contour extraction.
MLFitter owns a profileable likelihood, performs the global maximum- likelihood fit, stores the best-fit state, and subsequently builds confidence contours for selected fit-parameter pairs.
Typical usage:
| MLFitter::MLFitter | ( | std::shared_ptr< LikelihoodContext > | ctx, |
| const ModelFn & | model, | ||
| MLFitOptions | options = {} |
||
| ) |
Constructs a fitter from a likelihood context and model function.
A BaseLikelihood is created internally. The number of fit parameters is inferred from ctx->fp_defs.
| ctx | Likelihood context containing distributions, observations and parameter definitions. |
| model | Model function mapping fit and nuisance parameters to predicted observables. |
| options | Fit options controlling the minimization and covariance extraction. |
|
explicit |
| Contour MLFitter::contour | ( | std::size_t | x_id, |
| std::size_t | y_id, | ||
| double | z, | ||
| std::array< double, 4 > | bounds, | ||
| ContourOptions | options | ||
| ) | const |
Computes a 2D confidence contour after the global fit.
| x_id | Index of the first fit parameter in the global fit-parameter block. |
| y_id | Index of the second fit parameter in the global fit-parameter block. |
| z | Gaussian-equivalent confidence level in standard deviations. |
| bounds | Contour bounds ordered as {xmin, xmax, ymin, ymax}. |
| options | Contour and profiling options. |
| FitResult MLFitter::maximum_likelihood_fit | ( | const std::vector< double > & | p0 | ) |
Runs the global maximum-likelihood fit.
The fit parameters are initialized from p0, while nuisance parameters keep the values stored in the likelihood parameter definitions. The returned FitResult contains the best-fit values, profiled nuisance estimates, minimum NLL, and covariance-derived uncertainties when available.
| p0 | Initial values for the fit-parameter block. |