Fitted area - uncertainty seems too high
jcor
I posted a while ago on MultiPeakFitting 2.0's error report and have now come back to working with it.
I'm fitting two lognormal curves to bimodal data -- you'll see that the left-hand distribution was only fitted on the right-hand side due to tailing, I only care about the right-hand-area -- and the fit works out wonderfully. The right-hand peak is clearly visible, and MPF 2.0 does a great job on it...
However, the reported area for the right-hand peak area is 200 ± 9.06e+05. This just isn't reasonable to me. By inspection, I would expect something like 200 ± 100 for an uncertainty representative of the noise.
How might one objectively address this fit to get an estimate of the peak area?
Best,
j
Another slight possibility is that the tail of the left peak is somehow contributing to uncertainty. Try fitting the entire left peak (which I see is actually recorded, just not fitted) and see what happens.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 24, 2013 at 10:57 am - Permalink
Thanks! Both of your comments were right on target!
The peak truncation I was doing (which is because the LHS and RHS of my peak are asymmetric, so the actual fit follows the data much more closely after truncation) increased the relative error from 0.08% to 58%.
But even more important was the magnitude of my y-values! Since my x-axis is max 5e-03, I scaled the y-axis to a 5e-03 and got 0.08% relative error! With 5e+06 as posted (partial 1st-peak fit), I had 993,788% error.
At 5e+00 -> 0.35%, at 5e+03 -> 5.09%, at 5e+06 -> 328.889%. Going the other way, I got 5e-06 -> 0.09% but 5e-09 -> 0.07%. Now my axis maxima are as far apart as they started, but it seems OK if y-max < x-max? Or just <<1?
This is pretty strange to me and I am puzzled about what to take from this. Should my y-values in a fit always be <= my x-values? Does floating-point truncation only affect large and not small numbers? Is this just part of the calculations MPF 2 is doing or is this a general lesson for Igor fits?
edit: I've made a plot of this behaviour:
July 25, 2013 at 06:01 am - Permalink
That is an extreme example, but smaller losses in precision can be important in curve fitting as the truncation errors build up during repeated iterations.
These sorts of problems are greatly increased when exponentials are involved.
It's possible that the code for Multipeak Fit 2 should be doing the scaling for you. I have it in mind to investigate that possibility as some unspecified point in the future :)
The same sorts of considerations apply if you have a fit that involves fit coefficients that are different by orders of magnitude. That can be pretty difficult to deal with by scaling, though, if the fit function is nonlinear.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 25, 2013 at 09:08 am - Permalink
Thanks for the help, this has been very enlightening! Had I been working near the "moderately bad" region of this effect, I may never have realized.
j
July 25, 2013 at 10:05 am - Permalink
I have found that fitting peaks in Igor 6.2 with very high y-wave to x-wave ratios (e.g. y being 10^20 larger) yields the error
"Multi-peak Fit failed:
singular matrix or other numeric error"
This is consistent with John's answer above, but if you had not run into this before you might not think of this, especially since a normal CurveFit does still work.
The solution is to upgrade to Igor 6.3 (tested for 32-bit Windows version).
edit: this applies to the fitting *failure*, NOT to the original issue of the fit area uncertainty being too high -- that's still there.
August 15, 2013 at 02:35 am - Permalink
Wishing everyone well, and I wish I could handle these files in multipeak.
-Allen
May 22, 2014 at 10:38 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 22, 2014 at 11:22 am - Permalink
Well, this is a bit crazy for data possibly, as the range is so high- I'm hoping to learn a bit about what you suggest from this! I have other friends in the field who are also intrigued by the multipeak2 fit routines- they're quite nice! [assuming they can be gotten to work with a range of data- already seen it work with one set that isn't the same as this]
I'm attaching my pxp - please be aware that I'm no expert here- I have two tables with a column each- I pull an x and a y into the multipeak routine, then work from there. The data is imported from HDF5 and originates in matlab from my work on the Phillips XRDML files. I'm a lot more comfortable in Matlab (igor for matlab dummies anywhere? ;) ) - so I tend to do my work there, except this multipeak fit was too good to pass up a trial in Igor. Knowing more about Igor may spill over into AFM analysis etc., as well, so I don't mind learning a little bit here- but also have to get my paper writing done. ;)
Thanks so much for taking a moment to check out the data. I'm a bit concerned that rescaling the data will make the coefficients of fit etc., difficult to use- as the relationship with changes in x or y may be non-trivial. Working on the log of the data also doesn't appear to be simple, as the peak types would have to change drastically to be useful back in real-world intensity values. [i.e., the log of a gaussian, log of Voigt etc.]
Thanks for your time and thoughts!!
-Allen
ps- I noticed that there may not have been a way to scrub identifying info in the .pxp file before upload- interesting file- a mix of binary and xml/plist type stuff. Only thing there is hard-drive name etc., as far as I can tell. :)
May 22, 2014 at 03:35 pm - Permalink
I see one big peak in your data. Multipeak Fit 2 fits that one peak pretty well with a Voigt peak shape. You say "as well as smaller peaks due to film which are generally gaussian in nature". Please tell me where they are.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 22, 2014 at 04:30 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 22, 2014 at 04:39 pm - Permalink
Thank you!
-Allen
May 22, 2014 at 05:21 pm - Permalink
-A
May 22, 2014 at 05:24 pm - Permalink
It's too bad- I'll have to think about how to accommodate it. Do you know what other packages do?
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 23, 2014 at 12:03 pm - Permalink
I really appreciate you taking the time to comment on this as I initially thought this would be easy until I dug a bit deeper.
My very best to you, and love the program BTW! I will likely be using it for other data in the near future! Thank you for your kindness and time!
-Allen
May 23, 2014 at 01:15 pm - Permalink
* Fit the big peak. Subtract the fit from the raw data. Does this reset the scale so you can see the smaller peaks now? If so, fit the smaller peaks.
* Fit the big peak. For all range of the big peak, set the values to NaN. Does this reset the scale so you can see the smaller peaks now? If so, fit the smaller peaks.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
May 25, 2014 at 07:57 pm - Permalink