<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Matt, Joseph, all,<div class=""><br class=""></div><div class="">Here’s my 2 cents.</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 24. Jan 2019, at 17:26, <a href="mailto:josef.pktd@gmail.com" class="">josef.pktd@gmail.com</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">IMO, a warning and better documentation would be more appropriate. </div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html" class="">https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html</a><span class="Apple-converted-space"> </span>does not show an example with starting values.<br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">curve_fit could issue a warning if p0 is not specified, or warn if convergence fails and p0 was not specified.</div></div></blockquote><div><br class=""></div><div>I think a better docstring for curve_fit would be good, mentioning the importance of specifying p0 and that the default is ones.</div><div>Also +1 to add a mention of lmfit from the scipy.optimize docs somewhere, recommending it to users as a high-level package that directly builds on scipy.optimise providing extra functionality and conveniences.</div><div><br class=""></div><div>-1 on making the change to require p0 to be passed, and starting a deprecation process to eventually give an error on this in a few years. There are cases and existing scripts that work just fine with the current default. IMO they should continue to work (even without warning) in scipy 1.x just like they do in the currently scipy 1.1.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">I think it should also be possible to improve the default starting values, e.g. if the function fails or if bounds are provided.</div><br class="Apple-interchange-newline"></div></blockquote></div><br class=""><div class="">-1 on adding complex logic and guessing and trying code for p0 to curve_fit.</div><div class="">scipy.optimize is pretty low-level, adding this kind of â€œconvenience” which is hard to explain and document and maintain seems a bit out of place to me.</div><div class="">Also any change in how p0 is chosen likely will change results that come out for some use cases, so for the same reason mentioned above (stability within the scipy 1.x series) I’m -1 to change this.</div><div class=""><br class=""></div><div class="">Christoph</div></div></body></html>