[Numpy-discussion] Adding weights to cov and corrcoef (Sebastian Berg)

Sebastian Berg sebastian at sipsolutions.net
Thu Mar 6 07:40:40 EST 2014


On Mi, 2014-03-05 at 10:21 -0800, David Goldsmith wrote:
> 
> 
> 
> Date: Wed, 05 Mar 2014 17:45:47 +0100
>         From: Sebastian Berg <sebastian at sipsolutions.net>
>         Subject: [Numpy-discussion] Adding weights to cov and corrcoef
>         To: numpy-discussion at scipy.org
>         Message-ID: <1394037947.21356.20.camel at sebastian-t440>
>         Content-Type: text/plain; charset="UTF-8"
>         
>         Hi all,
>         
>         in Pull Request https://github.com/numpy/numpy/pull/3864 Neol
>         Dawe
>         suggested adding new parameters to our `cov` and `corrcoef`
>         functions to
>         implement weights, which already exists for `average` (the PR
>         still
>         needs to be adapted).
> 
> 
> Do you mean adopted?
> 

What I meant was that the suggestion isn't actually implemented in the
PR at this time. So you can't pull it in to try things out.

>  
>         However, we may have missed something obvious, or maybe it is
>         already
>         getting too statistical for NumPy, or the keyword argument
>         might be
>         better `uncertainties` and `frequencies`. So comments and
>         insights are
>         very welcome :).
> 
> 
> +1 for it being "too baroque" for NumPy--should go in SciPy (if it
> isn't already there): IMHO, NumPy should be kept as "lean and mean" as
> possible, embellishments are what SciPy is for.  (Again, IMO.)
> 

Well, on the other hand, scipy does not actually have a `std` function
of its own, I think. So if it is quite useful I think this may be an
option (I don't think I ever used weights with std, so I can't argue
strongly for inclusion myself). Unless adding new functions to
`scipy.stats` (or just statsmodels) which implement different types of
weights is the longer term plan, then things might bite...

> DG
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion





More information about the NumPy-Discussion mailing list