[SciPy-User] Strange behaviour from corrcoef when calculating correlation-matrix in SciPy/NumPy.
Wed Mar 2 13:37:34 CST 2011
Looks like the meaning of the argument 'y' in cov() (which is used by
corrcoef()) was changed back in 2006:
The old behavior appears to have been more like matlab's behavior.
On Wed, Mar 2, 2011 at 1:28 PM, Pauli Virtanen <firstname.lastname@example.org> wrote:
> On Wed, 02 Mar 2011 14:06:23 -0500, josef.pktd wrote:
> > I also found it a bit strange that corrcoef(x,y) creates the stacked
> > version. scipy.stats.spearmanr inherits this behavior since I rewrote
> > it. scipy.stats.pearsonr hasn't been rewritten yet.
> > It didn't bug me enough, to figure out whether there is a reason for
> > this stacking behavior or not.
> The Matlab convention
> corrcoef(x, y) == corrcoef(c_[x.ravel(), y.ravel()])
> is actually also a bit peculiar if you haven't seen it before -- how come
> there are now two variables, if x had variables on the rows (why not bail
> out with an error?).
> I don't typically deal with stuff that requires these functions, so I
> don't have an opinion, but it would have been better to do the same thing
> even if there is no real reason for it...
> Pauli Virtanen
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User