Re: How to solve the problem of



In article <ef523d2.1@xxxxxxxxxxxxxxxxxxxxxxx>, bk <bkchen.eo94g@xxxxxxxxxxx> wrote:

John D'Errico wrote:


young wrote:


-------------------- Problem ------------------------------
x = lsqcurvefit(@myfun, [163 30 1000 ], xdata, ydata)
Maximum number of function evaluations exceeded;
increase options.MaxFunEvals

(snip)

I have increased MaxFunEvals' value to 1e+66,but the " NOT
ENOUGH " message is still there.
Matlab told me to increase it and I did. What's wrong?

Did you use optimset?

More importantly, did you pass it
into lsqcurvefit???????? From the
help for lsqcurvefit:

X=LSQCURVEFIT(FUN,X0,XDATA,YDATA,LB,UB,OPTIONS)
minimizes with the default parameters replaced by
values in the structure OPTIONS, an argument created
with the OPTIMSET function. See OPTIMSET for details.

If you did not pass an options
structure into lsqcurvefit, you
could have changed it to inf and
nothing different would have
happened.

By the way, much of the time when
you exceed maxfunevals, it is
indicative of some other problem
with your optimization.

John

Thanks,John,

What do you mean by "it is indicative
of some other problem with your optimization."?
Do you mean that I used the "wrong" model to fit ?

bk

Many times extremely slow convergence suggests
you may have a problem in your model definition,
or in your data itself.

Suppose I tried to estimate the coefficient in
the linear model

y = a - b + c*x

So {a,b,c} are all coefficients in a linear
regression model to be estimated. The thing is
these coefficients are impossible to estimate
uniquely. I can trade off a and b in infinitely
many ways.

A well written linear regression will survive
this problem, depending upon the tool you use,
either one of the coefficients will be set to
zero, or another choice will be made. But a
nonlinear optimization may have more difficulty,
especially if the trade off between parameters
is a more complex relationship. Often the result
may be a slowly convergent solution.

Alternatively, your data may be inadequate to
estimate all of the parameters in your model.
Or poor starting values may have been provided
such that the optimization is diverging to an
unacceptable solution.

So, the problem may not be as simple as the
use of an incorrect model. This will merely
result in unacceptable lack of fit.

HTH,
John


--
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: Gaussian elimination with guaranteed positive coefficients
    ... It seems that linear optimization is exactly ... If your functions W, etc, are linear, this is a classical linear ... coefficients must be positive values and the sum of all coefficients ... different light bulbs, and have only one light bulb on at a time. ...
    (sci.math.num-analysis)
  • Re: [SOLVED] Re: How to use optimset for fminsearch to run Levenberg-Marquardt instead of Nelder
    ... I can see how it could seem to be a "wild" assumption trying to pull a screwdriver out of a bread knife thinking its a Swiss army knife. ... Only parts of the optimset structure is applicable depending on which solver you are working with, and I see now that far from all optimset fields are applicable to all solvers. ... as does this section of the Optimization Toolbox documentation: ... apples-to-apples comparison as you can. ...
    (comp.soft-sys.matlab)
  • Re: bintprog, Maxtime exceeded
    ... How can I pass the options struct returned by OPTIMSET ... into BINTPROG? ... optimization. ...
    (comp.soft-sys.matlab)
  • Re: bintprog, Maxtime exceeded
    ... How can I pass the options struct returned by OPTIMSET ... into BINTPROG? ... optimization. ...
    (comp.soft-sys.matlab)

Loading