Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
Profiler.h
Go to the documentation of this file.
1#ifndef WITHPROFILING_H
2#define WITHPROFILING_H
3
4#include "ILikelihood.h"
5#include "Math.h"
6#include "Indexing.h"
7#include "GradientHelper.h"
8
25enum class ProfilerMode {
26 MINUIT,
28};
29
39 std::vector<std::size_t> free_params;
40 std::map<std::size_t, double> fixed_params;
41 std::vector<double> start;
42};
43
49 double nll_hat = 1e300;
50 std::map<std::size_t, double> theta_hat;
51 bool converged = false;
52};
53
64class Profiler {
65public:
73 std::shared_ptr<fit_app::IFitBackend> minimizer,
75 );
76
93 std::shared_ptr<ILikelihood> base,
94 const ProfileRequest& pr
95 ) const;
96
97private:
106 ProfileResult profile_minuit(
107 std::shared_ptr<ILikelihood> base,
108 const ProfileRequest& pr
109 ) const;
110
126 ProfileResult profile_laplace_nuisance(
127 std::shared_ptr<ILikelihood> base,
128 const ProfileRequest& pr
129 ) const;
130
131 std::shared_ptr<fit_app::IFitBackend> minimizer;
133};
134
135#endif // WITHPROFILING_H
Numerical derivative and Laplace profiling helpers for nuisance parameters.
Abstract interface for likelihood functions used by the fitting layer.
Helpers for converting between indexed maps and dense containers.
ProfilerMode
Available algorithms for profiling free parameters.
Definition Profiler.h:25
@ MINUIT
Use the configured numerical minimizer backend.
@ LAPLACE_NUISANCE
Use the Laplace nuisance approximation when possible, with Minuit fallback.
Minimizes a likelihood over free parameters subject to fixed constraints.
Definition Profiler.h:64
ProfileResult profile(std::shared_ptr< ILikelihood > base, const ProfileRequest &pr) const
Profiles a likelihood according to a request.
Definition Profiler.cpp:93
Input specification for a constrained profile minimization.
Definition Profiler.h:38
std::vector< std::size_t > free_params
Global indices of parameters released during profiling.
Definition Profiler.h:39
std::map< std::size_t, double > fixed_params
Fixed parameter values keyed by global parameter index.
Definition Profiler.h:40
std::vector< double > start
Initial full parameter vector used as a warm start.
Definition Profiler.h:41
Output of a constrained profile minimization.
Definition Profiler.h:48
double nll_hat
Minimum or approximate profiled NLL value.
Definition Profiler.h:49
bool converged
True when the profiler accepted the result as reliable.
Definition Profiler.h:51
std::map< std::size_t, double > theta_hat
Profiled parameter values keyed by global parameter index.
Definition Profiler.h:50