I’m trying to fit data points by three functions, namely fun1, fun2, and fun3, to check which one is fitting the best. But I’m unable to do that: for fun1 chi^2/ndf is not near 1, for fun2 the parameters 2 and 3 is showing large errors, for fun3 not able to fit at all!
As per my understanding of the data points, fun3 should fit good but it’s not coming. Please find attached the macro.
Thank you for replying @Wile_E_Coyote . I’ve plotted the functions with initial values that I’m using to fit the data points, please see the attached image. I’ve updated the macro also to accommodate this. But still the same bad fitting is happening. Could you please check?
Do not use the “W” option (your data points are spread over many orders of magnitude in “y”, so their “y” errors always need to be correctly taken into account).
I did this change that you’ve suggested. I’m getting the attached fitting for the three functions. You can see that in fun2, error in p2 is large. Similarly, error in p1 is large in fun3.
So, how to decide which one to use finally? Also, is chi2/ndf reliable here, in all the three cases?
Below is fun3:
This is what I’m getting now for fun3 (see attached).
So, may you suggest which function I finally choose? Also, should I take chi2/ndf seriously in all the three cases? If so, then for fun1 it’s 0.14 and for fun3 it is 0.11, so should I go with fun3?