Start point automatic setting in nlinfit or lsqcurvefit.
1 view (last 30 days)
Show older comments
Hello,
I have a problem finding good initial values for nlinfit or lsqcurvefit...
I found it is possible to automatically set the 'optimal' start point in 'cftool', but I couldn't know how it works.
I want to find an automatic way that both data-sets get fitted in an acceptable way without changing the starting points manually.
My fitting model is not linear model but 'powar-law' model. (A*k^b + c).
Any help is much appreciated!
Thanks!
0 Comments
Answers (1)
Matt J
on 23 Jan 2015
Edited: Matt J
on 23 Jan 2015
I'm assuming the independent variable in y = (A*k^b + c) is k? If you have a sample of y at k=0, that would be a natural estimate for c. Alternatively, if b<0, the asymptotic value as k-->inf would be an estimate for c.
Once you have c, you can approximately linearize the model
log(y-c) = log(A)+b*log(k)
Note that the above is linear in log(A) and b, so you can do a linear solve
p=[ones(length(y),1), log(k(:))]\log(y(:)-c)
A=exp(p(1));
b=p(2);
0 Comments
See Also
Categories
Find more on Least Squares 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!