1

如何在 Matlab 中获得高斯拟合曲线的标准差?

它不是fit函数的输出。

代码:

[fy, god] = fit(xx, yy, 'gauss2');

输出:

>> fy

fy = 

     General model Gauss2:
     fy(x) =  a1*exp(-((x-b1)/c1)^2) + a2*exp(-((x-b2)/c2)^2)
     Coefficients (with 95% confidence bounds):
       a1 =    -0.09287  (-0.09414, -0.0916)
       b1 =        3805  (3805, 3806)
       c1 =        20.9  (19.8, 22.01)
       a2 =     -0.3454  (-0.3497, -0.3411)
       b2 =        3862  (3861, 3862)
       c2 =       19.32  (18.82, 19.82)
>> god

god = 

           sse: 2.7037e-04
       rsquare: 0.9995
           dfe: 55
    adjrsquare: 0.9994
          rmse: 0.0022
4

1 回答 1

3

的输出fy表明您正在拟合一个由两个高斯函数的线性组合组成的模型。模型的函数形式为:

fy(x) =  a1*exp(-((x-b1)/c1)^2) + a2*exp(-((x-b2)/c2)^2)

请记住,高斯定义为:

f(x) = exp(-(x-x0)^2/(2*s^2))      where: x0 is the mean, s is the std.dev.

那么模型中每个高斯的标准差可以计算为(分别):

s1 = c1/sqrt(2)
s2 = c2/sqrt(2)

有关更多信息,请参阅http://en.wikipedia.org/wiki/Gaussian_function

于 2013-07-03T01:48:43.477 回答