fitting the double exponential decay curve to data and finding paprameters

90 ビュー (過去 30 日間)
Parul Tewatia
Parul Tewatia 2018 年 5 月 18 日
コメント済み: Ameer Hamza 2018 年 6 月 7 日
I have extracted data from a florescence decay graph. the equation used has two double exponential parameters and other 2 parameters. the equation is in the matlab code. Now I want to fit the curve to this given equation so i have all the parameters. As the flouresnce data was in percentage i converted it to quantities by multiplying by 6. I worked on an example by matlab https://se.mathworks.com/help/optim/examples/nonlinear-data-fitting.html but I am not able to plot the fitting with the fplot command something is going wrong as it gives an error. Also I dont want local minima but global minima, but i am novice so dont know how to use this fitvector. But most importantly the problem i am facing is with initial parameter guess. what is a good way to find these guesses. Also I read somewhere its a good approach to divide problem into two, as the decay is quite fast initially but is quiet linear after some time. Reading too much stuff i am quite confused. I have attached both my code and data plot. thanks for the help. much appreciated Parul

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 18 日
Since you are trying curve fitting by minimizing least square error, lsqcurvefit() is a better choice. Try the following
t = xdata;
y = ydata;
F = @(x,xdata)x(1)*exp(-x(2)*xdata) + x(3)*exp(-x(4)*xdata);
x0 = [300 0.005 1 0] ;
xunc = lsqcurvefit(F, x0, t, y);
tlist = linspace(min(t), max(t)); % Plot Finer Resolution
figure(1)
plot(t,y,'ro')
title('Data points')
hold on
plot(tlist, F(xunc,tlist), '-r', 'LineWidth', 2)
hold off
In your code, you were also specifying the wrong first variable for function F in plot statement. The fit seems quite well.
  2 件のコメント
Parul Tewatia
Parul Tewatia 2018 年 6 月 7 日
thanks a lot for the help ameer...much appreciated, but i still wonder how to detemine initial parameter guesses. any thought on that. best parul

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by