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

213 views (last 30 days)
Shourya Mukherjee on 19 Aug 2019
Answered: Alex Sha on 26 Aug 2019
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!

Edited: TADA on 19 Aug 2019
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
cheers :)

Alex Sha on 26 Aug 2019
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.