On Thu, 30 Apr 2020 at 14:25, Ralf Gommers <ralf.gommers@gmail.com> wrote:


On Thu, Apr 30, 2020 at 4:43 AM Andrew Nelson <andyfaff@gmail.com> wrote:

But, I think there is another concern that may not have been expressed yet. `x0` is a required, positional argument for `minimize()`, as an array of initial parameter values.   Most of the global optimizers in scipy.optimize do not use `x0`.  Instead, they require bounds and explore the range of values between those bounds.   Would `x0` be required AND ignored for these global optimizers?   

The call signature for required positional arguments for `minimize` is different to the global optimizers. Being able to call the global minimizers via `minimize` would alleviate that. As you say the global minimizers do explore within bounds, and don't use an `x0`. The PR (as it currently exists) would still require `x0`, and it would be ignored. 
It would be possible to change that behaviour for `differential_evolution`, but would require the modification of the code to accept an `x0` keyword.

Hmm, the signature issue seems quite problematic. The opposite is also true: `bounds` is optional for minimize(), and cannot be made non-optional, however for the global optimizers it is required.


The call would be:
```
minimize(func, x0, bounds=bounds, method='differential-evolution')
```
Inside `minimize` it would look something like:
```
res = differential_evolution(func, bounds)
```

If bounds is None then an error would be raised, either from the `minimize` function or the underlying `differential_evolution` function.
At the moment the x0 supplied to minimize would be ignored by the underlying de function, but it would be possible to amend de to use x0 as well. 

With this proposal the minimize signature wouldn't change, neither would that of `differential_evolution` (with the possible exception of adding an `x0` keyword to use an initial position).