1
$\begingroup$

i want to find a approximate gobal minmum of a nonlinear function . i know the gradient of this function. i find that i can only use Nminimize to achieve this. Although Nminimize offer several Methods(e.g., anneling, evolution) to choose from, none of these support a user supplied gradient. since i have the gradient analytic expression, i want to find a way to take advantage of it, i.e., i want to find an optimization method which support user supplied gradient. But i don't found such function in mma, it only allow this in Findminmum, which only aims to find local minmum.

so my question is 'is there such a global minmization function which allow user supplied gradient in mma?'(while in matlab, one can do this via fmincon)

$\endgroup$
  • 2
    $\begingroup$ All the algorithms used by NMinimize[] are gradient-free, so only FindMinimum[] will be able to take advantage of your separate gradient routine. $\endgroup$ – J. M.'s technical difficulties Aug 29 '17 at 16:02
  • $\begingroup$ thanks for the comment. just another question: as this function has lots of local minimum, if i use FindMinimum[] with gradient, will i always get stuck in a local minimum? $\endgroup$ – dr.bian Aug 29 '17 at 16:11
  • $\begingroup$ If you're unlucky at picking starting points, sure... $\endgroup$ – J. M.'s technical difficulties Aug 29 '17 at 16:28
2
$\begingroup$

If you want to do a gradient method, there's no need of a special function. FixedPoint or Nest or NestList or FixedPointList will all work. Say the optimization criterion is crit and the gradient is grad. Then specify a stepsize and iterate:

crit[x_] := (x - 5)^2;
grad[x_] = D[crit[x], x];
mu = 0.01;
initial = 3;
dec = FixedPointList[# - mu*grad[#] &, initial]

ListPlot[dec, PlotRange -> All]

enter image description here

An advantage of this is that you have complete control over initial values, stepsize and convergence criteria (see optional arguments of FixedPointList). If your optimization criterion has many local minima, then you'll want to repeat this from a large number of initial conditions.

$\endgroup$
  • $\begingroup$ thanks for your answer, l will have to learn how to use fixedpointlist afterwards $\endgroup$ – dr.bian Aug 29 '17 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.