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
After #6 is done, we should write a test comparing optimization of a RooGaussian pdf via a regular RooMinimizer to doing the same with RooGaussMinimizer. Ideally, we would get exactly the same results given the same dataset and initial parameter values.
Using the GaussMinimizer test script that constructs a gaussian pdf between -3 and 3 with a mean of 0 and a width of 1 and a data set of 10000 events drawn from this distribution. We call first migrad, hesse and minos on the default RooMinimizer object. Next we do the same on the RooGaussMinimizer object whereby the RooGaussMinimizerFcn object has two print statements added. func eval x every time the DoEval() function is called and grad value y every time the DoDerivative() function is called. The results are as follows:
nominal mu fit is, 0.0066467484469
trying GaussMinimizer
using gradient!
func eval 56225.6
func eval 56225.6
grad value -28618.6
func eval 33510.9
func eval 54855.8
func eval 41241.2
func eval 47021.1
func eval 26128.2
func eval 45737.8
func eval 16320.4
func eval 15214.5
func eval 31578.8
func eval 51979.5
func eval 48778.3
func eval 15214.5
grad value -4585.89
func eval 56914.2
func eval 33860
func eval 50366.6
func eval 19687.2
func eval 21489.7
func eval 48337.1
func eval 38306.9
func eval 48503.6
func eval 33364.4
func eval 48613.1
func eval 59019.6
func eval 15214.5
func eval 15232.3
func eval 15196.8
func eval 15344.7
func eval 15091.7
func eval 15217.3
func eval 15211.7
func eval 14164
func eval 14164
grad value 147.912
func eval 14162.9
func eval 14162.9
grad value -2.19658
func eval 14162.9
func eval 14162.9
grad value 8.21001e-05
migrad worked with mu of 0.00664672559025
func eval 14162.9
func eval 14162.9
func eval 14162.9
func eval 14162.9
func eval 14162.9
hesse worked with mu of 0.00664672559025
func eval 14163.9
func eval 14163.9
minos worked with mu of 0.00664672559025
My guess about why there are no grad calls for hesse and minos is that the minimization has been performed already with migrad and the values have not been reset after that.
Converted the Python test script to c++, results are (luckily) the same. Setting the value of mu to -2.9 before the nominal fit doesn't change much.
I also tried resetting the value of mu between migrad and hesse runs, but this didn't change anything. Apparently, MINUIT is reluctant to discard the information from its Migrad minimization run :)
If you try to just run hesse on a clean minimizer, it complains: WARNING:Minization -- RooGaussMinimizer::hesse: Error, run Migrad before Hesse!.
In any case, this seems to confirm why there are no more gradient calls in hesse and minos.
Activity
egpbos commentedon Aug 31, 2017
In fact, we could write the test first and do test-driven development of RooGaussMinimizer, but this is up to you @vincecr0ft
vincecr0ft commentedon Sep 27, 2017
Using the GaussMinimizer test script that constructs a gaussian pdf between -3 and 3 with a mean of 0 and a width of 1 and a data set of 10000 events drawn from this distribution. We call first
migrad,hesseandminoson the defaultRooMinimizerobject. Next we do the same on theRooGaussMinimizerobject whereby theRooGaussMinimizerFcnobject has two print statements added. func eval x every time theDoEval()function is called and grad value y every time theDoDerivative()function is called. The results are as follows:egpbos commentedon Oct 19, 2017
My guess about why there are no
gradcalls forhesseandminosis that the minimization has been performed already withmigradand the values have not been reset after that.Btw, why is
mureset to-2.9in the second stage in https://github.com/roofit-dev/parallel-roofit-scripts/blob/master/GaussMinimizer.py?egpbos commentedon Oct 24, 2017
Converted the Python test script to c++, results are (luckily) the same. Setting the value of
muto-2.9before the nominal fit doesn't change much.I also tried resetting the value of
mubetweenmigradandhesseruns, but this didn't change anything. Apparently, MINUIT is reluctant to discard the information from its Migrad minimization run :)If you try to just run
hesseon a clean minimizer, it complains:WARNING:Minization -- RooGaussMinimizer::hesse: Error, run Migrad before Hesse!.In any case, this seems to confirm why there are no more gradient calls in
hesseandminos.Tried some things to confirm MINUIT behavior
Fix cling::Interpreter::compileFunction getting confused by trailing …
[cling] Lifetime of MetaParser is that of its input:
[DF] Avoid crash in tutorial due to reused canvas name
[treeplayer] Fix memory management of C-style array branches in test