roofit-dev / root

Fork of official ROOT repository for RooFit development
https://www.esciencecenter.nl/project/automated-parallel-calculation-of-collaborative-statistical-models
Other
0 stars 3 forks source link

Write RooGaussMinimizer[Fcn] #6

Closed egpbos closed 6 years ago

egpbos commented 7 years ago

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.

egpbos commented 7 years ago

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 commented 6 years ago

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?

egpbos commented 6 years ago

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:

vincecr0ft commented 6 years ago

I think we just need testing now and therefore this can be closed...