Skip to content

Test RooGaussMinimizer #8

Open
Open

Description

@egpbos

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.

Activity

  1. egpbos commented on Aug 31, 2017

    @egpbos
    MemberAuthor

    In fact, we could write the test first and do test-driven development of RooGaussMinimizer, but this is up to you @vincecr0ft

  2. vincecr0ft commented on Sep 27, 2017

    @vincecr0ft
    Member

    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
    
  3. egpbos commented on Oct 19, 2017

    @egpbos
    MemberAuthor

    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.

    Btw, why is mu reset to -2.9 in the second stage in https://github.com/roofit-dev/parallel-roofit-scripts/blob/master/GaussMinimizer.py?

  4. egpbos commented on Oct 24, 2017

    @egpbos
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions