Fitting a Gaussian peak
A Gaussian with a constant background describes a symmetric peak whose tails approach a baseline. It is useful when that shape is supported by the experiment; selecting Gaussian does not establish that the measured noise has a Gaussian distribution.
curve.fit's Gaussian model is:
| Parameter | Meaning |
|---|---|
| Aₒ | Peak height above the background |
| xₒ | Peak center |
| σ | Width in the units of x |
| C | Constant background level |
At the center, the model value is Aₒ + C. Aₒ is a height, not an area. The symbol σ here is a fitted shape parameter; it is not the measurement uncertainty entered in δy or the uncertainty of the fitted width.
Height, width and area
The full width at half maximum, measured above the background, is:
The multiplier is approximately 2.35482. The area of the Gaussian component over the entire real line, excluding the background, is:
For an illustrative peak with Aₒ = 5, σ = 0.8 and C = 1, the peak value is 6, the FWHM is about 1.88386 and the area above background is about 10.02651. These are values calculated from chosen parameters, not results claimed for the example dataset.
Explore the public example
Open the Gaussian example to load the existing public sample into a workspace. That link creates a working copy; merely reading this guide does not start a fit. Select Fit! to obtain a result, then inspect the Data and Residuals views. See plotting and exports in Help for the controls.
The sample includes uncertainty columns for both x and y. Keep those selected to study the x/y-uncertainty fit. Deselecting x uncertainties changes the fitting assumption, so it is a different comparison rather than a display setting.
Choose a useful data range
Include observations on both sides of the peak and enough of the baseline to determine C. A narrow range near the peak can make height, width and background difficult to distinguish. A range containing only one side can leave the center poorly constrained.
For initial guesses, use the observed background for C, the maximum minus that background for Aₒ, the apparent peak position for xₒ, and the estimated FWHM divided by 2.35482 for σ. Use a positive, nonzero width. The built-in model also supplies automatic starting values when Guess is left blank.
Read the residuals
A skewed pattern, shoulders or a changing baseline can indicate that a single symmetric peak is inadequate. Repeated peaks can require a different model. Do not reduce uncertainty values or select a scaling convention simply to obtain a preferred goodness-of-fit value.
If the measurements are counts, consider whether the uncertainty approximation is appropriate, especially near zero. This application performs least-squares/ODR fitting; a Gaussian shape selection is not a switch to a Poisson likelihood.
Uncertainty in derived quantities
FWHM is a constant multiple of σ, so its standard uncertainty is the same constant times the standard uncertainty of σ. Area depends on both Aₒ and σ. Their fitted estimates can be correlated, so propagating area uncertainty generally requires their covariance, not just adding two relative uncertainties in quadrature.