quasi-bug in the step size of multipeak fitting

I found a minor bug in the the multipeak fitting package. It sets the step size to a relative value (1E-6 times the absolute number). In my case, it is the location of the gaussian peak. However, my data only has a very small dynamic range in x (from 1100 to 1101). Therefore, my fitting result has a rather poor resolution (0.001) compare to the x-range (1). This problem is easily overcome. I just took off 1100 from my x values and added it back after the fitting, but it really took a while for me to realize this problem. I hope this could be solved in the next version of multipeak fit.
It's worse than that- it sets the epsilon wave to all 1e-6, which overrides the internal epsilon, and sets it to exactly 1e-6, not coef*1e-6. I have a vague recollection that some data sets work better that way than without, and I hadn't come on a data set that was hurt by it. I'd be interested in a copy of your experiment file, if possible. Either attach a file to a response, or if it is sensitive, e-mail to support@wavemetrics.com.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:
It's worse than that- it sets the epsilon wave to all 1e-6, which overrides the internal epsilon, and sets it to exactly 1e-6, not coef*1e-6. I have a vague recollection that some data sets work better that way than without, and I hadn't come on a data set that was hurt by it. I'd be interested in a copy of your experiment file, if possible. Either attach a file to a response, or if it is sensitive, e-mail to support@wavemetrics.com.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com


Huh...I'd wondered about that, not just in multipeak fitting but any use of /E in FuncFit. My sense was it was supposed to set relative step sizes instead of absolute (coef*epsilon instead of epsilon) but wasn't sure it was behaving that way in practice. Is this a bug in the implementation that hasn't been fixed or was it always intended that the epsilon wave remove the scaling with parameter size? (I can see the advantage of a fixed step size for small parameters that can reasonably be positive, negative or zero, or something representing a phase where the value only matters to module 2pi). Now I cannot find anything in the help files that should have given me the misconception I had, that so perhaps I had originally just misread the difference between default behavior (which does scale with parameter size) and using an epsilon. Either way, I'd say the description of the epsilon wave in the FuncFit and Curve Fitting help topics could stand to spell this out more explicitly.

And of course, now that I reread Jex's original comment, it seems like your interpretation is backwards. Ideally a parameter representing peak center should be independent of the current peak position, or only scale with peak width, but that would require an epsilon matrix with off-diagonals :-(. If he's seeing a better fit after manually offsetting the peak location, that would make more sense with the idea that multipeak fit is NOT setting an epsilon wave and that the sampling size is larger for a peak centered at 1000 than at 1.

Alternately, Jex, could it just be a floating point resolution limit? What kind of peak width / sampling size are we talking about here? If your data is only single precision I could see your current numbers already hitting the dynamic range limit of a single precision, and also improving with offset removal (giving you back 3 decades out of 8 or so).
ikonen wrote:
Is this a bug in the implementation that hasn't been fixed or was it always intended that the epsilon wave remove the scaling with parameter size?

No bug. It's not very sophisticated, but it computes quickly and in my experience works quite well. I still need the example from the OP so that I can investigate what causes his problem.
Quote:
Either way, I'd say the description of the epsilon wave in the FuncFit and Curve Fitting help topics could stand to spell this out more explicitly.

Indeed. I have often thought that, but right now we're focused on getting Igor 7 ready, so I'm not putting much time into documentation.
Quote:
And of course, now that I reread Jex's original comment, it seems like your interpretation is backwards. Ideally a parameter representing peak center should be independent of the current peak position, or only scale with peak width, but that would require an epsilon matrix with off-diagonals :-(. If he's seeing a better fit after manually offsetting the peak location, that would make more sense with the idea that multipeak fit is NOT setting an epsilon wave and that the sampling size is larger for a peak centered at 1000 than at 1.

In my experience, a fit is only weakly dependent on the epsilon values. If it converges, it usually converges to pretty much the same solution regardless of epsilon. The main thing is to use an epsilon that accurately points downhill; exactly vector direction and magnitude are only secondary.

If the epsilon value is too small, when delta h is added to the coefficient value to calculate the derivative, it may not change the coefficient, resulting in a bogus zero derivative. The values that Multipeak Fit uses are guaranteed to be double precision because the package makes the coefficient wave itself- it doesn't depend on the user's waves. So I'm a bit surprised at the result the OP describes. That's why I want his experiment!

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com