Re: [Numpy-discussion] corrcoef

2007-09-06 Thread Sven Schreiber
John Hunter schrieb: > Is it desirable that numpy.corrcoef for two arrays returns a 2x2 array > rather than a scalar > > In [10]: npy.corrcoef(npy.random.rand(10), npy.random.rand(10)) > Out[10]: > array([[ 1., -0.16088728], >[-0.16088728, 1.]]) > > > I always end up ext

[Numpy-discussion] corrcoef

2007-09-06 Thread John Hunter
Is it desirable that numpy.corrcoef for two arrays returns a 2x2 array rather than a scalar In [10]: npy.corrcoef(npy.random.rand(10), npy.random.rand(10)) Out[10]: array([[ 1., -0.16088728], [-0.16088728, 1.]]) I always end up extracting the 0,1 element anyway. What is

Re: [Numpy-discussion] corrcoef of masked array

2007-06-04 Thread Jesper Larsen
On Wednesday 30 May 2007 19:48, Robert Kern wrote: > I'm afraid this doesn't work, either. Correlation matrices are constrained > to be positive semidefinite; that is, all of their eigenvalues must be >= > 0. Calculating each of the correlation coefficients in a pairwise fashion > doesn't incorpora

Re: [Numpy-discussion] corrcoef of masked array

2007-05-30 Thread Robert Kern
Jesper Larsen wrote: > Here is my solution for calculating the correlation coefficients for masked > arrays. Comments are appreciated: > > def macorrcoef(data1, data2): > """ > Calculates correlation coefficients taking masked out values > into account. > > It is assumed (but not checke

Re: [Numpy-discussion] corrcoef of masked array

2007-05-30 Thread Jesper Larsen
On Friday 25 May 2007 19:18, Robert Kern wrote: > Jesper Larsen wrote: > > Hi numpy users, > > > > I have a masked array of dimension (nvariables, nobservations) that > > contain missing values at arbitrary points. Is it safe to rely on > > numpy.corrcoeff to calculate the correlation coefficients

Re: [Numpy-discussion] corrcoef of masked array

2007-05-26 Thread Stefan van der Walt
Hi Jesper On Fri, May 25, 2007 at 10:37:44AM +0200, Jesper Larsen wrote: > I have a masked array of dimension (nvariables, nobservations) that contain > missing values at arbitrary points. Is it safe to rely on numpy.corrcoeff to > calculate the correlation coefficients of a masked array (it see

Re: [Numpy-discussion] corrcoef of masked array

2007-05-25 Thread Robert Kern
Jesper Larsen wrote: > Hi numpy users, > > I have a masked array of dimension (nvariables, nobservations) that contain > missing values at arbitrary points. Is it safe to rely on numpy.corrcoeff to > calculate the correlation coefficients of a masked array (it seems to give > reasonable results

[Numpy-discussion] corrcoef of masked array

2007-05-25 Thread Jesper Larsen
Hi numpy users, I have a masked array of dimension (nvariables, nobservations) that contain missing values at arbitrary points. Is it safe to rely on numpy.corrcoeff to calculate the correlation coefficients of a masked array (it seems to give reasonable results)? Cheers, Jesper __