TFitResult. derivative of the fit function from fit result. Any example, tutorial, please

I want to get derivative of the fit function from fit result.
Any example, tutorial, please.

Regards. Veleriy

Could you update ROOT web reference guide to the modern smartphone-friendly style.
Something like this

I think you want to have the derivative of your model function you have used for fitting. Is it with respect to the observables x or the parameters ?
If the function is represented as TF1 object, you can do as in this tutorial example.


Hi Lorenzo.
I need a derivative function for BFGS minimisation.
What is the best way do it with ROOT?

Regards. Valeriy


In this case you need the derivative of the objective function, the chi2 or the likelihood function.
You can get these functions from the Fitter class and if you have built them with gradient support they provide a method to compute the gradient. See for example ROOT: ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType > Class Template Reference.

The tutorial ROOT: tutorials/fit/combinedFit.C File Reference showns an example on how to create the objective function and used it for fitting.
I can provide you an example where the gradient is used, but it is better you send me your code and I can modify to show how to get it in your code.


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