Re: lsqcurvefit-converge?



In article <ef1c0f5.-1@xxxxxxxxxxxxxxxx>, johnd <j.atrot@xxxxxxxx>
wrote:

> I have a problem considering lsqcurvefit as a routine to fit a number
> of data. More specifically, the analyitical expression that is
> supposed to be used to fit the data I have has 4 parameters. Let's
> say that
>
> beta=[K;D_2;w;M]; (where I set the values)
> LB=[0;0;0;0];
> UB=[10*K;3;3;1];
>
> then I ran the lscurvefit to compute the parameters ad I get : sum of
> residuals =0.016. and the warning messag

Are you truly looking at the sum of the residuals?
Or did you mean the sum of squares of the residuals?
The latter is what lsqcurvefit uses.

Note that it is quite easy to pose a problem where
the simple sum of residuals is not at all well posed.



> e 'Optimization terminated successfully:
> Relative function value changing by less than OPTIONS.TolFun'
>
> The value for D_2=0.57
> Then, I change the LB and UB to
> LB=[0;0;0;0];
> UB=[10*K;30;30;1];
> and if I run the same routine then, I get exatly the same values for
> all parameters except from D_2 and w (the parameters whose LB and UB
> have been changed)
> , the same warning message, exit flag1 as previously, same sum of
> residuals. Do you think that this sounds reasonable?

If the objective (i.e., the sum of SQUARES of the
residuals) is the same, then your problem may be
indeterminate. That is, any solution along some
path through your parameter space may be yielding
the same minimum objective. In that event it is
rather arbitrary which "solution" from this infinite
set lsqcurvefit finds. Simply changing something
trivial like a non-active bound may result in a
different final solution.



> The parameter values differ a lot in order of magnitude (for instance
> for D_2 which more important, I get 0.88 and i.52 respectively). This
> rather suggests that I shouldnt accept the solution. I guess there is
> something with the options I have to set.

It may be more likely that you need to deal with
the concept I suggested above.



> I was going through the example you use in the introduction of this
> routine and even there you get a warning though it seems that it
> terminates successfully
> "
> the optimization terminated successfully:
> First-order optimality less than OPTIONS.TolFun, and no
> negative/zero curvature detected
> "

Its not so much a warning as a statement of
convergence.

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

  • Re: lsqcurvefit-converge?
    ... >> supposed to be used to fit the data I have has 4 parameters. ... > Are you truly looking at the sum of the residuals? ... > The latter is what lsqcurvefit uses. ...
    (comp.soft-sys.matlab)
  • Re: Calculating Standard Deviation
    ... I'll check out the Google searches that you mentioned. ... sum of all the residuals squared. ... Usually fitting is designed to make the sum of the residuals zero. ... norms are close but not the same. ...
    (sci.math.num-analysis)
  • Re: August is tied for 5TH warmest in 125 years
    ... Roger Coppock wrote in message ... > The sum of the residuals is 12.337094 ... which means that it is WAY too early to assume an exponential fit. ...
    (sci.geo.meteorology)
  • Re: Calculating Standard Deviation
    ... When calculating the standard deviation for a set of values you use the ... sum of all the residuals squared. ... norms are close but not the same. ...
    (sci.math.num-analysis)
  • Creating a UDF from a VBA routine...
    ... How can I convert the below routine to a UDF ... put the target value in cell B1 ... Sum = Sum + Cells ...
    (microsoft.public.excel.programming)