Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying absolute errors in curve_fit #3098

Merged
merged 4 commits into from Dec 1, 2013
Merged

Specifying absolute errors in curve_fit #3098

merged 4 commits into from Dec 1, 2013

Conversation

pv
Copy link
Member

@pv pv commented Nov 29, 2013

Continued from gh-448

An option absolute_sigma is added to scipy.optimize.curve_fit, to accommodate the common cases:

  • sigma = relative weights, pcov variance estimated from data
  • sigma = one standard deviation errors on ydata, determines pcov variances

Also, make the returned pcov always be a 2D array. In indeterminate cases, it used to return a scalar, which may not be desirable.

@josef-pkt
Copy link
Member

Yes, I like returning the not available pcov in the correct shape better.
I don't know whether it would be better full of NaNs or full of infs. In either case users should get suspicious about their results.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling fffae00 on pv:curve-fit-yerr into 0e7eb52 on scipy:master.

pv added a commit that referenced this pull request Dec 1, 2013
ENH: optimize: specifying absolute errors in curve_fit

An option absolute_sigma is added to scipy.optimize.curve_fit, to accommodate
the common cases:

- sigma = relative weights, pcov variance estimated from data
- sigma = one standard deviation errors on ydata, determines pcov variances

Also, make the returned pcov always be a 2D array. In indeterminate cases,
it used to return a scalar, which may not be desirable.
@pv pv merged commit 511ea8f into scipy:master Dec 1, 2013
@pv
Copy link
Member Author

pv commented Dec 1, 2013

Ok, no objections, so merging.

@djpine
Copy link

djpine commented Dec 4, 2013

While people are modifying curve_fit, how about improving the docstring? Right now, it has a rather misleading example that works without providing initial guesses only because all the fitting parameters are close to one, the default values. I think users would benefit greatly from seeing an example that needs good initial guesses. I would be happy to work on this if no one else wants to.

@pv
Copy link
Member Author

pv commented Dec 4, 2013

@djpine: an improved the docstring would be welcome. If you already know how it should be improved, please go ahead.

@josef-pkt
Copy link
Member

This reminds me about the starting values.

If we change them slightly from 1.0 we avoid the list confusion, issue ???

@Tillsten
Copy link

Tillsten commented Dec 4, 2013

I would suggest to make the starting values a necessary argument. Giving it a default of one is probably a big source of bugs.

@djpine
Copy link

djpine commented Dec 4, 2013

I agree.


David Pine
Professor of Physics

Center for Soft Matter Research
Department of Physics
New York University

Office: 601 Meyer
Department Office: 424 Meyer

Mailing address:
4 Washington Place
New York, NY 10003

E-mail: pine@nyu.edu
Tel: 212-998-7744
Web: http://www.physics.nyu.edu/pine/Home.html
http://www.physics.nyu.edu/pine/Home.html


On Wed, Dec 4, 2013 at 10:12 PM, Till Stensitzki
notifications@github.comwrote:

I would suggest to make the starting values a necessary argument. Giving
it a default of one is probably a big source of bugs.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3098#issuecomment-29846034
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement scipy.optimize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants