MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

FindFit NMinimize and Nelder-Mead Optimization

I am running a non-linear curve fit using constrained global
optimization: FindFit and the NMinimize method NelderMead. After
running for a few minutes an error pops up saying that there was an
invalid comparison with some number, 0.064 for example. It appears
that for some reason the first of the variables (k) that I am curve-
fitting to determine has been set to a number. I'm not sure if this is
a bug in Mathematica or in my implementation. This error pops up a few
more times but the progress continues and the error is supressed but
the final curve fit does not seem to be ideal. Any suggestions would
be great.

Thanks very much,
Lyle Gordon

Orthopaedic Biomechanics Lab
Sunnybrook Health Sciences Centre
Toronto, Ontario.

Here is the sample of the code I am using, sorry for the \[Tau]1 and \

fit = FindFit[
  fakedata, {functiontofit[k, c, \[Tau]1, \[Tau]2, treal],
   0.1 > k > 0 && 100 > c > 0 && 0.1 > \[Tau]1 > 0 &&
    0.1 > \[Tau]2 > 0 && \[Tau]2 > \[Tau]1}, {{k, 0.005}, {c,
    20}, {\[Tau]1, 0.01}, {\[Tau]2, 0.02}}, treal,
  EvaluationMonitor :> {Print["E: ", k, ", ", c, ", ", \[Tau]1,
     ", ", \[Tau]2]; Clear[k]},
  Method -> {"NMinimize", Method -> "NelderMead"}]

  • Prev by Date: Re: RandomComplex documentation
  • Next by Date: Re: Re: Re: RandomComplex documentation
  • Previous by thread: Re: Question about memory consumption in my codes by using Mathematica
  • Next by thread: Mathematica SIG (Northern Virginia and Washington DC)