Fitting data with a exponentially modified gaussian equation
15 次查看(过去 30 天)
显示 更早的评论
Hello,
I am using curve fitting tool box and I am trying to fit below equation of the exponentially modified gaussian distribution. I have attached my attempt at fittin the PDF, I have also attached my x and y data along with this question. Please help me with the solution. Thanks very much!
(c/2) * (exp((c^2*sg^2)/2)) * exp(-c*(x-mu)) * erf((1/sqrt(2)) * ((c*sg) - ((x-mu)/sg)))
0 个评论
回答(1 个)
Matt J
2022-3-18
编辑:Matt J
2022-3-18
Because you are using a custom model, you need to supply an initial guess of the parameters under "Fit Options". Otherwise, the toolbox will choose one at random (which will probably be bad).
5 个评论
Torsten
2022-3-18
Is your function a probability density function ?
If yes, try
omega = 800.0;
zeta = 7500;
alpha = -1.3;
f = @(x) 2/(omega*sqrt(2*pi))*exp(-((x-zeta).^2/(2*omega^2)))*0.5.*(1+erf(alpha*(x-zeta)/omega));
x = 7000-1500:0.01:7000+1000;
plot(x,f(x))
But your .png file seems to indicate that the area under your curve is not equal to 1. So I assume you are not dealing with a pdf. In this case, the above function f is not suitable.
John D'Errico
2022-3-18
It vaguely looks like the data comes from a histogram, but it was not normalized to have unit area under the curve.
trapz(x,y)
ans =
73.2481
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!