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 Bruce Southey
On 01/27/2012 09:00 AM, Benjamin Root wrote: On Friday, January 27, 2012, Pierre Haessig > wrote: > Le 26/01/2012 19:19, josef.p...@gmail.com a écrit : >> The discussion had this reversed, numpy matches the behavior of >> MATLAB,

Re: [Numpy-discussion] Cross-covariance function

2012-01-27 Thread Benjamin Root
On Friday, January 27, 2012, Pierre Haessig 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 that there was an

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 di

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Bruce Southey
On Thu, Jan 26, 2012 at 6:43 PM, wrote: > On Thu, Jan 26, 2012 at 3:58 PM, Bruce Southey wrote: >> On Thu, Jan 26, 2012 at 12:45 PM,   wrote: >>> On Thu, Jan 26, 2012 at 1:25 PM, Bruce Southey wrote: On Thu, Jan 26, 2012 at 10:07 AM, Pierre Haessig wrote: > Le 26/01/2012 15:57, B

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread josef . pktd
On Thu, Jan 26, 2012 at 3:58 PM, Bruce Southey wrote: > On Thu, Jan 26, 2012 at 12:45 PM,   wrote: >> On Thu, Jan 26, 2012 at 1:25 PM, Bruce Southey wrote: >>> On Thu, Jan 26, 2012 at 10:07 AM, Pierre Haessig >>> wrote: Le 26/01/2012 15:57, Bruce Southey a écrit : > Can you please provi

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Bruce Southey
On Thu, Jan 26, 2012 at 12:45 PM, wrote: > On Thu, Jan 26, 2012 at 1:25 PM, Bruce Southey wrote: >> On Thu, Jan 26, 2012 at 10:07 AM, Pierre Haessig >> wrote: >>> Le 26/01/2012 15:57, Bruce Southey a écrit : Can you please provide a couple of real examples with expected output that cl

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread josef . pktd
On Thu, Jan 26, 2012 at 1:25 PM, Bruce Southey wrote: > On Thu, Jan 26, 2012 at 10:07 AM, Pierre Haessig > 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, >>

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread Bruce Southey
On Thu, Jan 26, 2012 at 10:07 AM, Pierre Haessig 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 because I see a

Re: [Numpy-discussion] Cross-covariance function

2012-01-26 Thread josef . pktd
On Thu, Jan 26, 2012 at 12:26 PM, Sturla Molden 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 np.cov im

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 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 se

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 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 Bruce Southey
On Thu, Jan 26, 2012 at 7:19 AM, Pierre Haessig 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 negative feedbac

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 po

Re: [Numpy-discussion] Cross-covariance function

2012-01-21 Thread josef . pktd
On Sat, Jan 21, 2012 at 6:26 PM, John Salvatier 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 cross-correlation part.

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" 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 what I have alread

Re: [Numpy-discussion] Cross-covariance function

2012-01-21 Thread Elliot Saba
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 what I have already implemented, and I am in support of changing the functionality of cov(). I am unaware of any arguments for a covariance function that works in this

Re: [Numpy-discussion] Cross-covariance function

2012-01-20 Thread Pierre Haessig
Le 20/01/2012 16:30, Sturla Molden a écrit : > Often we just want the upper-right p x p quadrant. Thanks for the explanation. If I understood it correctly, you're interested in the *cross*-covariance block of the matrix (and now I understand better Elliot's message). Actually, I thought that was th

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 - X.mean(axis=0)[np.n

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 d

[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 I'd