Fit data to a simple 3 parameters exponential curve
Show older comments
Hello ! I'm trying to fit a signal (y) as a function of the time (x) using this custom curve : y=a+b*exp(-c/x); I'm looking for the c value which is around 0.005. However, the levenberg=marquardt algorithm find false values even if a & b are fixed parameters.. If you have some explanations..
time:https://www.dropbox.com/s/9jt2wsfhu63fjb1/time.mat
signal:https://www.dropbox.com/s/rjxs5a6wg1e66pk/T1recovery.mat
thank you very much !
charles
5 Comments
Matt J
on 11 Mar 2014
Why not attach your .mat files directly to your post?
Charles
on 12 Mar 2014
John D'Errico
on 12 Mar 2014
Edited: John D'Errico
on 12 Mar 2014
I see your question about why the curve fitting TB fails. Read my answer, as it suggests at least part of the reason for that failure - the model simply does not fit if you try to shoehorn it onto your data. Only if you exclude the first part of the series does it fit even decently. Even then, a change of model improves things as I show.
Accepted Answer
More Answers (1)
FMINSPLEAS would work well for this problem
flist={1, @(c,x) exp(-c./x(:))};
[c,ab]=fminspleas(flist,.005, time, signal);
a=ab(1);
b=ab(2);
4 Comments
Salaheddin Hosseinzadeh
on 11 Mar 2014
I couldn't even find fminspleas!
Salaheddin Hosseinzadeh
on 11 Mar 2014
No! Sorry I thought it's one of the MATLAB functions!
John D'Errico
on 12 Mar 2014
Upvoted because of the good choice of tool suggested. :) I added a response with some plots, but nothing really extra beyond scrapping the first 14 data points.
A good point to make is that fminspleas, because it uses a partitioned least squares, is much more robust as a solver since it is solving only a ONE variable nonlinear problem.
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

