[SciPy-dev] RFR: Proposed fixes in scipy.stats functions for calculation of variance/error/etc.

Ariel Rokem arokem at berkeley.edu
Mon Oct 26 01:31:30 EDT 2009


Hi Josef -

>
> >From looking at the three function, I would assume that the combined
> function would have a signature like
>
> def zscore(a, compare=None, axis=0, ddof=0)
>
> or two functions, one with compare, one without ?

Yes - I think that would be best. After all, someone wrote zmap with
some usecase in mind (I assume), so we would still want that
functionality to live on explicitly. So, I suggest (see attached diff)
to have two functions: one will be zscore and the other would be
zscore_compare. In the attached diff, I have decorated all these
functions with a deprecation warning and added these two new
functions, zscore (with the new, by-axis behavior. This makes more
sense to me, somehow) and zscore_compare.

>
>
> About default axis=0:
>
...

Thanks for the explanation and for digging into the history of this. I
still think that in the long run it would be preferable to have these
things be internally consistent (that is consistent between numpy and
scipy), rather than consistent with other tools.

Finally - I have tried to combine sem and stderr into one function,
under sem. Notice in particular the correction for ddof. My
understanding is that this should produce per default the result
std/sqrt(n-1), which is what we usually want for the sem. Is that
correct?

 Cheers,

Ariel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stats_var_cleanup102509_b.diff
Type: application/octet-stream
Size: 7597 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20091025/b665e510/attachment.obj>


More information about the SciPy-Dev mailing list