MATLAB Answers

Curve Fitting Tool starting points

14 views (last 30 days)
Hi all,
I currently working with the Curving Fitting Tool and I would like to know how the toolbox generate the starting points for the optimization (see image attached)
In the website of the toolbox they say that one of the key features are the "optimized starting points" but they don't mentioned anything else about it.
Does anyone know how they are calculated?
Best,
Ana

  0 Comments

Sign in to comment.

Accepted Answer

Payas Bahade
Payas Bahade on 20 Mar 2020
Edited: Payas Bahade on 20 Mar 2020
Hi Ana,
Start points for curve fitting are calculated in following ways:
  1. Starting points for some library models are determined heuristically if no start points (the default value of an empty vector) are passed to the fit function.
  2. For rational and Weibull models, and all custom nonlinear models, the toolbox selects default initial values for coefficients uniformly at random from the interval (0,1).
Similar question has been answered in community, please refer this link.
For more details, please refer this doc link on StartPoint.
Hope this helps!

  2 Comments

John D'Errico
John D'Errico on 20 Mar 2020
Let me add to what Payas has said -
Starting values can be notoriously difficult to choose for SOME models. For other models, no starting values are even necessary. Thus, for a model where the parameters enter linearly, then a linear regression is sufficient, and nothing special needs be done. For example, any of the polyn or polynm models reduce to a purely linear regression - NO starting values needed, or probably even used, IF you did try to provide them.
Some other models, for example the simple exponential 'exp1' model, which is just a*exp(b*x)? While I don't see the internal code, if it is done intelligently, this model can be transformed using a log transformation. That transformation allows a simple linear fit to be done, which can then be used to give often VERY good starting estimates for the parameters, though not perfect estimates. (I imagine I can come up with a counter-example to that with some effort, as any such heuristic can be gamed by someone who knows what they are doing and wishes to make the algorithm fail.)
Other models, for example splines and things like them, smoothing splines, interpolatory splines, pchip-like C1 interpolants, etc., have no need at all for starting values, due to the nature of the models themselves.
Finally, there are the fully general nonlinear models, which can be arbitrarily complicated, nasty things potentially. In this case nothing intelligent and automatic can possibly be done. So all that is done for most of them is to use some random numbers for a starting guess. That is as good of a choice as any, because there is NO way to provide a truly good choice for many models. These are models where user input is really important, though many users do not understand the issues.
Sadly, if you provide poor choices for many of these general nonlinear models, you should expect garbage as a result in the fit. (And random numbers are often "poor" in this respect.) It is often the user who needs to provide intelligence there. A common example where I see failues is in the sums of exponential class of models, where people simply do not understand that good starting values are now an imperative for convergence to something reasonable to happen.
Can you improve parameter estimation for some specific classes of nonlinear models? Well, yes, you can do so, using parameter partitioning techniques. This is a technique that I have used with great success when it can be appropriate. It removes the need for SOME starting values. But it also creates some difficulties in the end, and will not apply to all such models, so doing so automatically can be an issue.
The point being, were I writing the code myself (I've written similar toolbox code of my own before, so I do know what I am talking about) I would make good choices for the starting parameters to the extent that I could do so. I would recognize that some models need no starting values. And for the rest, well, I would rely on the user knowing what they are doing when that proves necessary. All of that is exactly what was done in the CFT.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!