Gaussian Models
About Gaussian Models
The Gaussian model fits peaks, and is given by
whereais the amplitude,bis the centroid (location),cis related to the peak width,nis the number of peaks to fit, and 1 ≤n≤ 8.
在许多科学和工程领域遇到高斯峰。例如,高斯峰可以描述线发射光谱和化学浓度测定。
Fit Gaussian Models Interactively
Open the Curve Fitting app by entering
cftool
. Alternatively, click Curve Fitting on the Apps tab.在曲线拟合应用程序中,选择曲线数据(X dataandY data, or justY dataagainst index).
曲线拟合应用程序创建默认曲线适合,
Polynomial
.Change the model type from
Polynomial
toGaussian
.
You can specify the following options:
Choose the number of terms:
1
to8
.看看Results窗格查看模型术语,系数的值,以及拟合的统计数据。
(Optional) ClickFit Optionsto specify coefficient starting values and constraint bounds, or change algorithm settings.
The toolbox calculates optimized start points for Gaussian models, based on the current data set. You can override the start points and specify your own values in the Fit Options dialog box.
Gaussians have the width parameter
c1
constrained with a lower bound of0
. The default lower bounds for most library models are-Inf
, which indicates that the coefficients are unconstrained.For more information on the settings, seeSpecifying Fit Options and Optimized Starting Points.
Fit Gaussian Models Using the fit Function
This example shows how to use thefit
function to fit a Gaussian model to data.
The Gaussian library model is an input argument to thefit
andfittype
functions. Specify the model typegauss
followed by the number of terms, e.g.,'gauss1'
through'gauss8'
.
Fit a Two-Term Gaussian Model
Load some data and fit a two-term Gaussian model.
[x,y] = titanium; f = fit(x.',y.','Gauss2')
f = General model Gauss2: f(x) = a1*exp(-((x-b1)/c1)^2) + a2*exp(-((x-b2)/c2)^2) Coefficients (with 95% confidence bounds): a1 = 1.47 (1.426, 1.515) b1 = 897.7 (897, 898.3) c1 = 27.08 (26.08, 28.08) a2 = 0.6994 (0.6821, 0.7167) b2 = 810.8 (790, 831.7) c2 = 592.9 (500.1, 685.7)
plot(f,x,y)