# Non Linear Least Square Fit with GSL MultiFit

**URL:** <https://root-forum.cern.ch/t/non-linear-least-square-fit-with-gsl-multifit/16602>\
**Category:** ROOT\
**Created:** [September 4, 2013, 8:23pm UTC](https://root-forum.cern.ch/t/non-linear-least-square-fit-with-gsl-multifit/16602 "2013-09-04T20:23:05Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![ChristopherP](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/e47774/32.png) [@ChristopherP](https://root-forum.cern.ch/u/ChristopherP)\
**Post date:** [September 12, 2013, 4:50pm UTC](https://root-forum.cern.ch/t/non-linear-least-square-fit-with-gsl-multifit/16602/10 "2013-09-12T16:50:59Z")

</div>

Hi,

now I am back with new problems.

I have expanded the my script to the case of simultaneously fitting two equal model functions which have 3 parameters each of which they have 1 in common.

I oriented myself on the example another user has posted here  
[url][Simultaneous hist fit; ROOT::Math::IMultiGenFunction trouble](https://root-forum.cern.ch/t/simultaneous-hist-fit-root-math-imultigenfunction-trouble/14668/1)

This was of great help since it is my plan to make the script applicable for an arbitrary number of equal model functions of which all share 1 common parameter which is what I tried to do.

I can compile the script and everything works so far just not the fitting.  
The error message I get is:

GSLNLSMinimizer: Invalid function set - only Chi2Func supported  
Error in ROOT::Math::GSLNLSMinimizer::Minimize: Function has not been set  
Error: Empty FitResult !

For me it is not clear why this happens since everything is very similar to the tutorial  
[http://root.cern.ch/root/html/tutorials/fit/combinedFit.C.html](http://root.cern.ch/root/html/tutorials/fit/combinedFit.C.html)

Could you please have a look on my code one more time? I think you could directly see where I am going wrong.

I attached my code and the two necessary files for fitting.

Best regards,  
Chris  
[fit\_mass\_table\_beta\_6\_qmass\_0.03\_tc\_WL.dat](https://root-forum.cern.ch/uploads/default/original/2X/a/a1236e283193c121fa612c841a005ac8d29231e8.dat) (561 Bytes)  
[fit\_mass\_table\_beta\_6\_qmass\_0.03\_tc\_Pion.dat](https://root-forum.cern.ch/uploads/default/original/2X/6/6e6c68b0f39e84db69b0e594cf3d3d8ad4b8d6f8.dat) (565 Bytes)  
[TestCombFit.C](https://root-forum.cern.ch/uploads/default/original/2X/c/cd579d88eaf7852e3611c7b4df60be5e41193b6e.C) (7.05 KB)

---

_[View the full topic](https://root-forum.cern.ch/t/non-linear-least-square-fit-with-gsl-multifit/16602)._
