[Numpy-discussion] Weighted Covariance/correlation

Sebastian Berg sebastian at sipsolutions.net
Fri Aug 15 09:46:33 EDT 2014


Hi all,

Tom Poole has opened pull request
https://github.com/numpy/numpy/pull/4960 to implement weights into
np.cov (correlation can be added), somewhat picking up the effort
started by Noel Dawe in https://github.com/numpy/numpy/pull/3864.

The pull request would currently implement an accuracy type `weights`
keyword argument as default, but have a switch `repeat_weights` to use
repeat type weights instead (frequency type are a special case of this I
think).

As far as I can see, the code is in a state that it can be tested. But
since it is a new feature, the names/defaults are up for discussion, so
maybe someone who might use such a feature has a preference. I know we
had a short discussion about this before, but it was a while ago. For
example another option would be to have the two weights as two keyword
arguments, instead of a boolean switch.

Regards,

Sebastian




More information about the NumPy-Discussion mailing list