Errors in fitting prameters
Konstantinos Chatzipanagis
One question.....When fitting is performed, Igor gives back the tabulated results where all peak parameters (location, height, area and FWHM) are given with their respective errors. As far as i understand these +/- errros values are calculated by the diagonal elements of the covariance matrix. My problem is that when i fit a Voigt function i get a huge error for the height value. Error values in location and area are sensible, but for the height they are very big (156 +/- 152 for example). Does anybody know what could cause this? Just to say that there is no problem when Lorentzian or Gaussian fitting is used. Thanks very much.
King regards
Can you post an example, or report all the fit parameters with their errors?
I suspect that (at least) one of the other fit parameters also has a large error - sometimes two fit parameters can 'fight' each other, especially if there are not many data points in the fit. One could consider that the parameters are correlated in some way. These two parameters can end up with both having large errors even though the result is a 'good' fit.
Here is a very silly example that illustrates this point:
Wave w
Variable x
//CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will
//CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog.
//CurveFitDialog/ Equation:
//CurveFitDialog/ f(x) = A1*x^(E1) + A2*x^(E2)
//CurveFitDialog/ End of Equation
//CurveFitDialog/ Independent Variables 1
//CurveFitDialog/ x
//CurveFitDialog/ Coefficients 4
//CurveFitDialog/ w[0] = A1
//CurveFitDialog/ w[1] = A2
//CurveFitDialog/ w[2] = E1
//CurveFitDialog/ w[3] = E2
return w[0]*x^(w[2]) + w[1]*x^(w[3])
End
Make/O/D/N=10 myData
myData = 10*x^(0.5) + 5*x^(0.8) + gnoise(2)
Display myData
ModifyGraph mode=3,rgb=(0,12800,52224)
Make/D/N=4/O W_coef
W_coef[0] = {10,10,0.5,0.5}
FuncFit/NTHR=0/TBOX=768 myFitFun W_coef myData /D
This gives the following fit results:
K0 =7.0846 ± 1.16e+005
K1 =7.884 ± 1.16e+005
K2 =0.62906 ± 102
K3 =0.63018 ± 93.4
Yet the plot of the fit looks sensible.
Hope this helps,
Kurt
March 3, 2017 at 02:44 am - Permalink
I am posting two screenshots of two different voigt fittings. The one called ''large error'' shows what i described in my previous post.....You can from the residuals that the fitting looks good and also the errors for the other parameters are reasonable. However, the error for the amplitude is huge. Any ideas? I am also uploading another screenshot of the second voigt fitting where you can see an error value which seems to be negative....-25.....This also seems weird but i can not understand the reason. Any thoughts would be much appreciated. Thanks a lot.
March 3, 2017 at 03:12 am - Permalink
I cannot reproduce your issue as you have not provided an example that anyone else can experiment with. Can you double check that all the other parameters have small error values? - they are off screen in your screen shot.
I rarely use MultipeakFit, and I do not understand the negative error value. Hopefully someone else can help with this?
Sorry I cannot help any more.
Regards,
Kurt
March 3, 2017 at 06:22 am - Permalink
i think you can see in the screenshot the error for the location and area as well (just on their right side with the +/-)....they seem quite sensible! For the FWHM parameter there is no available value from Igor. Would you have any ideas or somebody else maybe?
March 3, 2017 at 06:43 am - Permalink
I'd suggest using the "height" parameter rather than "amplitude." But beyond that, I'd suggest avoiding the (pseudo-)Voigt peak shape for detailed error estimates, since it has many parameters and isn't necessarily analytical or well-grounded in a physical model.
March 3, 2017 at 08:01 am - Permalink
March 3, 2017 at 08:27 am - Permalink
March 3, 2017 at 09:27 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
March 3, 2017 at 10:54 am - Permalink
Is that a general property of the Voigt function or an issue with the approximation used in Igor?
Last time I had to implement Voigt in C++ I used
An algorithm for the numerical computation of the Voigt function, F.G. Lether, P.R. Wenston, Applied Mathematics and Computation, Volume 35, Issue 3, February 1990, Pages 277-289
although nowadays I probably would try http://apps.jcns.fz-juelich.de/doku/sc/libcerf or http://www.boost.org/doc/libs/1_63_0/boost/math/special_functions/erf.h… first.
March 3, 2017 at 02:55 pm - Permalink
I have only ever used pseudo-Voigt peaks, but a true Voigt peak would probably have separate widths of the Gaussian and Lorentzian components. It makes sense that if the Gaussian width is very narrow the measured peak would become almost pure Lorentzian, and it will no longer be possible to determine the width of the Gaussian other than to say it must be mush smaller than the width of the Lorentzian. That's probably another reason to use pseudo-Voigt peaks.
March 3, 2017 at 11:51 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
March 6, 2017 at 06:21 pm - Permalink