scipy/scipy — pull request #448 by cdeil (2013-02-24 23:27:03+00:00)
Title: WIP: Add scale_pcov argument to scipy.optimize.curve_fit

An option `scale_pcov` is added to `scipy.optimize.curve_fit`, to accommodate the common cases:
* `sigma` = relative weights, output covariance matrix `pcov` should be scaled. This was the previous behaviour, so to keep backwards compatibility I chose the default `scale_pcov=True`.
* `sigma` = one standard deviation errors on `ydata`, `pcov` should not be scaled. This use case was requested e.g. [here](http://mail.scipy.org/pipermail/scipy-user/2013-February/034196.html) and can now be obtained by explicitly setting `scale_pcov=False`.

@josef-pkt @taldcroft Please comment if the description in the docstring is OK or if it can be improved.
I was thinking that maybe a new option `yerr` or `ydata_err` that is mutually exclusive with `sigma` instead of the new option `scale_pcov` could be better?

I can add a unit test for `scale_pcov=False` tomorrow.