Re: [Numpy-discussion] Cross-covariance function

2012-02-01 Thread Pierre Haessig
Hi Bruce, Sorry for the delay in the answer. Le 27/01/2012 17:28, Bruce Southey a écrit : The output is still a covariance so do we really need yet another set of very similar functions to maintain? Or can we get away with a new keyword? The idea of an additional keyword seems appealing.

Re: [Numpy-discussion] Cross-covariance function

2012-01-27 Thread Pierre Haessig
Le 26/01/2012 19:19, josef.p...@gmail.com a écrit : The discussion had this reversed, numpy matches the behavior of MATLAB, while R (statistics) only returns the cross covariance part as proposed. I would also say that there was an attempt to match MATLAB behavior. However, there is big

Re: [Numpy-discussion] Cross-covariance function

2012-01-27 Thread Benjamin Root
On Friday, January 27, 2012, Pierre Haessig pierre.haes...@crans.org wrote: Le 26/01/2012 19:19, josef.p...@gmail.com a écrit : The discussion had this reversed, numpy matches the behavior of MATLAB, while R (statistics) only returns the cross covariance part as proposed. I would also say

Re: [Numpy-discussion] Cross-covariance function

2012-01-27 Thread Bruce Southey
On 01/27/2012 09:00 AM, Benjamin Root wrote: On Friday, January 27, 2012, Pierre Haessig pierre.haes...@crans.org mailto:pierre.haes...@crans.org wrote: Le 26/01/2012 19:19, josef.p...@gmail.com mailto:josef.p...@gmail.com a écrit : The discussion had this reversed, numpy matches the

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Pierre Haessig
Le 22/01/2012 01:40, josef.p...@gmail.com a écrit : same here, When I rewrote scipy.stats.spearmanr, I matched the numpy behavior for two arrays, while R only returns the cross-correlation part. Since I've seen no negative feedback, I jumped to the next step by creating a Trac account and

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Bruce Southey
On Thu, Jan 26, 2012 at 7:19 AM, Pierre Haessig pierre.haes...@crans.org wrote: Le 22/01/2012 01:40, josef.p...@gmail.com a écrit : same here, When I rewrote scipy.stats.spearmanr, I matched the numpy behavior for two arrays, while R only returns the cross-correlation part. Since I've seen no

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Pauli Virtanen
26.01.2012 15:57, Bruce Southey kirjoitti: [clip] Also I believe that changing the np.cov function will cause major havoc because numpy and people's code depend on the current behavior. Changing the behavior of `cov` is IMHO not really possible at this point --- the current behavior is not a

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Pierre Haessig
Le 26/01/2012 15:57, Bruce Southey a écrit : Can you please provide a couple of real examples with expected output that clearly show what you want? Hi Bruce, Thanks for your ticket feedback ! It's precisely because I see a big potential impact of the proposed change that I send first a ML

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Pierre Haessig
Le 26/01/2012 16:50, Pauli Virtanen a écrit : the current behavior is not a bug, I completely agree that numpy.cov(m,y) does what it says ! I (and apparently some other people) are only questioning why there is such a behavior ? Indeed, the second variable `y` is presented as An additional set

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Sturla Molden
Den 26.01.2012 17:25, skrev Pierre Haessig: However, in the case this change is not possible, I would see this solution : * add and xcov function that does what Elliot and Sturla and I described, because The current np.cov implementation returns the cross-covariance the way it is commonly

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread josef . pktd
On Thu, Jan 26, 2012 at 12:26 PM, Sturla Molden stu...@molden.no wrote: Den 26.01.2012 17:25, skrev Pierre Haessig: However, in the case this change is not possible, I would see this solution : * add and xcov function that does what Elliot and Sturla and I described, because The current

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Bruce Southey
On Thu, Jan 26, 2012 at 10:07 AM, Pierre Haessig pierre.haes...@crans.org wrote: Le 26/01/2012 15:57, Bruce Southey a écrit : Can you please provide a couple of real examples with expected output that clearly show what you want? Hi Bruce, Thanks for your ticket feedback ! It's precisely

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread josef . pktd
On Thu, Jan 26, 2012 at 3:58 PM, Bruce Southey bsout...@gmail.com wrote: On Thu, Jan 26, 2012 at 12:45 PM,  josef.p...@gmail.com wrote: On Thu, Jan 26, 2012 at 1:25 PM, Bruce Southey bsout...@gmail.com wrote: On Thu, Jan 26, 2012 at 10:07 AM, Pierre Haessig pierre.haes...@crans.org wrote: Le

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Bruce Southey
On Thu, Jan 26, 2012 at 6:43 PM, josef.p...@gmail.com wrote: On Thu, Jan 26, 2012 at 3:58 PM, Bruce Southey bsout...@gmail.com wrote: On Thu, Jan 26, 2012 at 12:45 PM,  josef.p...@gmail.com wrote: On Thu, Jan 26, 2012 at 1:25 PM, Bruce Southey bsout...@gmail.com wrote: On Thu, Jan 26, 2012 at

Re: [Numpy-discussion] Cross-covariance function

2012-01-21 Thread John Salvatier
I ran into this a while ago and was confused why cov did not behave the way pierre suggested. On Jan 21, 2012 12:48 PM, Elliot Saba staticfl...@gmail.com wrote: Thank you Sturla, that's exactly what I want. I'm sorry that I was not able to reply for so long, but Pierre's code is similar to

Re: [Numpy-discussion] Cross-covariance function

2012-01-21 Thread josef . pktd
On Sat, Jan 21, 2012 at 6:26 PM, John Salvatier jsalv...@u.washington.edu wrote: I ran into this a while ago and was confused why cov did not behave the way pierre suggested. same here, When I rewrote scipy.stats.spearmanr, I matched the numpy behavior for two arrays, while R only returns the

Re: [Numpy-discussion] Cross-covariance function

2012-01-20 Thread Pierre Haessig
Hi Eliot, Le 19/01/2012 07:50, Elliot Saba a écrit : I recently needed to calculate the cross-covariance of two random vectors, (e.g. I have two matricies, X and Y, the columns of which are observations of one variable, and I wish to generate a matrix pairing each value of X and Y) I

Re: [Numpy-discussion] Cross-covariance function

2012-01-20 Thread Sturla Molden
Den 20.01.2012 13:39, skrev Pierre Haessig: I don't see how does your function relates to numpy.cov [1]. Is it an extended case function or is there a difference in the underlying math ? If X is rank n x p, then np.cov(X, rowvar=False) is equal to S after cX = X -

[Numpy-discussion] Cross-covariance function

2012-01-18 Thread Elliot Saba
Greetings, I recently needed to calculate the cross-covariance of two random vectors, (e.g. I have two matricies, X and Y, the columns of which are observations of one variable, and I wish to generate a matrix pairing each value of X and Y) and so I wrote a small utility function to do so, and