Menu

#440 Inconsistency between Gauss and GaussAmp fit functions

next
open
nobody
4normal
2023-12-06
2022-06-25
Fellype
No

There is an inconsistency between the Gauss and GaussAmp fit functions available in SciDAVis:
- The Gauss formula is y = y0+A·sqrt(2/PI)/w·exp(-2·((x-xc)/w)^2) ; Eq. (1). In this case, w is the width of the curve, which in turn is twice the standard deviation (s), that is: w = 2·s
- The GaussAmp formula is y = y0+A·exp(-(x-xc)^2/(2·w^2)) ; Eq. (2). In this case, w = s

This inconsistency may mislead the users just because the variable symbol and output name in the results log are the same. It should be not a problem if, for example, Eq. (2) was written withs (stddev) instead of w (width) in the formula (and in the output of the results log).

So, there are at least three options to solve this inconsistency:
1. change the expression in Eq.2 from y = y0+A·exp(-(x-xc)^2/(2·w^2)) to y = y0+A·exp(-2·((x-xc)/w)^2) - this looks to be the best one in order to be consistent with Eq.(1) - by the way, in physical measurements, it is usually desired to get w instead s when the observed curve has a Gaussian shape (to be honest, what is required in physics is usually the FWHM = w·sqrt(2·ln(2)). The exception (AFAIK) is when dealing with statistics.
2. change just the variable symbol and name from w (width) to s (stddev) in Eq.(2)
3. apply solution 1. and include another equation called, lets say, GaussAmpStat using the same formula as in solution 2., that is y = y0+A·exp(-(x-xc)^2/(2·s^2)). In this way SciDAVis would have also a Gaussian fit option for statistics. This should be an unnecessary work but, unfortunately, most users (usually the beginners ones) don't know that in a Gaussian function w = 2·s

Notice that the Gauss fit is available under Analysis -> Quick fit and also in Analysis -> Fit wizard -> Built-in while GaussAmp is available only through Analysis -> Fit wizard -> Built-in

Discussion

  • Fellype

    Fellype - 2022-07-01
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,7 +5,7 @@
     This inconsistency may mislead the users just because the variable symbol and output name in the results log are the same. It should be not a problem if, for example, Eq. (2) was written with*s (stddev)* instead of *w (width)*  in the formula (and in the output of the results log).
    
     So, there are at least three options to solve this inconsistency:
    -1. change the expression in Eq.1 from y = y0+A·exp(-(x-xc)^2/(2·w^2)) to y = y0+A·exp(-2·((x-xc)/w)^2) - this looks to be the best one in order to be consistent with Eq.(1) - by the way, in physical measurements, it is usually desired to get *w* instead *s* when the observed curve has a Gaussian shape (to be honest, what is required in physics is usually the FWHM = w·sqrt(2·ln(2)). The exception (AFAIK) is when dealing with statistics. 
    +1. change the expression in Eq.2 from y = y0+A·exp(-(x-xc)^2/(2·w^2)) to y = y0+A·exp(-2·((x-xc)/w)^2) - this looks to be the best one in order to be consistent with Eq.(1) - by the way, in physical measurements, it is usually desired to get *w* instead *s* when the observed curve has a Gaussian shape (to be honest, what is required in physics is usually the FWHM = w·sqrt(2·ln(2)). The exception (AFAIK) is when dealing with statistics. 
     2. change just the variable symbol and name from *w (width)* to *s (stddev)*  in Eq.(2)
     3. apply solution 1. and include another equation called, lets say, GaussAmpStat using the same formula as in solution 2., that is y = y0+A·exp(-(x-xc)^2/(2·*s*^2)). In this way SciDAVis would have also a Gaussian fit option for statistics. This should be an unnecessary work but, unfortunately, most users (usually the beginners ones) don't know that in a Gaussian function *w* = 2·*s*
    
     
  • Douglas Novaes

    Douglas Novaes - 2023-12-06
    Post awaiting moderation.

Log in to post a comment.