24 std::vector<double>
result;
26 unsigned int fPositionsSize =
fPositions.size();
28 for (
unsigned int i = 0; i < fPositionsSize; i++) {
30 const std::vector<double> ¤tPosition =
fPositions[i];
61 const double minDouble = 8.0 * std::numeric_limits<double>::min();
62 const double minDouble2 = std::sqrt(minDouble);
63 const double maxDouble2 = 1.0 / minDouble2;
67 std::vector<double> &grad =
Gradient();
69 int npar = par.size();
70 double logLikelihood = 0;
72 h.resize(
static_cast<unsigned int>(0.5 * npar * (npar + 1)));
73 grad.assign(npar, 0.0);
74 h.assign(
static_cast<unsigned int>(0.5 * npar * (npar + 1)), 0.0);
78 for (
int i = 0; i < nmeas; ++i) {
81 const std::vector<double> ¤tPosition =
fPositions[i];
83 double fval = modelFunc(par);
86 logLikelihood -= std::log(fval);
87 double invFval = 1.0 / fval;
89 std::vector<double> mfg = modelFunc.
GetGradient(par);
93 for (
int j = 0; j < npar; ++j) {
94 if (std::fabs(mfg[j]) < minDouble) {
103 double dfj = invFval * mfg[j];
105 if (std::fabs(dfj) > maxDouble2) {
122 for (
int k = j; k < npar; ++k) {
123 int idx = j + k * (k + 1) / 2;
124 if (std::fabs(mfg[k]) < minDouble) {
131 double dfk = invFval * mfg[k];
134 if (std::fabs(dfk) > maxDouble2) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
std::vector< double > & Hessian()
virtual const std::vector< double > & Gradient() const
Return cached Value of function Gradient estimated previously using the FumiliFCNBase::EvaluateAll me...
void SetFCNValue(double value)
const ParametricFunction * ModelFunction() const
Returns the model function used for the data.
std::vector< double > Elements(const std::vector< double > &par) const override
Evaluates the model function for the different measurement points and the Parameter values supplied.
std::vector< std::vector< double > > fPositions
int GetNumberOfMeasurements() const override
Accessor to the number of measurements used for calculating the maximum likelihood.
const std::vector< double > & GetMeasurement(int Index) const override
Accessor to the position of the measurement (x coordinate).
void EvaluateAll(const std::vector< double > &par) override
Evaluate function Value, Gradient and Hessian using Fumili approximation, for values of parameters p ...
Function which has parameters.
virtual void SetParameters(const std::vector< double > ¶ms) const
Sets the parameters of the ParametricFunction.
virtual std::vector< double > GetGradient(const std::vector< double > &x) const
Member function returning the Gradient of the function with respect to its variables (but without inc...
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...