[SciPy-Dev] curve_fit() should require initial values for parameters

Stefan van der Walt stefanv at berkeley.edu
Tue Jan 29 20:29:42 EST 2019


On Tue, 29 Jan 2019 17:53:37 +0100, Ilhan Polat wrote:
> > The problem I have with this is that there really is not an option to "try
> automatic first".  There is "try `np.ones(n_variables)` first".   This, or
> any other value, is really not a defensible choice for starting
> values.  Starting
> values always depend on the function used and the data being fit.
> 
> Why not? 1.s are as good as any other choice.

This entire thread is about why np.ones is not a good choice.  It is not
as good as any other in any particular case, and is patently wrong for
most problems.  Sure, each problem has its own "better" and "worse"
initial values, so if you are trying to optimize over all possible
cases, it may be as good a choice as any other.  But the question here
is exactly about whether that is a sensible thing to do.  Matt argues
that it is not, and I find his argument convincing.

The current API leads the user to believe that, without specifying p0,
they are likely to get a reasonable answer out.  We can help our users
by signaling to them that this is simply not the case.

Best regards,
Stéfan


More information about the SciPy-Dev mailing list