Fit Functions, Log scale and Xscale wierdness
daggaz
The xscaling of the fit_wavename wave returned by the fit function is incorrect (although it initially graphs as it should). Trying to use the findlevel function returns erroneous results, while the binarysearch method works just fine. Regraphing fit_wavename vs calculated in a new window reveals the incorrect xscaling visually. This behavior is resolved if the original data is fit before the axis log transformation.
Is this working as intended, a bug, or am I making a mistake somehow when I define my fit functions?
Graph y vs x waves.
Change display scaling on x axis to logarithmic.
Fit the data.
Output fit wave has erroneous x scaling but displays correctly in the orginal data graph. Findlevel will return erroneous results that clearly do not match the data.
versus
Graph y vs x waves.
Fit the data.
Change display scaling on x axis to logarithmic.
Output fit wave displays correctly and has the correct x scaling.
January 11, 2013 at 02:02 am - Permalink
I added this feature a few years ago because I got tired of people reporting a "bug"- the left end of a fit curve looked odd because the data points of the fit curve were very far apart at the left end of a log axis. This feature has reduced the incidence of bug reports, but it is still confusing. I guess not so many people change the log axis back to linear, or I would see this question more often. I'm not sure there is a good solution to the problem.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 11, 2013 at 01:47 pm - Permalink
I will note again, the fit parameters returned by the fit function were correct despite the (invisible) xscaling problem, but findlevel returns a bad answer.
January 11, 2013 at 02:33 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
January 14, 2013 at 05:03 pm - Permalink