MATLAB Answers

0

What exactly is a StartPoint for a Curve Fitting Tool, its significance and how it works?

Asked by Shourya Mukherjee on 19 Aug 2019 at 16:45
Latest activity Answered by Alex Sha on 26 Aug 2019 at 15:54
I have searched this many times, and in many different ways, but couldn't get a comprehensive explanation on WHAT IS THE FUNCTION OF A STARTPOINT IN CURVE FITTING TOOL, AND HOW DOES IT WORK?
I also want to know about the format of StartPoint and the significance of the parameters in the [] brackets in (fit(x, y, 'StartPoint', []))
I would appreciate anyone who could take the time to explain this in detail. Please help! Thank you!

  0 Comments

Sign in to comment.

2 Answers

Answer by TADA
on 19 Aug 2019 at 17:12
Edited by TADA
on 19 Aug 2019 at 17:26
 Accepted Answer

curve fitting works by trying to find the parameters of your model, lets say you are trying to fit a gaussian to a single peak curve:
then your model has three parameters a for amplitude, mu for average and sigma for standard deviation
least squares fitting works by iteratively guessing those parameters then improving the guess each iteration according to how well it fits the data, that is how large the margin from the data is in each point of the curve.
start point is the initial guess, it can help by narrowing down to something close to the data.
So now lets go back to the gaussian model,
fit(x, y, 'gauss1', 'StartPoint', [1, 2, 0.5]);
Now, i'm telling matlab to start from an amplitude of 1, average 2 and standard deviation 0.5
If you don't use start point matlab will use something random

  3 Comments

By the way, start points may help if you know something about your curve
if you are just guessing it might be better to let matlab do the guessing for you

Sign in to comment.


Answer by Alex Sha on 26 Aug 2019 at 15:54

Curve fitting problems are actually optimization problems. The optimization algorithms used in curve fitting function (i.e. nlinfit,lsqcurvefit) of Matlab are all local optimization algorithms, thus depending haveily on the guess of initial start values of each parameter, if global algorithms were adopded, theoretically, the guessing of start values are no long needed. Baron, LingoGlobal, 1stOpt...can achieve such goal.

  0 Comments

Sign in to comment.