To what refers the "width" in a Gaussian function?

4.1k Views Asked by At

I've plotted a dataset in SciDAVis and added the default Gaussian fit. SciDAVis used the following function:

$$ f(x) = y_0 + A \cdot \frac{\sqrt{\frac{2}{\pi}}}{w} \cdot \exp{\left(-2 \cdot \left(\frac{(x - x_c)}{w}\right)^2\right)} $$

Where $y_0$ is the offset on the $y$ axis, $A$ is the amplitude, $w$ the width and $x_c$ the position of the maximum on the $x$ axis.

All good, but what do they mean by "width"?

I thought it could be the FWHM, but that isn't the case as I found out by plotting the function in GeoGebra, searching the exact coordinates of the maximum, and then cutting the graph at $y = \frac{\text{max}_y}{2}$. This results in two coordinates of same $y$ coordinate but different $x$ coordinate and by calculating the distance of the two $x$ coordinates I get the FWHM.

enter image description here

The calculated FWHM is $2.59 - 1.41 = 1.18$ but $w$ is set to $1$.

2

There are 2 best solutions below

2
On BEST ANSWER

It looks like the standard deviation, at least when $y_0$ and $A=1$, in which case this is the density of the normal distribution $\mathcal{N}(x_c, w^2)$. I think you may have a couple of typos in your formula — missing parentheses in the exponential, and multiplying instead of dividing by $2$ in the exponent?

It determines the “spread” or “dispersion” of the function, because it appears as a divisor of the independent variable, so it scales the graph horizontally.

It also affects the vertical size of the graph, but that’s usually there as part of the density to ensure an area of $1$ under the graph. Your function seems to be a little different, but essentially captures these properties.

The larger this parameter is, the wider the graph is.

0
On

I spent the past day doing this very derivation and I'm glad to see that someone else had the same question.

The form of the exponent in your example is indeed not the FWHM, instead, $$ w = \frac {FWHM}{\sqrt {ln4}}$$

I can provide a screenshot of my derivation if you're interested but this comes from substituting $$ FWHM = 2\sigma \cdot \sqrt{2ln2}$$

into the general Gaussian formula. I'm actually glad you asked this question because I was convinced that I made an error when my equation looked nothing like what you had.

I'm curious if you've found out why SciDAVis chooses this form of the Gaussian? The proper form using the FWHM should be, note the additional $ln(4)$ occurring in the square root and in the exponent:

$${A\over w} \sqrt{2 ln(4)\over{\pi}}\exp\left(-2\cdot ln(4)\cdot\left(\frac{(x-xc)}{w}\right)^2\right)$$

If you could re-run your data with this form and confirm with me that would be great!

edit: I tried with some sample data and I can't figure out why but the form as you posted gives a better estimate for the function. If anyone knows why please comment. Thanks