Re: nlinfit vs. lsqcurvefit



In article <ef3aad7.-1@xxxxxxxxxxxxxxxxxxxxxxx>, johnd <johnd@xxxxxxxx> wrote:

Hi,

I have a question regading the use of either nlinfit vs. lsqcurvefit.

I have a number of data that I want to fit with a curve (I know the
analytical expression and some parameters 'beta'=[beta1,beta2]) are
calculated after i fit the data with that expression. In order to set
an initial estimate for beta=[beta1,beta2], I take a grid with values
of beta1 and beta 2 and I compute the sum(residuals^2). I do this
because I dont want to set a value very far from the real ones. When
I plot beta1,beta2 vs. sum(residuals^2), I notice that there is no
global minimum in the sense there is a lot of fluctuations of the
points. How do you think I should proceed. I assumed that this
procedure would lead to a curve that would exhibit a nice set
minimum and i could set this value (actually pair of values
[beta1,beta2] as an initial estimate and try to use then the nlinfit
algorithm

Good thinking.

But, it probably means that you won't be happy
with either tool. At least this is so if your
plot is correct. There are indeed some problems
with very bumpy sums of squares surfaces. They
will be very sensitive to the starting values
provided. You might want to take a read through
sections 17, 23 and 26 (at least) of my tips
and tricks doc:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=8553&objectType=FILE

Is it possible that your sums of squares surface
is incorrect? Is there a random/stochastic
component in the model? If it really does look
like crinkled tin foil, then expect problems,
regardless of which optimizer you use.

When I am faced with problems like this, I often
used a multi-start method. Use either a random
sampling or a gridded sampling to find the k
best points from the sample. Start your chosen
optimizer at each point, allowing it to converge
to a point in that basin of attraction. Then
pick the best of the set of solutions.

Stochastic optimizers, like genetic algorithms,
simulated annealing, and particle swarm methods,
can all work too. My preference is the multi-start
approach, especially in low dimensions for the
parameter space as you have.

HTH,
John D'Errico


--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945

Those who can't laugh at themselves leave the job to others.
Anonymous
.



Relevant Pages

  • nlinfit vs. lsqcurvefit
    ... I have a question regading the use of either nlinfit vs. lsqcurvefit. ... I have a number of data that I want to fit with a curve (I know the ... global minimum in the sense there is a lot of fluctuations of the ...
    (comp.soft-sys.matlab)
  • Only 7.8 Billion (was: 9 Billion. The Population Explosion Is At And End.)
    ... This does, in fact, fit very well. ... deviations of about 10-20 million and is not a direct fit. ... The results of fitting this to the above-mentioned regularity ... surprising recent development in the world population curve. ...
    (sci.anthropology)
  • Re: comparison of two distribution curves
    ... john wrote: ... > is it as simple as saying that a straight line has a good fit to the ... Do a one-way anova on the control condition. ... Fit a curve to each condition. ...
    (sci.stat.edu)
  • Re: How to get the equation of a curve fitting experimental data?
    ... >> I would like to fit a curve to this set of data and get the equation ... >> of this curve in order to reach the primitive function Y of y. ... I did some model-based studies of seismic waves. ... > The best material model of a cat is another, or preferably the same, cat. ...
    (comp.soft-sys.matlab)
  • Re: How to get the equation of a curve fitting experimental data?
    ... > I would like to fit a curve to this set of data and get the equation ... > of this curve in order to reach the primitive function Y of y. ... abstracted as a mathematical metaphor to model ... curvefitting toolbox. ...
    (comp.soft-sys.matlab)

Loading