フィルターのクリア

different formulas for gaussian fitting?

2 ビュー (過去 30 日間)
Sascha Rekauzke
Sascha Rekauzke 2015 年 6 月 12 日
回答済み: Eric Lin 2015 年 6 月 15 日
Hi.
I would like to fit my data with a gaussian (although I am not really an expert in this).
Actually fitting using both, the cftool and the function "fit" worked out and i would have gotten along with it. Showing it to my workgroup, we found that matlab uses the following formula as "general model"
f(x) = a1*exp(-((x-b1)/c1)^2)
while a colleage of mine (and wikipedia) suggest
f(x) = a1*exp(-0.5*((x-b1)/c1)^2)
Can anyone explain the difference? Thx!
Sascha

回答 (1 件)

Eric Lin
Eric Lin 2015 年 6 月 15 日
"fit" and "cftool" fold the "2" term in the exponent denominator into the estimate for "c1". That is, the "c1" estimate fitted by "fit" will be greater than the "c1" estimate fitted using the Wikipedia formulation by a factor of sqrt(2).
To see this, we can generate standard normal data and then fit a Gaussian model:
pd = makedist('Normal');
x = -5:.1:5;
y = pdf(pd,x);
f = fit(x',y','gauss1')
pd =
NormalDistribution
Normal distribution
mu = 0
sigma = 1
f =
General model Gauss1:
f(x) = a1*exp(-((x-b1)/c1)^2)
Coefficients (with 95% confidence bounds):
a1 = 0.3989 (0.3989, 0.3989)
b1 = -9.1e-13 (-1.351e-07, 1.351e-07)
c1 = 1.414 (1.414, 1.414)
The "c1" estimate is approximately the square root of 2, as expected.

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by