You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mainly fill out the DoEval with an explicit Gaussian NLL, i.e. something like 0.5*pow((x-mu)/sigma,2) + log(gauss-normalization) and DoDerivative with the derivatives of this to mu and sigma, depending on the index argument.
Re-added migrad functionality in RooGaussMinimizer together with print statements in RooGaussMinimizerFcn. Only DoEval() is called and never DoDerivative() The RooGaussMinimizer just calls the Minuit function which should be overloaded to take a gradient function. Is this recast back to an IMultiGenFunction somewhere?
So, when you initialize the Fitter with a IMultiGradFunction, it should set the fUseGradient flag to kTRUE.
As you say, RooGaussMinimizer::migrad calls Fitter::fitFcn, which calls Fitter::DoMinimization. I don't know if this makes use of fUseGradient. I don't think it will, since it in turn calls Minuit2 things. Minuit2 is an implementation of the Minimizer interface class and the Minimizer class does provide for IMultiGradFunction overloads. However, the question is whether these will be called from the current RooGaussMinimizer
If all of this doesn't work out, we could try to write some custom fitting routine. We can take some inspiration from Fitter::DoBinnedLikelihoodFit and Fitter::DoLeastSquareFit, where fUseGradient is used.
Todo:
Check whether fUseGradient is kTRUE after initialization of the Fitter in the RooGaussMinimizer.
Make sure the IMultiGradFunction Minuit2 functions are called, not the IMultiGenFunction ones.
If not: make it so that it does :)
If it does: find out why DoDerivative is not called; should we overload something else as well?
Activity
egpbos commentedon Aug 31, 2017
Note that the gauss-normalization term (1/sqrt(something pi sigma^something)) contains sigma, so it doesn't drop out in the derivative to sigma.
vincecr0ft commentedon Sep 19, 2017
Re-added migrad functionality in RooGaussMinimizer together with print statements in RooGaussMinimizerFcn. Only
DoEval()is called and neverDoDerivative()The RooGaussMinimizer just calls the Minuit function which should be overloaded to take a gradient function. Is this recast back to an IMultiGenFunction somewhere?egpbos commentedon Sep 20, 2017
So, when you initialize the Fitter with a
IMultiGradFunction, it should set thefUseGradientflag tokTRUE.As you say,
RooGaussMinimizer::migradcallsFitter::fitFcn, which callsFitter::DoMinimization. I don't know if this makes use offUseGradient. I don't think it will, since it in turn calls Minuit2 things. Minuit2 is an implementation of the Minimizer interface class and the Minimizer class does provide forIMultiGradFunctionoverloads. However, the question is whether these will be called from the currentRooGaussMinimizerIf all of this doesn't work out, we could try to write some custom fitting routine. We can take some inspiration from
Fitter::DoBinnedLikelihoodFitandFitter::DoLeastSquareFit, wherefUseGradientis used.Todo:
fUseGradientis kTRUE after initialization of the Fitter in theRooGaussMinimizer.IMultiGradFunctionMinuit2 functions are called, not theIMultiGenFunctionones.vincecr0ft commentedon Sep 27, 2017
I think we just need testing now and therefore this can be closed...
Fix cling::Interpreter::compileFunction getting confused by trailing …
[cling] Lifetime of MetaParser is that of its input:
[cling] DeclExtractor: use `BuildReturnStmt()` instead
[cling] DeclExtractor: use `BuildReturnStmt()` instead
[treeplayer] Fix memory management of C-style array branches in test