7

I'm learning python to make models these days. I read the documentation of scipy.optimize.fmin. It also recommends scipy.optimize.minimize. It seems that scipy.optimize.minimize is a more advanced method. Real wonder what's the difference between these two.

Xiaodong
  • 71
  • 1
  • 2

1 Answers1

6

scipy.optimize.minimize is a high-level interface that lets you choose from a broad range of solvers, one of which is Nelder–Mead. scipy.optimize.fmin is a special solver using Nelder–Mead. For a specific subdocumentation of minimize with Nelder–Mead, see here.

  • if i understand correctly, then `scipy.optimize.minimize` is more general vs `scipy.optimize.fmin` is more specific. And by extension you can do exactly what `fmin` does with `minimize` by choosing the Nelder-Mead method. – Trevor Boyd Smith Oct 09 '19 at 12:02
  • @TrevorBoydSmith at a first glance I'd say yes. Comparing [this](https://docs.scipy.org/doc/scipy/reference/optimize.minimize-neldermead.html#optimize-minimize-neldermead) and [this](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin.html) and references therein might suggest that there are differences between the implementations. For instance the latter doesn't have an `adaptive` keyword argument. Depending on how hands-on you want your minimization to be they might differ. – Andras Deak -- Слава Україні Oct 09 '19 at 12:41
  • ya i noticed the missing "adaptive" (i.e. dynamic) parameter in the `fmin` as the main difference. (short aside/non-sequitar: i read a little about that specific feature. for high-dimensional problems the traditional code is unusually slow and so this parameter can significantly speed up the optimizer) – Trevor Boyd Smith Oct 09 '19 at 14:50