GSLNLSMinimizer tutorial

Dear Rooters,

Are there any tutorials of how to use GSLNLSMinimizer. I have tried to follow the same approach as described here but I got this error:

Processing NumericalMinimization.C...
Error in <ROOT::Math::GSLNLSMinimizer::Minimize>: Function has not been  set
Minimum: f(-1,1.2): 8
(int) 0

Thank you in advance

root [0] .x ${ROOTSYS}/tutorials/fit/NumericalMinimization.C("GSLMultiFit")
GSLNLSMinimizer: Invalid function set - only Chi2Func supported
1 Like

@moneta thank you, but I am sorry I don’t understand what that means ?!


The GSLNLSMInimizer is a special class of minimizer which work only on some specific type of function to minimize and not whatever function.
They can work for example on least square functions or also on negative log-likelihood functions.
You need to pass a function to minimize which inherits from the ROOT::Math::BasicFitMethodFunction interface. See

For example passing a ROOT::Math::Chi2Function will be fine


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.