[SciPy-User] adding linear fitting routine

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Dec 4 19:26:28 EST 2013


On Wed, Dec 4, 2013 at 6:58 PM, Daniele Nicolodi <daniele at grinta.net> wrote:
> On 05/12/2013 00:21, David J Pine wrote:
>> Of course, that's the point of designing for backwards
>> compatibility--you don't see the need for more information when you
>> write the code, otherwise you would include it.  But as code gets used,
>> you sometimes see things you didn't see before.  So it's good to write
>> code that allows for unforeseen changes.
>
> If this is the reasoning, all functions or methods should return
> dictionaries.

some functions are reasonable targeted that we don't expect many changes.
I wouldn't know what else numpy.sum could return.
(numpy.nanmean also does the count of the non-nans but doesn't return it.)
we copied numpy.linalg.pinv into statsmodels because it doesn't give
as the singular values.
scipy.linalg got the change to optionally return the rank, with new
keyword `return_rank`

Sometimes the reply on issues in scipy is that we cannot add to the
return or change it because it's not backwards compatible. I would be
happy if I could change the returns of stats.linregress.

In the case of linfit or curve_fit, there are many possible additional
returns that we might want to add if the demand is large enough.
Last time there was a question, I argued against curve_fit returning
the std_err, i.e. np.sqrt(np.diag(pcov)) to keep it as just a minimal
fitting function.

I'm not a big fan of dictionaries because I don't like to type ["   "]
instead of just a dot.

Josef

>
> PS: is it so hard to stop top-posting?
>
> Cheers,
> Daniele
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-User mailing list